Class BrushableBlockEntity
- Mappings:
Namespace Name named net/minecraft/block/entity/BrushableBlockEntity
intermediary net/minecraft/class_8174
official dql
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private static final int
private static final int
private static final int
private static final String
private ItemStack
private static final String
private static final Logger
private static final String
private static final String
private @Nullable RegistryKey
<LootTable> private long
private long
private long
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
brush
(long worldTime, PlayerEntity player, Direction hitDirection) private void
finishBrushing
(PlayerEntity player) void
generateItem
(PlayerEntity player) private int
getItem()
private boolean
protected void
readNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt
.void
void
setLootTable
(RegistryKey<LootTable> lootTable, long seed) private void
spawnItem
(PlayerEntity player) toInitialChunkDataNbt
(RegistryWrapper.WrapperLookup registryLookup) Returns the serialized state of this block entity that is observable by clients.Returns the packet to send to nearby players when the block entity's observable state changes, ornull
to not send the packet.private boolean
protected void
writeNbt
(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
addComponents, cancelRemoval, copyItemDataRequiresOperator, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, readComponents, removeFromCopiedStackNbt, setCachedState, setComponents, setStackNbt, setWorld, supports, tryParseCustomName, writeIdToNbt
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGER
Lnet/minecraft/block/entity/BrushableBlockEntity;LOGGER:Lorg/slf4j/Logger;
intermediary field_42801
Lnet/minecraft/class_8174;field_42801:Lorg/slf4j/Logger;
official a
Ldql;a:Lorg/slf4j/Logger;
-
LOOT_TABLE_NBT_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector named LOOT_TABLE_NBT_KEY
Lnet/minecraft/block/entity/BrushableBlockEntity;LOOT_TABLE_NBT_KEY:Ljava/lang/String;
intermediary field_42802
Lnet/minecraft/class_8174;field_42802:Ljava/lang/String;
official b
Ldql;b:Ljava/lang/String;
-
LOOT_TABLE_SEED_NBT_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector named LOOT_TABLE_SEED_NBT_KEY
Lnet/minecraft/block/entity/BrushableBlockEntity;LOOT_TABLE_SEED_NBT_KEY:Ljava/lang/String;
intermediary field_42803
Lnet/minecraft/class_8174;field_42803:Ljava/lang/String;
official c
Ldql;c:Ljava/lang/String;
-
HIT_DIRECTION_NBT_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector named HIT_DIRECTION_NBT_KEY
Lnet/minecraft/block/entity/BrushableBlockEntity;HIT_DIRECTION_NBT_KEY:Ljava/lang/String;
intermediary field_42804
Lnet/minecraft/class_8174;field_42804:Ljava/lang/String;
official d
Ldql;d:Ljava/lang/String;
-
ITEM_NBT_KEY
- See Also:
- Mappings:
Namespace Name Mixin selector named ITEM_NBT_KEY
Lnet/minecraft/block/entity/BrushableBlockEntity;ITEM_NBT_KEY:Ljava/lang/String;
intermediary field_42805
Lnet/minecraft/class_8174;field_42805:Ljava/lang/String;
official e
Ldql;e:Ljava/lang/String;
-
field_42806
private static final int field_42806- See Also:
- Mappings:
Namespace Name Mixin selector named field_42806
Lnet/minecraft/block/entity/BrushableBlockEntity;field_42806:I
intermediary field_42806
Lnet/minecraft/class_8174;field_42806:I
official f
Ldql;f:I
-
field_42807
private static final int field_42807- See Also:
- Mappings:
Namespace Name Mixin selector named field_42807
Lnet/minecraft/block/entity/BrushableBlockEntity;field_42807:I
intermediary field_42807
Lnet/minecraft/class_8174;field_42807:I
official g
Ldql;g:I
-
field_42808
private static final int field_42808- See Also:
- Mappings:
Namespace Name Mixin selector named field_42808
Lnet/minecraft/block/entity/BrushableBlockEntity;field_42808:I
intermediary field_42808
Lnet/minecraft/class_8174;field_42808:I
official h
Ldql;h:I
-
brushesCount
private int brushesCount- Mappings:
Namespace Name Mixin selector named brushesCount
Lnet/minecraft/block/entity/BrushableBlockEntity;brushesCount:I
intermediary field_42809
Lnet/minecraft/class_8174;field_42809:I
official i
Ldql;i:I
-
nextDustTime
private long nextDustTime- Mappings:
Namespace Name Mixin selector named nextDustTime
Lnet/minecraft/block/entity/BrushableBlockEntity;nextDustTime:J
intermediary field_42810
Lnet/minecraft/class_8174;field_42810:J
official j
Ldql;j:J
-
nextBrushTime
private long nextBrushTime- Mappings:
Namespace Name Mixin selector named nextBrushTime
Lnet/minecraft/block/entity/BrushableBlockEntity;nextBrushTime:J
intermediary field_42811
Lnet/minecraft/class_8174;field_42811:J
official k
Ldql;k:J
-
item
- Mappings:
Namespace Name Mixin selector named item
Lnet/minecraft/block/entity/BrushableBlockEntity;item:Lnet/minecraft/item/ItemStack;
intermediary field_42812
Lnet/minecraft/class_8174;field_42812:Lnet/minecraft/class_1799;
official l
Ldql;l:Lcuq;
-
hitDirection
- Mappings:
Namespace Name Mixin selector named hitDirection
Lnet/minecraft/block/entity/BrushableBlockEntity;hitDirection:Lnet/minecraft/util/math/Direction;
intermediary field_42813
Lnet/minecraft/class_8174;field_42813:Lnet/minecraft/class_2350;
official m
Ldql;m:Lji;
-
lootTable
- Mappings:
Namespace Name Mixin selector named lootTable
Lnet/minecraft/block/entity/BrushableBlockEntity;lootTable:Lnet/minecraft/registry/RegistryKey;
intermediary field_42814
Lnet/minecraft/class_8174;field_42814:Lnet/minecraft/class_5321;
official q
Ldql;q:Lakq;
-
lootTableSeed
private long lootTableSeed- Mappings:
Namespace Name Mixin selector named lootTableSeed
Lnet/minecraft/block/entity/BrushableBlockEntity;lootTableSeed:J
intermediary field_42815
Lnet/minecraft/class_8174;field_42815:J
official r
Ldql;r:J
-
-
Constructor Details
-
BrushableBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/block/entity/BrushableBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
intermediary <init>
Lnet/minecraft/class_8174;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
official <init>
Ldql;<init>(Ljd;Ldtc;)V
-
-
Method Details
-
brush
- Mappings:
Namespace Name Mixin selector named brush
Lnet/minecraft/block/entity/BrushableBlockEntity;brush(JLnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/Direction;)Z
intermediary method_49215
Lnet/minecraft/class_8174;method_49215(JLnet/minecraft/class_1657;Lnet/minecraft/class_2350;)Z
official a
Ldql;a(JLcmx;Lji;)Z
-
generateItem
- Mappings:
Namespace Name Mixin selector named generateItem
Lnet/minecraft/block/entity/BrushableBlockEntity;generateItem(Lnet/minecraft/entity/player/PlayerEntity;)V
intermediary method_49217
Lnet/minecraft/class_8174;method_49217(Lnet/minecraft/class_1657;)V
official a
Ldql;a(Lcmx;)V
-
finishBrushing
- Mappings:
Namespace Name Mixin selector named finishBrushing
Lnet/minecraft/block/entity/BrushableBlockEntity;finishBrushing(Lnet/minecraft/entity/player/PlayerEntity;)V
intermediary method_49218
Lnet/minecraft/class_8174;method_49218(Lnet/minecraft/class_1657;)V
official b
Ldql;b(Lcmx;)V
-
spawnItem
- Mappings:
Namespace Name Mixin selector named spawnItem
Lnet/minecraft/block/entity/BrushableBlockEntity;spawnItem(Lnet/minecraft/entity/player/PlayerEntity;)V
intermediary method_49220
Lnet/minecraft/class_8174;method_49220(Lnet/minecraft/class_1657;)V
official c
Ldql;c(Lcmx;)V
-
scheduledTick
public void scheduledTick()- Mappings:
Namespace Name Mixin selector named scheduledTick
Lnet/minecraft/block/entity/BrushableBlockEntity;scheduledTick()V
intermediary method_49219
Lnet/minecraft/class_8174;method_49219()V
official b
Ldql;b()V
-
readLootTableFromNbt
- Mappings:
Namespace Name Mixin selector named readLootTableFromNbt
Lnet/minecraft/block/entity/BrushableBlockEntity;readLootTableFromNbt(Lnet/minecraft/nbt/NbtCompound;)Z
intermediary method_49222
Lnet/minecraft/class_8174;method_49222(Lnet/minecraft/class_2487;)Z
official c
Ldql;c(Lub;)Z
-
writeLootTableToNbt
- Mappings:
Namespace Name Mixin selector named writeLootTableToNbt
Lnet/minecraft/block/entity/BrushableBlockEntity;writeLootTableToNbt(Lnet/minecraft/nbt/NbtCompound;)Z
intermediary method_49223
Lnet/minecraft/class_8174;method_49223(Lnet/minecraft/class_2487;)Z
official d
Ldql;d(Lub;)Z
-
toInitialChunkDataNbt
Returns the serialized state of this block entity that is observable by clients.This is sent alongside the initial chunk data, as well as when the block entity implements
toUpdatePacket()
and decides to use the defaultBlockEntityUpdateS2CPacket
."Observable state" is a state that clients can observe without specific interaction. For example,
CampfireBlockEntity
's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.To send all NBT data of this block entity saved to disk, return
BlockEntity.createNbt(net.minecraft.registry.RegistryWrapper.WrapperLookup)
.- Overrides:
toInitialChunkDataNbt
in classBlockEntity
- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector named toInitialChunkDataNbt
Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
intermediary method_16887
Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
official a
Ldqh;a(Ljo$a;)Lub;
-
toUpdatePacket
Description copied from class:BlockEntity
Returns the packet to send to nearby players when the block entity's observable state changes, ornull
to not send the packet.If the data returned by
initial chunk data
is suitable for updates, the following shortcut can be used to create an update packet:BlockEntityUpdateS2CPacket.create(this)
. The NBT will be passed toBlockEntity.readNbt(net.minecraft.nbt.NbtCompound, net.minecraft.registry.RegistryWrapper.WrapperLookup)
on the client."Observable state" is a state that clients can observe without specific interaction. For example,
CampfireBlockEntity
's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.To sync block entity data using this method, use
serverWorld.getChunkManager().markForUpdate(this.getPos());
.- Overrides:
toUpdatePacket
in classBlockEntity
- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
null
to not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector named toUpdatePacket
Lnet/minecraft/block/entity/BrushableBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
intermediary method_49221
Lnet/minecraft/class_8174;method_49221()Lnet/minecraft/class_2622;
official c
Ldql;c()Lacb;
-
readNbt
Reads data fromnbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
nbt
might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.- Overrides:
readNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named readNbt
Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11014
Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official a
Ldqh;a(Lub;Ljo$a;)V
-
writeNbt
Writes data tonbt
. Subclasses should override this if they store a persistent data.NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.
- Overrides:
writeNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbt
Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
intermediary method_11007
Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
official b
Ldqh;b(Lub;Ljo$a;)V
-
setLootTable
- Mappings:
Namespace Name Mixin selector named setLootTable
Lnet/minecraft/block/entity/BrushableBlockEntity;setLootTable(Lnet/minecraft/registry/RegistryKey;J)V
intermediary method_49216
Lnet/minecraft/class_8174;method_49216(Lnet/minecraft/class_5321;J)V
official a
Ldql;a(Lakq;J)V
-
getDustedLevel
private int getDustedLevel()- Mappings:
Namespace Name Mixin selector named getDustedLevel
Lnet/minecraft/block/entity/BrushableBlockEntity;getDustedLevel()I
intermediary method_49226
Lnet/minecraft/class_8174;method_49226()I
official j
Ldql;j()I
-
getHitDirection
- Mappings:
Namespace Name Mixin selector named getHitDirection
Lnet/minecraft/block/entity/BrushableBlockEntity;getHitDirection()Lnet/minecraft/util/math/Direction;
intermediary method_49224
Lnet/minecraft/class_8174;method_49224()Lnet/minecraft/class_2350;
official d
Ldql;d()Lji;
-
getItem
- Mappings:
Namespace Name Mixin selector named getItem
Lnet/minecraft/block/entity/BrushableBlockEntity;getItem()Lnet/minecraft/item/ItemStack;
intermediary method_49225
Lnet/minecraft/class_8174;method_49225()Lnet/minecraft/class_1799;
official f
Ldql;f()Lcuq;
-