SPIGOT-7881: CTRL+Pick Block saves position data into item
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -109,12 +109,20 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
||||
return snapshot.saveWithFullMetadata(getRegistryAccess());
|
||||
}
|
||||
|
||||
public NBTTagCompound getSnapshotNBTWithoutComponents() {
|
||||
NBTTagCompound nbt = getSnapshotNBT();
|
||||
public NBTTagCompound getItemNBT() {
|
||||
// update snapshot
|
||||
applyTo(snapshot);
|
||||
|
||||
// See TileEntity#saveToItem
|
||||
NBTTagCompound nbt = snapshot.saveCustomOnly(getRegistryAccess());
|
||||
snapshot.removeComponentsFromTag(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void addEntityType(NBTTagCompound nbt) {
|
||||
TileEntity.addEntityType(nbt, snapshot.getType());
|
||||
}
|
||||
|
||||
// gets the packet data of the TileEntity represented by this block state
|
||||
public NBTTagCompound getUpdateNBT() {
|
||||
// update snapshot
|
||||
|
||||
Reference in New Issue
Block a user