mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Fix /highlight.
This commit is contained in:
parent
4afcd47c92
commit
62a17002a4
@ -144,13 +144,13 @@ namespace MCGalaxy.Util {
|
||||
}
|
||||
}
|
||||
|
||||
protected static void HighlightBlock(Player p, Level lvl, byte type, ushort x, ushort y, ushort z) {
|
||||
byte lvlTile = lvl.GetTile(x, y, z);
|
||||
if (lvlTile == type || Block.Convert(lvlTile) == Block.water || Block.Convert(lvlTile) == Block.lava) {
|
||||
byte block = (lvlTile == Block.air || Block.Convert(lvlTile) == Block.water
|
||||
|| Block.Convert(lvlTile) == Block.lava) ? Block.red : Block.green;
|
||||
p.SendBlockchange(x, y, z, block);
|
||||
}
|
||||
protected static void HighlightBlock(Player p, Level lvl, byte type, byte newType,
|
||||
ushort x, ushort y, ushort z) {
|
||||
byte block = (newType == Block.air
|
||||
|| Block.Convert(type) == Block.water || type == Block.waterstill
|
||||
|| Block.Convert(type) == Block.lava || type == Block.lavastill)
|
||||
? Block.red : Block.green;
|
||||
p.SendBlockchange(x, y, z, block);
|
||||
}
|
||||
|
||||
public static void CreateDefaultDirectories() {
|
||||
|
@ -133,7 +133,7 @@ namespace MCGalaxy.Util {
|
||||
DateTime time = chunk.BaseTime.AddTicks(U16(temp, offset + 0) * TimeSpan.TicksPerSecond);
|
||||
if (time < start) return false;
|
||||
ushort x = U16(temp, offset + 2), y = U16(temp, offset + 4), z = U16(temp, offset + 6);
|
||||
HighlightBlock(p, lvl, temp[offset + 10], x, y, z);
|
||||
HighlightBlock(p, lvl, temp[offset + 8], temp[offset + 10], x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ namespace MCGalaxy.Util {
|
||||
ushort x = (ushort)(index % chunk.Width);
|
||||
ushort y = (ushort)((index / chunk.Width) / chunk.Length);
|
||||
ushort z = (ushort)((index / chunk.Width) % chunk.Length);
|
||||
HighlightBlock(p, lvl, temp[offset + 7], x, y, z);
|
||||
HighlightBlock(p, lvl, temp[offset + 6], temp[offset + 7], x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ namespace MCGalaxy.Util {
|
||||
ushort x = Convert.ToUInt16(lines[(i * 7) - 6]);
|
||||
ushort y = Convert.ToUInt16(lines[(i * 7) - 5]);
|
||||
ushort z = Convert.ToUInt16(lines[(i * 7) - 4]);
|
||||
HighlightBlock(p, lvl, Convert.ToByte(lines[(i * 7) - 1]), x, y, z);
|
||||
HighlightBlock(p, lvl, Convert.ToByte(lines[(i * 7) - 2]), Convert.ToByte(lines[(i * 7) - 1]), x, y, z);
|
||||
} catch { }
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user