类 ContentProviders

java.lang.Object
io.github.lijinhong11.mittellib.hook.ContentProviders

public class ContentProviders extends Object
  • 构造器详细资料

    • ContentProviders

      public ContentProviders()
  • 方法详细资料

    • init

      public static void init()
    • getById

      @Nullable public static @Nullable ContentProvider getById(String id)
      Get a content provider by its id
      参数:
      id - the content provider's id
      返回:
      the content provider, null if not found
    • getItemStack

      @Nullable public static @Nullable ItemStack getItemStack(@NotNull @NotNull String fullNamespaceKey)
      Get an item stack through content provider by its id
      参数:
      fullNamespaceKey - the item id expression (e.g. nexo:example_block)
      返回:
      the item stack, null if not found
    • getIdFromItem

      @Nullable public static @Nullable String getIdFromItem(@NotNull @NotNull ItemStack item)
      Get item's id
      参数:
      item - the item
      返回:
      the item's id in content provider, null if not found
    • getBlock

      @Nullable public static @Nullable PackedBlock getBlock(@NotNull @NotNull String fullNamespaceKey)
      Get a block through content provider by its id
      参数:
      fullNamespaceKey - the block id expression (e.g. nexo:example_block)
      返回:
      the block, null if not found
    • destroyBlock

      public static void destroyBlock(@NotNull @NotNull Location loc)
      Remove the block whatever which plugin owns it
    • getItemSuggestions

      @NotNull public static @NotNull List<String> getItemSuggestions()
      Get all item suggestions (including blocks) for tab complete
      返回:
      a list of item suggestion
    • getBlockSuggestions

      @NotNull public static @NotNull List<String> getBlockSuggestions()
      Get all block suggestions for tab complete
      返回:
      a list of block suggestion
    • getAllUsableBlocks

      @NotNull public static @NotNull List<PackedBlock> getAllUsableBlocks()
      Get all usable blocks (which bind an item)
      返回:
      a list of all usable blocks
    • getBlockByLocation

      @Nullable public static @Nullable PackedBlock getBlockByLocation(Location loc)
      Get the block by its location
      返回:
      the block