Replace ItemTag API with new API that also expands to Tiles and Entities

By: Bjarne Koll <LynxPlay101@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2019-04-25 14:36:46 +10:00
parent 4198bf7e21
commit c9a23d73a0
16 changed files with 797 additions and 221 deletions

View File

@@ -6,9 +6,11 @@ import net.minecraft.server.TileEntity;
import net.minecraft.server.World;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.TileState;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.persistence.PersistentDataContainer;
public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState {
public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState implements TileState {
private final Class<T> tileEntityClass;
private final T tileEntity;
@@ -118,4 +120,9 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
return result;
}
@Override
public PersistentDataContainer getPersistentDataContainer() {
return this.getSnapshot().persistentDataContainer;
}
}