类 ItemUtils
java.lang.Object
committee.nova.mods.avaritia.api.util.ItemUtils
Description:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static booleanareStacksSameType(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2) static booleancanCombineStacks(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2) static voidclearEnchants(net.minecraft.world.item.ItemStack stack) static net.minecraft.world.item.ItemStackcombineStacks(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2) static booleancompareTags(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2) static net.minecraft.world.item.ItemStackcopyStack(net.minecraft.world.item.ItemStack stack, int quantity) Copy's an ItemStack.static @NonNull net.minecraft.world.item.ItemStackdeserialize(com.google.gson.JsonObject json) static voiddropInventory(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 voiddropItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level, Vector3 dropLocation) Drops an item with basic default random velocity.static voiddropItem(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 BlockPosstatic voiddropItem(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 BlockPosgetDisplayName(com.google.gson.JsonObject json) static StringgetDisplayName(net.minecraft.world.item.Item item) static StringgetDisplayName(net.minecraft.world.item.ItemStack itemStack) static StringgetId(net.minecraft.world.item.Item item) static StringgetId(net.minecraft.world.item.ItemStack itemStack) static net.minecraft.world.item.Itemstatic net.minecraft.world.item.ItemStackgetItemStack(String id) static net.minecraft.world.item.ItemStackgetItemStack(String id, boolean throwException) static StringgetNbtString(net.minecraft.world.item.ItemStack itemStack) static net.minecraft.world.item.ItemStackgrow(net.minecraft.world.item.ItemStack stack, int amount) static net.minecraft.world.item.ItemStackmapEquals(net.minecraft.world.item.ItemStack stack, Map<net.minecraft.world.item.ItemStack, Integer> map) static voidremoveEnchant(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.enchantment.Enchantment pEnchantment) static com.google.gson.JsonObjectserialize(net.minecraft.world.item.ItemStack reward) static net.minecraft.world.item.ItemStackshrink(net.minecraft.world.item.ItemStack stack, int amount, boolean container) static net.minecraft.world.item.ItemStackwithSize(net.minecraft.world.item.ItemStack stack, int size, boolean container)
-
构造器详细资料
-
ItemUtils
public ItemUtils()
-
-
方法详细资料
-
getId
-
getId
-
getItem
-
getItemStack
-
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
-
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
-
getDisplayName
-
getDisplayName
-
mapEquals
-
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- TheItemStackbeing compared.stack2- TheItemStackto 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)
-