Skip to content

Instantly share code, notes, and snippets.

@Ivorforce
Created February 4, 2017 22:57
Show Gist options
  • Save Ivorforce/d428a93f206408b682bb7cc9a34e1bb6 to your computer and use it in GitHub Desktop.
Save Ivorforce/d428a93f206408b682bb7cc9a34e1bb6 to your computer and use it in GitHub Desktop.
WorldServer world = context.environment.world;
if (context.setBlock(worldPos, state, 2))
{
NBTTagCompound tileEntityCompound = tileEntity.get();
if (tileEntityCompound != null && world.getBlockState(worldPos).getBlock() == state.getBlock())
{
TileEntity worldTileEntity = world.getTileEntity(worldPos);
if (worldTileEntity != null)
{
worldTileEntity.readFromNBT(tileEntityCompound);
Mover.setTileEntityPos(worldTileEntity, worldPos);
generateTileEntityContents(context, worldTileEntity);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment