Package de.cech12.bucketlib.util
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.world.item.ItemStack itemStack) static booleancontainsContent(net.minecraft.world.item.ItemStack itemStack) static booleancontainsEntityType(net.minecraft.core.component.DataComponentHolder itemStack) static booleancontainsFluid(net.minecraft.world.item.ItemStack itemStack) static booleancontainsMilk(net.minecraft.core.component.DataComponentHolder itemStack) 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.world.item.ItemStack itemStack) static net.minecraft.resources.IdentifiergetContent(net.minecraft.core.component.DataComponentHolder itemStack) static StringgetContentString(net.minecraft.core.component.DataComponentHolder itemStack) static net.minecraft.world.entity.EntityType<?> getEntityType(net.minecraft.world.item.ItemStack itemStack) static StringgetEntityTypeString(net.minecraft.world.item.ItemStack itemStack) static net.minecraft.world.level.material.FluidgetFluid(net.minecraft.world.item.ItemStack itemStack) static booleanhasInfinityEnchantment(@NotNull net.minecraft.world.item.ItemStack itemStack) Checks if the given bucket is enchanted with the Infinity enchantment.static booleanisAffectedByInfinityEnchantment(@NotNull net.minecraft.world.item.ItemStack itemStack) Checks if the given bucket is affected by Infinity enchantment.static booleanisEmpty(net.minecraft.world.item.ItemStack itemStack) static booleanisInfinityEnchantmentAllowed(@NotNull net.minecraft.world.item.ItemStack itemStack) 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) -
isEmpty
public static boolean isEmpty(net.minecraft.world.item.ItemStack itemStack) -
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.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! It is recommended to usedamageByOne(ItemStack, ServerLevel, Player)- Parameters:
stack- item stack which gets damage
-
isAffectedByInfinityEnchantment
public static boolean isAffectedByInfinityEnchantment(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack) Checks if the given bucket is affected by Infinity enchantment.- Parameters:
itemStack- checked item stack- Returns:
- boolean
-
hasInfinityEnchantment
public static boolean hasInfinityEnchantment(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack) Checks if the given bucket is enchanted with the Infinity enchantment.- Parameters:
itemStack- checked item stack- Returns:
- boolean
-
isInfinityEnchantmentAllowed
public static boolean isInfinityEnchantmentAllowed(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack) Checks if the given bucket is allowed to be enchanted with Infinity enchantment.- Parameters:
itemStack- checked item stack- Returns:
- boolean
-
containsContent
public static boolean containsContent(net.minecraft.world.item.ItemStack itemStack) -
getContent
public static net.minecraft.resources.Identifier getContent(net.minecraft.core.component.DataComponentHolder itemStack) -
getContentString
-
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.DataComponentHolder itemStack) -
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.ItemStack itemStack) -
getFluid
public static net.minecraft.world.level.material.Fluid getFluid(net.minecraft.world.item.ItemStack itemStack) -
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.DataComponentHolder itemStack) -
getEntityType
public static net.minecraft.world.entity.EntityType<?> getEntityType(net.minecraft.world.item.ItemStack itemStack) -
getEntityTypeString
-
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.world.item.ItemStack itemStack) -
getBlock
public static net.minecraft.world.level.block.Block getBlock(net.minecraft.world.item.ItemStack itemStack) -
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)
-