@Override
public void setBlock(int x, int y, int z, LocalMaterialData material, NamedBinaryTag tag)
{
setBlock(x, y, z, material);
if (tag == null)
return;
NBTTagCompound nmsTag = NBTHelper.getNMSFromNBTTagCompound(tag);
nmsTag.setString("id", material.withDefaultBlockData().getName());
nmsTag.setInt("x", x);
nmsTag.setInt("y", y);
nmsTag.setInt("z", z);
nmsTag = this.dataConverter.a(DataConverterTypes.BLOCK_ENTITY, nmsTag, -1);
TileEntity tileEntity = world.getTileEntity(new BlockPosition(x, y, z));
if (tileEntity != null)
{
tileEntity.load(nmsTag);
} else
{
TerrainControl.log(LogMarker.DEBUG, "Skipping tile entity with id {}, cannot be placed at {},{},{} on id {}",
nmsTag.getString("id"), x, y, z, getMaterial(x, y, z));
}
}