General ItemMeta fixes
== AT == private-f net/minecraft/world/item/ItemStack components public net/minecraft/world/food/FoodProperties DEFAULT_EAT_SECONDS public org/bukkit/craftbukkit/block/CraftBlockStates getBlockState(Lorg/bukkit/World;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/entity/BlockEntity;)Lorg/bukkit/craftbukkit/block/CraftBlockState; public net/minecraft/world/level/block/entity/BlockEntity saveId(Lnet/minecraft/nbt/CompoundTag;)V Co-authored-by: GhastCraftHD <julius.gruenberg@leghast.de>
This commit is contained in:
@@ -151,6 +151,19 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> extends Craft
|
||||
return this.snapshot.getUpdateTag(this.getRegistryAccess());
|
||||
}
|
||||
|
||||
// Paper start - properly save blockentity itemstacks
|
||||
public CompoundTag getSnapshotCustomNbtOnly() {
|
||||
this.applyTo(this.snapshot);
|
||||
final CompoundTag nbt = this.snapshot.saveCustomOnly(this.getRegistryAccess());
|
||||
this.snapshot.removeComponentsFromTag(nbt);
|
||||
if (!nbt.isEmpty()) {
|
||||
// have to include the "id" if it's going to have block entity data
|
||||
this.snapshot.saveId(nbt);
|
||||
}
|
||||
return nbt;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
// copies the data of the given tile entity to this block state
|
||||
protected void load(T tileEntity) {
|
||||
if (tileEntity != null && tileEntity != this.snapshot) {
|
||||
|
||||
Reference in New Issue
Block a user