类 ItemUtils

java.lang.Object
committee.nova.mods.avaritia.api.util.ItemUtils

public class ItemUtils extends Object
Description:
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static boolean
    areStacksSameType(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
     
    static boolean
    canCombineStacks(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
     
    static void
    clearEnchants(net.minecraft.world.item.ItemStack stack)
     
    static net.minecraft.world.item.ItemStack
    combineStacks(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
     
    static boolean
    compareTags(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
     
    static net.minecraft.world.item.ItemStack
    copyStack(net.minecraft.world.item.ItemStack stack, int quantity)
    Copy's an ItemStack.
    static @NonNull net.minecraft.world.item.ItemStack
    deserialize(com.google.gson.JsonObject json)
     
    static void
    dropInventory(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.Container inventory)
    Drops all the items in an IInventory on the ground.
    static void
    dropItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level, Vector3 dropLocation)
    Drops an item with basic default random velocity.
    static void
    dropItem(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack)
    Drops an item in the world at the given BlockPos
    static void
    dropItem(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, double velocity)
    Drops an item in the world at the given BlockPos
    getDisplayName(com.google.gson.JsonObject json)
     
    static String
    getDisplayName(net.minecraft.world.item.Item item)
     
    static String
    getDisplayName(net.minecraft.world.item.ItemStack itemStack)
     
    static String
    getId(net.minecraft.world.item.Item item)
     
    static String
    getId(net.minecraft.world.item.ItemStack itemStack)
     
    static net.minecraft.world.item.Item
     
    static net.minecraft.world.item.ItemStack
     
    static net.minecraft.world.item.ItemStack
    getItemStack(String id, boolean throwException)
     
    static String
    getNbtString(net.minecraft.world.item.ItemStack itemStack)
     
    static net.minecraft.world.item.ItemStack
    grow(net.minecraft.world.item.ItemStack stack, int amount)
     
    static net.minecraft.world.item.ItemStack
    mapEquals(net.minecraft.world.item.ItemStack stack, Map<net.minecraft.world.item.ItemStack,Integer> map)
     
    static void
    removeEnchant(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.Enchantment pEnchantment)
     
    static com.google.gson.JsonObject
    serialize(net.minecraft.world.item.ItemStack reward)
     
    static net.minecraft.world.item.ItemStack
    shrink(net.minecraft.world.item.ItemStack stack, int amount, boolean container)
     
    static net.minecraft.world.item.ItemStack
    withSize(net.minecraft.world.item.ItemStack stack, int size, boolean container)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ItemUtils

      public ItemUtils()
  • 方法详细资料

    • getId

      public static String getId(net.minecraft.world.item.Item item)
    • getId

      public static String getId(net.minecraft.world.item.ItemStack itemStack)
    • getItem

      public static net.minecraft.world.item.Item getItem(String id)
    • getItemStack

      public static net.minecraft.world.item.ItemStack getItemStack(String id)
    • getItemStack

      public static net.minecraft.world.item.ItemStack getItemStack(String id, boolean throwException) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      抛出:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getNbtString

      public static String getNbtString(net.minecraft.world.item.ItemStack itemStack)
    • deserialize

      @NonNull public static @NonNull net.minecraft.world.item.ItemStack deserialize(com.google.gson.JsonObject json)
    • serialize

      public static com.google.gson.JsonObject serialize(net.minecraft.world.item.ItemStack reward)
    • getDisplayName

      public String getDisplayName(com.google.gson.JsonObject json)
    • getDisplayName

      public static String getDisplayName(net.minecraft.world.item.ItemStack itemStack)
    • getDisplayName

      public static String getDisplayName(net.minecraft.world.item.Item item)
    • mapEquals

      public static net.minecraft.world.item.ItemStack mapEquals(net.minecraft.world.item.ItemStack stack, Map<net.minecraft.world.item.ItemStack,Integer> map)
    • withSize

      public static net.minecraft.world.item.ItemStack withSize(net.minecraft.world.item.ItemStack stack, int size, boolean container)
    • grow

      public static net.minecraft.world.item.ItemStack grow(net.minecraft.world.item.ItemStack stack, int amount)
    • shrink

      public static net.minecraft.world.item.ItemStack shrink(net.minecraft.world.item.ItemStack stack, int amount, boolean container)
    • copyStack

      public static net.minecraft.world.item.ItemStack copyStack(@Nonnull net.minecraft.world.item.ItemStack stack, int quantity)
      Copy's an ItemStack.
      参数:
      stack - Stack to copy.
      quantity - Size of the new stack.
      返回:
      The new stack.
    • areStacksSameType

      public static boolean areStacksSameType(@Nonnull net.minecraft.world.item.ItemStack stack1, @Nonnull net.minecraft.world.item.ItemStack stack2)
      参数:
      stack1 - The ItemStack being compared.
      stack2 - The ItemStack to compare to.
      返回:
      whether the two items are the same in terms of damage and itemID.
    • canCombineStacks

      public static boolean canCombineStacks(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
    • combineStacks

      public static net.minecraft.world.item.ItemStack combineStacks(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
    • compareTags

      public static boolean compareTags(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2)
    • dropItem

      public static void dropItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level, Vector3 dropLocation)
      Drops an item with basic default random velocity.
    • dropItem

      public static void dropItem(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, @Nonnull net.minecraft.world.item.ItemStack stack, double velocity)
      Drops an item in the world at the given BlockPos
      参数:
      world - World to drop the item.
      pos - Location to drop item.
      stack - ItemStack to drop.
      velocity - The velocity to add.
    • dropItem

      public static void dropItem(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, @Nonnull net.minecraft.world.item.ItemStack stack)
      Drops an item in the world at the given BlockPos
      参数:
      world - World to drop the item.
      pos - Location to drop item.
      stack - ItemStack to drop.
    • dropInventory

      public static void dropInventory(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.Container inventory)
      Drops all the items in an IInventory on the ground.
      参数:
      world - World to drop the item.
      pos - Position to drop item.
      inventory - IInventory to drop.
    • removeEnchant

      public static void removeEnchant(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.Enchantment pEnchantment)
    • clearEnchants

      public static void clearEnchants(net.minecraft.world.item.ItemStack stack)