Class class_11597
- All Implemented Interfaces:
Iterable<ItemStack>,class_11596,Inventory,Clearable
- Mappings:
Namespace Name named net/minecraft/class_11597intermediary net/minecraft/class_11597official edq
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.inventory.Inventory
Inventory.Iterator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate static final Loggerprivate final DefaultedList<ItemStack> Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, worldFields inherited from interface net.minecraft.inventory.Inventory
DEFAULT_MAX_INTERACTION_RANGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponents(ComponentMap.Builder builder) booleancanPlayerUse(PlayerEntity player) Returns whetherplayercan use this inventory.voidMarks this block entity as dirty and that it needs to be saved.voidmethod_72665(RegistryEntry.Reference<GameEvent> reference) method_72666(int int2, ItemStack itemStack) protected voidreadComponents(ComponentsAccess components) protected voidReads 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.protected voidWrites data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, createComponentlessNbt, createComponentMap, createFromNbt, createNbt, createNbtWithIdentifyingData, getCachedState, getComponents, getNameForReport, getPos, getReporterContext, getType, getWorld, hasWorld, isRemoved, markDirty, markRemoved, onBlockReplaced, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessData, readComponents, readComponents, setCachedState, setComponents, setWorld, supports, tryParseCustomName, writeComponentlessData, writeDataWithId, writeDataWithoutId, writeFullData, writeIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.class_11596
canTransferTo, clear, getStack, isEmpty, isValid, method_72651, method_72663, method_72664, removeStack, removeStack, setStack, sizeMethods inherited from interface net.minecraft.inventory.Inventory
containsAny, containsAny, count, getMaxCount, getMaxCountPerStack, iterator, method_72379, onClose, onOpenMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
field_61441
public static final int field_61441- See Also:
- Mappings:
Namespace Name Mixin selector named field_61441Lnet/minecraft/class_11597;field_61441:Iintermediary field_61441Lnet/minecraft/class_11597;field_61441:Iofficial bLedq;b:I
-
field_61442
- Mappings:
Namespace Name Mixin selector named field_61442Lnet/minecraft/class_11597;field_61442:Lorg/slf4j/Logger;intermediary field_61442Lnet/minecraft/class_11597;field_61442:Lorg/slf4j/Logger;official cLedq;c:Lorg/slf4j/Logger;
-
field_61443
- Mappings:
Namespace Name Mixin selector named field_61443Lnet/minecraft/class_11597;field_61443:Lnet/minecraft/util/collection/DefaultedList;intermediary field_61443Lnet/minecraft/class_11597;field_61443:Lnet/minecraft/class_2371;official dLedq;d:Lju;
-
-
Constructor Details
-
class_11597
-
-
Method Details
-
readData
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:
readDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readDataLnet/minecraft/block/entity/BlockEntity;readData(Lnet/minecraft/storage/ReadView;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_11368;)Vofficial aLecb;a(Lfeg;)V
-
writeData
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:
writeDatain classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeDataLnet/minecraft/block/entity/BlockEntity;writeData(Lnet/minecraft/storage/WriteView;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_11372;)Vofficial aLecb;a(Lfei;)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 toon the client.invalid reference
#readNbt"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/class_11597;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;intermediary method_72667Lnet/minecraft/class_11597;method_72667()Lnet/minecraft/class_2622;official kLedq;k()Lacz;
-
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,
'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.invalid reference
CampfireBlockEntityTo 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 aLecb;a(Ljn$a;)Lul;
-
method_72652
- Specified by:
method_72652in interfaceclass_11596- Mappings:
Namespace Name Mixin selector named method_72652Lnet/minecraft/class_11596;method_72652()Lnet/minecraft/util/collection/DefaultedList;intermediary method_72652Lnet/minecraft/class_11596;method_72652()Lnet/minecraft/class_2371;official hLedk;h()Lju;
-
canPlayerUse
Returns whetherplayercan use this inventory.This is called by
ScreenHandler.canUse(net.minecraft.screen.ScreenHandlerContext, net.minecraft.entity.player.PlayerEntity, net.minecraft.block.Block).- Specified by:
canPlayerUsein interfaceInventory- Returns:
- whether
playercan use this inventory - See Also:
- API Note:
- Implementations should check the distance between the inventory
holder and
player. For convenience, this interface offers two methods used by block entities to implement this check. - Mappings:
Namespace Name Mixin selector named canPlayerUseLnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_5443Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Zofficial aLbxm;a(Lcvm;)Z
-
method_72666
- Mappings:
Namespace Name Mixin selector named method_72666Lnet/minecraft/class_11597;method_72666(ILnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;intermediary method_72666Lnet/minecraft/class_11597;method_72666(ILnet/minecraft/class_1799;)Lnet/minecraft/class_1799;official dLedq;d(ILddo;)Lddo;
-
method_72665
- Mappings:
Namespace Name Mixin selector named method_72665Lnet/minecraft/class_11597;method_72665(Lnet/minecraft/registry/entry/RegistryEntry$Reference;)Vintermediary method_72665Lnet/minecraft/class_11597;method_72665(Lnet/minecraft/class_6880$class_6883;)Vofficial aLedq;a(Ljl$c;)V
-
markDirty
public void markDirty()Marks this block entity as dirty and that it needs to be saved. This also triggers.invalid reference
comparator update
This must be called when something changed in a way that affects the saved NBT; otherwise, the game might not save the block entity.
- Specified by:
markDirtyin interfaceInventory- Overrides:
markDirtyin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named markDirtyLnet/minecraft/block/entity/BlockEntity;markDirty()Vintermediary method_5431Lnet/minecraft/class_2586;method_5431()Vofficial eLecb;e()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 aLecb;a(Lkl;)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 aLecb;a(Lkn$a;)V
-
removeFromCopiedStackData
- Overrides:
removeFromCopiedStackDatain classBlockEntity- Mappings:
Namespace Name Mixin selector named removeFromCopiedStackDataLnet/minecraft/block/entity/BlockEntity;removeFromCopiedStackData(Lnet/minecraft/storage/WriteView;)Vintermediary method_57569Lnet/minecraft/class_2586;method_57569(Lnet/minecraft/class_11372;)Vofficial bLecb;b(Lfei;)V
-