public void Blockchange(Player p, ushort x, ushort y, ushort z, byte type)
{
try
{
if (x >= width || y > depth || z >= height) { p.Kick("Building outside boundaries!"); return; }
if (y == depth) { return; }
byte b = GetTile(x, y, z);
if (Block.Convert(b) != Block.Convert(type)) //Should save bandwidth sending identical looking blocks, like air/op_air changes.
{
Player.GlobalBlockchange(this, x, y, z, type);
}
if (b == Block.sponge && (Physics == Physics.Normal || Physics == Physics.Advanced) && type != Block.sponge)
{
PhysSpongeRemoved(PosToInt(x, y, z));
}
SetTile(x, y, z, type); //Updates server level blocks
if (Physics > 0)
{
if (Block.Physics(type))
{
AddCheck(PosToInt(x, y, z));
}
}
changed = true;
}
catch (Exception e)
{
Logger.Log(p.name + " has triggered a block change error in Map on " + name, LogType.Error);
Logger.Log(e.Message, LogType.ErrorMessage);
Player.GlobalMessageOps(p.name + " has triggered a block change error in level.cs on " + name);
IRCBot.Say(p.name + " has triggered a block change error in level.cs on " + name);
}
}