tutorial:blockentity
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:blockentity [2023/09/20 19:18] – [Creating a BlockEntity] Change outdated interface notes to generic statement haykam | tutorial:blockentity [2024/06/13 08:56] (current) – update outdated read nbt method s1lverposting | ||
---|---|---|---|
Line 30: | Line 30: | ||
Registries.BLOCK_ENTITY_TYPE, | Registries.BLOCK_ENTITY_TYPE, | ||
new Identifier(" | new Identifier(" | ||
- | | + | |
); | ); | ||
</ | </ | ||
Line 72: | Line 72: | ||
// Serialize the BlockEntity | // Serialize the BlockEntity | ||
@Override | @Override | ||
- | public void writeNbt(NbtCompound nbt) { | + | public void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapper) { |
// Save the current value of the number to the nbt | // Save the current value of the number to the nbt | ||
nbt.putInt(" | nbt.putInt(" | ||
- | super.writeNbt(nbt); | + | super.writeNbt(nbt, wrapper); |
} | } | ||
} | } | ||
Line 86: | Line 86: | ||
// Deserialize the BlockEntity | // Deserialize the BlockEntity | ||
@Override | @Override | ||
- | public void readNbt(NbtCompound nbt) { | + | public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup wrapper) { |
- | super.readNbt(nbt); | + | super.readNbt(nbt, wrapper); |
| | ||
number = nbt.getInt(" | number = nbt.getInt(" |
tutorial/blockentity.txt · Last modified: 2024/06/13 08:56 by s1lverposting