Package ml.pluto7073.pdapi.block.entity
Class MugBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
ml.pluto7073.pdapi.block.entity.MugBlockEntity
- All Implemented Interfaces:
net.fabricmc.fabric.api.attachment.v1.AttachmentTarget,net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity
public abstract class MugBlockEntity
extends net.minecraft.world.level.block.entity.BlockEntity
-
Field Summary
FieldsFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
NBT_ATTACHMENT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionMugBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState) -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>net.minecraft.nbt.CompoundTagvoidload(net.minecraft.nbt.CompoundTag tag) voidloadFromItem(net.minecraft.world.item.ItemStack stack) protected voidsaveAdditional(net.minecraft.nbt.CompoundTag nbt) voidsaveAdditionalToItemTag(net.minecraft.nbt.CompoundTag itemTag) Adds nbt data to the item version of this Mug Block
Note: Always callsuper.saveAdditionalToItemTag()or else Drink Additions won't be savedfinal net.minecraft.world.item.ItemStackNote: overridesaveAdditionalToItemTag(CompoundTag)to add data to the saved itemMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, removeAttached, setAttachedMethods inherited from interface net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity
getRenderData
-
Field Details
-
additions
-
sips
protected double sips
-
-
Constructor Details
-
MugBlockEntity
public MugBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState)
-
-
Method Details
-
getUpdatePacket
@Nullable public @Nullable net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()- Overrides:
getUpdatePacketin classnet.minecraft.world.level.block.entity.BlockEntity
-
getUpdateTag
public net.minecraft.nbt.CompoundTag getUpdateTag()- Overrides:
getUpdateTagin classnet.minecraft.world.level.block.entity.BlockEntity
-
saveAdditional
protected void saveAdditional(net.minecraft.nbt.CompoundTag nbt) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classnet.minecraft.world.level.block.entity.BlockEntity
-
loadFromItem
public void loadFromItem(net.minecraft.world.item.ItemStack stack) -
saveToItem
public final net.minecraft.world.item.ItemStack saveToItem()Note: overridesaveAdditionalToItemTag(CompoundTag)to add data to the saved item- Returns:
- A new instance of the corresponding itemStack
-
saveAdditionalToItemTag
public void saveAdditionalToItemTag(net.minecraft.nbt.CompoundTag itemTag) Adds nbt data to the item version of this Mug Block
Note: Always callsuper.saveAdditionalToItemTag()or else Drink Additions won't be saved- Parameters:
itemTag- The base tag of the item for any extra info, including the DrinkData tag
-