diff --git a/Player/Undo/UndoFile.cs b/Player/Undo/UndoFile.cs index 9f2dfa9ac..545067ade 100644 --- a/Player/Undo/UndoFile.cs +++ b/Player/Undo/UndoFile.cs @@ -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() { diff --git a/Player/Undo/UndoFileBin.cs b/Player/Undo/UndoFileBin.cs index 41cb1aa9d..fc8c28772 100644 --- a/Player/Undo/UndoFileBin.cs +++ b/Player/Undo/UndoFileBin.cs @@ -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); } } } diff --git a/Player/Undo/UndoFileCBin.cs b/Player/Undo/UndoFileCBin.cs index 5eb8a3ef7..a1ebde824 100644 --- a/Player/Undo/UndoFileCBin.cs +++ b/Player/Undo/UndoFileCBin.cs @@ -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); } } } diff --git a/Player/Undo/UndoFileText.cs b/Player/Undo/UndoFileText.cs index cc9c1810f..3715c77d5 100644 --- a/Player/Undo/UndoFileText.cs +++ b/Player/Undo/UndoFileText.cs @@ -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;