DrawOps shouldn't log to BlockDB and undo files when changing the same block (e.g. for massive /z airs), also fix non-simple paste draw ops with /scale too.

This commit is contained in:
UnknownShadow200 2016-08-27 10:16:24 +10:00
parent 545bd4025b
commit b238bb1432
2 changed files with 7 additions and 7 deletions

View File

@ -148,9 +148,12 @@ namespace MCGalaxy.Drawing.Ops {
foreach (var b in iterator) {
if (b.Block == Block.Zero) continue;
byte old = lvl.GetTile(b.X, b.Y, b.Z);
if (old == Block.Zero || !lvl.CheckAffectPermissions(p, b.X, b.Y, b.Z, old, b.Block, b.ExtBlock))
continue;
bool sameBlock = old == b.Block;
if (sameBlock && b.Block == Block.custom_block)
sameBlock = lvl.GetExtTile(b.X, b.Y, b.Z) == b.ExtBlock;
if (sameBlock || old == Block.Zero || !lvl.CheckAffectPermissions(p, b.X, b.Y, b.Z, old, b.Block, b.ExtBlock))
continue;
lvl.SetTile(b.X, b.Y, b.Z, b.Block, p, b.ExtBlock);
p.IncrementBlockStats(b.Block, true);
}

View File

@ -71,13 +71,10 @@ namespace MCGalaxy.Drawing.Ops {
state.GetCoords(i, out locX, out locY, out locZ);
ushort x = (ushort)(locX + offX), y = (ushort)(locY + offY), z = (ushort)(locZ + offZ);
byte type = lvl.GetTile(x, y, z), extType = 0;
if (type == Block.custom_block) extType = lvl.GetExtTile(x, y, z);
bool place = lvl.InBound(x, y, z) && (b != type || (b == Block.custom_block && extB != extType));
if (!place || (b == Block.air && !pasteAir)) continue;
if ((b == Block.air && !pasteAir) || !lvl.InBound(x, y, z)) continue;
if (exclude != null) {
bool place = true;
for (int j = 0; j < exclude.Length; j++) {
ExtBlock block = exclude[j];
if (b == block.Block && (b != Block.custom_block || extB == block.Ext)) {