I use my proxies for that.
CommonProxy:
public boolean isSinglePlayer() {
return false;
}
ClientProxy:
@Override
public boolean isSinglePlayer() {
return Minecraft.getMinecraft().isSingleplayer();
}
Works very well so far.
I had to search a longer time for a stabel way to get the world, this is what I found (wrapped in a method in my commonproxy):
/**
* Gets the current world.
* @param dim int the dimension of the world
*
* @return World the current world
*/
public World getWorld(int dim) {
return DimensionManager.getWorld(dim);
}
On server side execute "world.markBlockForUpdate(x, y, z);" with x,y,z being the respective coordinates of your tile entity. Override of getDescriptionpacket is needed for this to work, also override onPacketData in your tile entity handling the packet that comes from the server.
In one of my blocks I have
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) {
par1World.setBlock(par2, par3 + 1, par4, 3004);
par1World.setBlock(par2, par3 + 2, par4, 3005);
}
to place two other blocks directly above this block.