public int PosToInt(BlockPos pos) { return PosToInt(pos.X, pos.Y, pos.Z); }
internal bool PhysicsBlockChange(BlockPos pos, byte type) { if (BlockChange(pos.X, pos.Y, pos.Z, type)) { try { //Server.historyController.SetData(name, PosToInt(pos.x, pos.y, pos.z), type, 0); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } return true; } return false; }
public bool PhysicsBlockChange(BlockPos pos, MCBlocks type) { return PhysicsBlockChange(pos, (byte) type); }
public void PhysicsCheck(ushort inX, ushort inY, ushort inZ) { for (int x = -1; x < 2; ++x) for (int y = -1; y < 2; ++y) for (int z = -1; z < 2; ++z) { var blockPos = new BlockPos(inX + x, inY + y, inZ + z, this); if (NotInBounds(blockPos)) continue; int pos = PosToInt(blockPos); if (BlockData[pos] == 0) continue; if (Physics.PhysicsUpdates.Contains(pos)) continue; Physics.AddCall(pos); } }
public bool NotInBounds(BlockPos pos) { return NotInBounds(pos.X, pos.Y, pos.Z); }
public MCBlocks GetTile(BlockPos pos, int diffX, int diffY, int diffZ) { var x = (ushort) (pos.X + diffX); var y = (ushort) (pos.Y + diffY); var z = (ushort) (pos.Z + diffZ); return (MCBlocks) GetTile(x, y, z); }
public MCBlocks GetTile(BlockPos pos) { return (MCBlocks) GetTile(pos.X, pos.Y, pos.Z); }
public void PhysicsCheck(ushort inX, ushort inY, ushort inZ) { for (int x = -1; x < 2; ++x) for (int y = -1; y < 2; ++y) for (int z = -1; z < 2; ++z) { var blockPos = new BlockPos(inX + x, inY + y, inZ + z, this); if (!blockPos.InBounds) continue; if (BlockData[blockPos.Index] == 0) continue; if (Physics.PhysicsUpdates.Contains(blockPos.Index)) continue; Physics.AddCall(blockPos.Index); } }
public bool PhysicsBlockChange(BlockPos pos, MCBlocks type) { return pos.Level.PhysicsBlockChange(pos, type); }