Class BucketLibUtil
java.lang.Object
de.cech12.bucketlib.util.BucketLibUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.ItemStackaddBlock(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.block.Block block) static net.minecraft.world.item.ItemStackaddContent(net.minecraft.world.item.ItemStack itemStack, net.minecraft.resources.Identifier content) static net.minecraft.world.item.ItemStackaddEntityType(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.EntityType<?> entityType) static net.minecraft.world.item.ItemStackaddFluid(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.material.Fluid fluid) static net.minecraft.world.item.ItemStackaddMilk(net.minecraft.world.item.ItemStack itemStack) static booleancontainsBlock(net.minecraft.core.component.DataComponentGetter componentGetter) static booleancontainsContent(net.minecraft.core.component.DataComponentGetter componentGetter) static booleancontainsEntityType(net.minecraft.core.component.DataComponentGetter componentGetter) static booleancontainsFluid(net.minecraft.world.item.ItemInstance itemInstance) static booleancontainsMilk(net.minecraft.core.component.DataComponentGetter componentGetter) static net.minecraft.world.item.ItemStackcreateEmptyResult(net.minecraft.world.item.ItemStack initialStack, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack resultStack, net.minecraft.world.InteractionHand hand) static net.minecraft.world.item.ItemStackcreateEmptyResult(net.minecraft.world.item.ItemStack initialStack, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack resultStack, net.minecraft.world.InteractionHand hand, boolean addAdditionalBucketOnInstaBuild) static voiddamageByOne(net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.server.level.ServerPlayer player) Deprecated.static voiddamageByOne(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.player.Player player) Adds damage to the bucket if damaging is enabled.static net.minecraft.world.level.block.BlockgetBlock(net.minecraft.core.component.DataComponentGetter componentGetter) static net.minecraft.resources.IdentifiergetContent(net.minecraft.core.component.DataComponentGetter componentGetter) static StringgetContentString(net.minecraft.core.component.DataComponentGetter componentGetter) static net.minecraft.world.entity.EntityType<?> getEntityType(net.minecraft.core.component.DataComponentGetter componentGetter) static StringgetEntityTypeString(net.minecraft.core.component.DataComponentGetter componentGetter) static net.minecraft.world.level.material.FluidgetFluid(net.minecraft.world.item.ItemInstance itemInstance) static net.minecraft.world.item.ItemgetItem(net.minecraft.world.item.ItemInstance itemInstance) static net.minecraft.world.item.ItemStackgetItemStack(net.minecraft.world.item.ItemInstance itemInstance) static net.minecraft.world.item.ItemStackTemplategetItemStackTemplate(net.minecraft.world.item.ItemInstance itemInstance) static booleanhasInfinityEnchantment(@NotNull net.minecraft.world.item.ItemInstance itemInstance) Checks if the given bucket is enchanted with the Infinity enchantment.static booleanisAffectedByInfinityEnchantment(@NotNull net.minecraft.world.item.ItemInstance itemInstance) Checks if the given bucket is affected by Infinity enchantment.static booleanisEmpty(net.minecraft.world.item.ItemInstance itemInstance) static booleanisInfinityEnchantmentAllowed(@NotNull net.minecraft.world.item.ItemInstance itemInstance) Checks if the given bucket is allowed to be enchanted with Infinity enchantment.static booleannotCreative(net.minecraft.world.entity.Entity entity) static net.minecraft.world.item.ItemStackremoveBlock(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable net.minecraft.world.entity.player.Player player, boolean damage) static voidremoveContentNoCopy(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable net.minecraft.world.entity.player.Player player, boolean damage) static net.minecraft.world.item.ItemStackremoveEntityData(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable net.minecraft.world.entity.player.Player player, boolean damage) static net.minecraft.world.item.ItemStackremoveEntityData(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable net.minecraft.world.entity.player.Player player, @Nullable net.minecraft.world.entity.Entity entity, boolean damage) static net.minecraft.world.item.ItemStackremoveFluid(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable net.minecraft.world.entity.player.Player player) static net.minecraft.world.item.ItemStackremoveMilk(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable net.minecraft.world.entity.player.Player player)
-
Field Details
-
MILK_LOCATION
public static final net.minecraft.resources.Identifier MILK_LOCATION
-
-
Method Details
-
notCreative
public static boolean notCreative(net.minecraft.world.entity.Entity entity) -
getItem
public static net.minecraft.world.item.Item getItem(net.minecraft.world.item.ItemInstance itemInstance) -
getItemStack
public static net.minecraft.world.item.ItemStack getItemStack(net.minecraft.world.item.ItemInstance itemInstance) -
getItemStackTemplate
public static net.minecraft.world.item.ItemStackTemplate getItemStackTemplate(net.minecraft.world.item.ItemInstance itemInstance) -
isEmpty
public static boolean isEmpty(net.minecraft.world.item.ItemInstance itemInstance) -
createEmptyResult
public static net.minecraft.world.item.ItemStack createEmptyResult(net.minecraft.world.item.ItemStack initialStack, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack resultStack, net.minecraft.world.InteractionHand hand) -
createEmptyResult
public static net.minecraft.world.item.ItemStack createEmptyResult(net.minecraft.world.item.ItemStack initialStack, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack resultStack, net.minecraft.world.InteractionHand hand, boolean addAdditionalBucketOnInstaBuild) -
damageByOne
public static void damageByOne(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.player.Player player) Adds damage to the bucket if damaging is enabled.- Parameters:
stack- item stack which gets damagelevel- ServerLevelplayer- Player object or null if no player is involved
-
damageByOne
@Deprecated public static void damageByOne(net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.server.level.ServerPlayer player) Deprecated.It is recommended to usedamageByOne(ItemStack, ServerLevel, Player)instead.Adds damage to the bucket if damaging is enabled. This method should only be used if there is no ServerLevel in the calling context. Enchantments have no effect here!- Parameters:
stack- item stack which gets damage
-
isAffectedByInfinityEnchantment
public static boolean isAffectedByInfinityEnchantment(@NotNull @NotNull net.minecraft.world.item.ItemInstance itemInstance) Checks if the given bucket is affected by Infinity enchantment.- Parameters:
itemInstance- checked item instance- Returns:
- boolean
-
hasInfinityEnchantment
public static boolean hasInfinityEnchantment(@NotNull @NotNull net.minecraft.world.item.ItemInstance itemInstance) Checks if the given bucket is enchanted with the Infinity enchantment.- Parameters:
itemInstance- checked item instance- Returns:
- boolean
-
isInfinityEnchantmentAllowed
public static boolean isInfinityEnchantmentAllowed(@NotNull @NotNull net.minecraft.world.item.ItemInstance itemInstance) Checks if the given bucket is allowed to be enchanted with Infinity enchantment.- Parameters:
itemInstance- checked item instance- Returns:
- boolean
-
containsContent
public static boolean containsContent(net.minecraft.core.component.DataComponentGetter componentGetter) -
getContent
public static net.minecraft.resources.Identifier getContent(net.minecraft.core.component.DataComponentGetter componentGetter) -
getContentString
public static String getContentString(net.minecraft.core.component.DataComponentGetter componentGetter) -
addContent
public static net.minecraft.world.item.ItemStack addContent(net.minecraft.world.item.ItemStack itemStack, net.minecraft.resources.Identifier content) -
removeContentNoCopy
public static void removeContentNoCopy(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable @Nullable net.minecraft.world.entity.player.Player player, boolean damage) -
containsMilk
public static boolean containsMilk(net.minecraft.core.component.DataComponentGetter componentGetter) -
addMilk
public static net.minecraft.world.item.ItemStack addMilk(net.minecraft.world.item.ItemStack itemStack) -
removeMilk
public static net.minecraft.world.item.ItemStack removeMilk(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable @Nullable net.minecraft.world.entity.player.Player player) -
containsFluid
public static boolean containsFluid(net.minecraft.world.item.ItemInstance itemInstance) -
getFluid
public static net.minecraft.world.level.material.Fluid getFluid(net.minecraft.world.item.ItemInstance itemInstance) -
addFluid
public static net.minecraft.world.item.ItemStack addFluid(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.material.Fluid fluid) -
removeFluid
public static net.minecraft.world.item.ItemStack removeFluid(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable @Nullable net.minecraft.world.entity.player.Player player) -
containsEntityType
public static boolean containsEntityType(net.minecraft.core.component.DataComponentGetter componentGetter) -
getEntityType
public static net.minecraft.world.entity.EntityType<?> getEntityType(net.minecraft.core.component.DataComponentGetter componentGetter) -
getEntityTypeString
public static String getEntityTypeString(net.minecraft.core.component.DataComponentGetter componentGetter) -
addEntityType
public static net.minecraft.world.item.ItemStack addEntityType(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.EntityType<?> entityType) -
removeEntityData
public static net.minecraft.world.item.ItemStack removeEntityData(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable @Nullable net.minecraft.world.entity.player.Player player, boolean damage) -
removeEntityData
public static net.minecraft.world.item.ItemStack removeEntityData(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable @Nullable net.minecraft.world.entity.player.Player player, @Nullable @Nullable net.minecraft.world.entity.Entity entity, boolean damage) -
containsBlock
public static boolean containsBlock(net.minecraft.core.component.DataComponentGetter componentGetter) -
getBlock
public static net.minecraft.world.level.block.Block getBlock(net.minecraft.core.component.DataComponentGetter componentGetter) -
addBlock
public static net.minecraft.world.item.ItemStack addBlock(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.block.Block block) -
removeBlock
public static net.minecraft.world.item.ItemStack removeBlock(net.minecraft.world.item.ItemStack itemStack, net.minecraft.server.level.ServerLevel level, @Nullable @Nullable net.minecraft.world.entity.player.Player player, boolean damage)
-
damageByOne(ItemStack, ServerLevel, Player)instead.