Class CampfireBlockEntity
- All Implemented Interfaces:
Clearable
- Mappings:
Namespace Name named net/minecraft/block/entity/CampfireBlockEntityintermediary net/minecraft/class_3924official dyv
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]private final int[]private static final intprivate static final intprivate final DefaultedList<ItemStack> Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponents(ComponentMap.Builder builder) booleanaddItem(ServerWorld world, @Nullable LivingEntity entity, ItemStack stack) voidclear()static voidclientTick(World world, BlockPos pos, BlockState state, CampfireBlockEntity campfire) static voidlitServerTick(ServerWorld world, BlockPos pos, BlockState state, CampfireBlockEntity blockEntity, ServerRecipeManager.MatchGetter<SingleStackRecipeInput, CampfireCookingRecipe> recipeMatchGetter) voidonBlockReplaced(BlockPos pos, BlockState oldState) protected voidreadComponents(ComponentsAccess components) protected voidreadNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Reads data fromnbt.voidtoInitialChunkDataNbt(RegistryWrapper.WrapperLookup registries) 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, ornullto not send the packet.static voidunlitServerTick(World world, BlockPos pos, BlockState state, CampfireBlockEntity campfire) private voidprotected voidwriteNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, setCachedState, setComponents, setWorld, supports, tryParseCustomName, writeIdToNbt
-
Field Details
-
field_31330
private static final int field_31330- See Also:
- Mappings:
Namespace Name Mixin selector named field_31330Lnet/minecraft/block/entity/CampfireBlockEntity;field_31330:Iintermediary field_31330Lnet/minecraft/class_3924;field_31330:Iofficial aLdyv;a:I
-
field_31331
private static final int field_31331- See Also:
- Mappings:
Namespace Name Mixin selector named field_31331Lnet/minecraft/block/entity/CampfireBlockEntity;field_31331:Iintermediary field_31331Lnet/minecraft/class_3924;field_31331:Iofficial bLdyv;b:I
-
itemsBeingCooked
- Mappings:
Namespace Name Mixin selector named itemsBeingCookedLnet/minecraft/block/entity/CampfireBlockEntity;itemsBeingCooked:Lnet/minecraft/util/collection/DefaultedList;intermediary field_17383Lnet/minecraft/class_3924;field_17383:Lnet/minecraft/class_2371;official cLdyv;c:Ljp;
-
cookingTimes
private final int[] cookingTimes- Mappings:
Namespace Name Mixin selector named cookingTimesLnet/minecraft/block/entity/CampfireBlockEntity;cookingTimes:[Iintermediary field_17384Lnet/minecraft/class_3924;field_17384:[Iofficial dLdyv;d:[I
-
cookingTotalTimes
private final int[] cookingTotalTimes- Mappings:
Namespace Name Mixin selector named cookingTotalTimesLnet/minecraft/block/entity/CampfireBlockEntity;cookingTotalTimes:[Iintermediary field_17385Lnet/minecraft/class_3924;field_17385:[Iofficial eLdyv;e:[I
-
-
Constructor Details
-
CampfireBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/CampfireBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_3924;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Ldyv;<init>(Liw;Lebq;)V
-
-
Method Details
-
litServerTick
public static void litServerTick(ServerWorld world, BlockPos pos, BlockState state, CampfireBlockEntity blockEntity, ServerRecipeManager.MatchGetter<SingleStackRecipeInput, CampfireCookingRecipe> recipeMatchGetter) - Mappings:
Namespace Name Mixin selector named litServerTickLnet/minecraft/block/entity/CampfireBlockEntity;litServerTick(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/CampfireBlockEntity;Lnet/minecraft/recipe/ServerRecipeManager$MatchGetter;)Vintermediary method_31666Lnet/minecraft/class_3924;method_31666(Lnet/minecraft/class_3218;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3924;Lnet/minecraft/class_1863$class_7266;)Vofficial aLdyv;a(Lasb;Liw;Lebq;Ldyv;Ldfi$a;)V
-
unlitServerTick
public static void unlitServerTick(World world, BlockPos pos, BlockState state, CampfireBlockEntity campfire) - Mappings:
Namespace Name Mixin selector named unlitServerTickLnet/minecraft/block/entity/CampfireBlockEntity;unlitServerTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/CampfireBlockEntity;)Vintermediary method_31667Lnet/minecraft/class_3924;method_31667(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3924;)Vofficial aLdyv;a(Ldkj;Liw;Lebq;Ldyv;)V
-
clientTick
public static void clientTick(World world, BlockPos pos, BlockState state, CampfireBlockEntity campfire) - Mappings:
Namespace Name Mixin selector named clientTickLnet/minecraft/block/entity/CampfireBlockEntity;clientTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/CampfireBlockEntity;)Vintermediary method_31668Lnet/minecraft/class_3924;method_31668(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3924;)Vofficial bLdyv;b(Ldkj;Liw;Lebq;Ldyv;)V
-
getItemsBeingCooked
- Mappings:
Namespace Name Mixin selector named getItemsBeingCookedLnet/minecraft/block/entity/CampfireBlockEntity;getItemsBeingCooked()Lnet/minecraft/util/collection/DefaultedList;intermediary method_17505Lnet/minecraft/class_3924;method_17505()Lnet/minecraft/class_2371;official cLdyv;c()Ljp;
-
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.
nbtmight 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:
readNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial aLdyo;a(Lua;Lji$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:
writeNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial bLdyo;b(Lua;Lji$a;)V
-
toUpdatePacket
Description copied from class:BlockEntityReturns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.If the data returned by
initial chunk datais 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:
toUpdatePacketin classBlockEntity- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
nullto not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector named toUpdatePacketLnet/minecraft/block/entity/CampfireBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;intermediary method_38245Lnet/minecraft/class_3924;method_38245()Lnet/minecraft/class_2622;official dLdyv;d()Lacl;
-
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:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;intermediary method_16887Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;official aLdyo;a(Lji$a;)Lua;
-
addItem
- Mappings:
Namespace Name Mixin selector named addItemLnet/minecraft/block/entity/CampfireBlockEntity;addItem(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;)Zintermediary method_17503Lnet/minecraft/class_3924;method_17503(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;)Zofficial aLdyv;a(Lasb;Lbyf;Ldak;)Z
-
updateListeners
private void updateListeners()- Mappings:
Namespace Name Mixin selector named updateListenersLnet/minecraft/block/entity/CampfireBlockEntity;updateListeners()Vintermediary method_17510Lnet/minecraft/class_3924;method_17510()Vofficial fLdyv;f()V
-
clear
public void clear() -
onBlockReplaced
- Overrides:
onBlockReplacedin classBlockEntity- Mappings:
Namespace Name Mixin selector named onBlockReplacedLnet/minecraft/block/entity/BlockEntity;onBlockReplaced(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary method_66473Lnet/minecraft/class_2586;method_66473(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial aLdyo;a(Liw;Lebq;)V
-
readComponents
- Overrides:
readComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector named readComponentsLnet/minecraft/block/entity/BlockEntity;readComponents(Lnet/minecraft/component/ComponentsAccess;)Vintermediary method_57568Lnet/minecraft/class_2586;method_57568(Lnet/minecraft/class_9473;)Vofficial aLdyo;a(Lkg;)V
-
addComponents
- Overrides:
addComponentsin classBlockEntity- Mappings:
Namespace Name Mixin selector named addComponentsLnet/minecraft/block/entity/BlockEntity;addComponents(Lnet/minecraft/component/ComponentMap$Builder;)Vintermediary method_57567Lnet/minecraft/class_2586;method_57567(Lnet/minecraft/class_9323$class_9324;)Vofficial aLdyo;a(Lki$a;)V
-
removeFromCopiedStackNbt
- Overrides:
removeFromCopiedStackNbtin classBlockEntity- Mappings:
Namespace Name Mixin selector named removeFromCopiedStackNbtLnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackNbt(Lnet/minecraft/nbt/NbtCompound;)Vintermediary method_57569Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_2487;)Vofficial aLdyo;a(Lua;)V
-