mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 20:16:36 -04:00
Fix /place with sand/gravel and physics on leaving ghost sand/gravel block behind
This commit is contained in:
parent
322b6e9a85
commit
800d94c7ed
@ -50,12 +50,6 @@ namespace MCGalaxy.Commands.Maintenance {
|
||||
|
||||
BlockQueue.time = value;
|
||||
Player.Message(p, "Block interval is now {0}.", BlockQueue.time);
|
||||
} else if (cmd == "buf") {
|
||||
if (p.level.bufferblocks)
|
||||
Player.Message(p, "Block buffering on {0} %Sdisabled.", p.level.ColoredName);
|
||||
else
|
||||
Player.Message(p, "Block buffering on {0} %Senabled.", p.level.ColoredName);
|
||||
p.level.bufferblocks = !p.level.bufferblocks;
|
||||
} else if (cmd == "net") {
|
||||
if (!CommandParser.GetInt(p, args[1], "value", ref value, 2, 1000)) return;
|
||||
|
||||
@ -87,7 +81,7 @@ namespace MCGalaxy.Commands.Maintenance {
|
||||
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "%T/bs [option] [value].");
|
||||
Player.Message(p, "%HOptions: %Sbs (blocks per interval), ts (interval in milliseconds), buf (toggles buffering), clear");
|
||||
Player.Message(p, "%HOptions: %Sbs (blocks per interval), ts (interval in milliseconds), clear");
|
||||
Player.Message(p, "%T/bs net [2,4,8,12,16,20,24]");
|
||||
Player.Message(p, "%HPresets, divide by 8 and times by 1000 to get blocks per second.");
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
if (cur == Block.custom_block) extCur = lvl.GetExtTile(x, y, z);
|
||||
|
||||
bool same = block == Block.custom_block ? ext == extCur : block == cur;
|
||||
if (same) p.level.UpdateBlock(p, x, y, z, Block.air, 0, BlockDBFlags.Drawn);
|
||||
if (same) p.level.UpdateBlock(p, x, y, z, Block.air, 0, BlockDBFlags.Drawn, true);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -69,18 +69,18 @@ namespace MCGalaxy.Commands.Building {
|
||||
|
||||
byte heldExt = 0;
|
||||
byte heldBlock = p.GetActualHeldBlock(out heldExt);
|
||||
p.level.UpdateBlock(p, endX, endY, endZ, heldBlock, heldExt, BlockDBFlags.Drawn);
|
||||
p.level.UpdateBlock(p, endX, endY, endZ, heldBlock, heldExt, BlockDBFlags.Drawn, true);
|
||||
|
||||
if (interval > 0) {
|
||||
int x = m[0].X, y = m[0].Y, z = m[0].Z;
|
||||
int delta = 0;
|
||||
while (x >= 0 && y >= 0 && z >= 0 && x < p.level.Width && y < p.level.Height && z < p.level.Length && delta < distance) {
|
||||
p.level.UpdateBlock(p, (ushort)x, (ushort)y, (ushort)z, heldBlock, heldExt, BlockDBFlags.Drawn);
|
||||
p.level.UpdateBlock(p, (ushort)x, (ushort)y, (ushort)z, heldBlock, heldExt, BlockDBFlags.Drawn, true);
|
||||
x += dirX * interval; y += dirY * interval; z += dirZ * interval;
|
||||
delta = Math.Abs(x - m[0].X) + Math.Abs(y - m[0].Y) + Math.Abs(z - m[0].Z);
|
||||
}
|
||||
} else {
|
||||
p.level.UpdateBlock(p, (ushort)m[0].X, (ushort)m[0].Y, (ushort)m[0].Z, heldBlock, heldExt, BlockDBFlags.Drawn);
|
||||
p.level.UpdateBlock(p, (ushort)m[0].X, (ushort)m[0].Y, (ushort)m[0].Z, heldBlock, heldExt, BlockDBFlags.Drawn, true);
|
||||
}
|
||||
|
||||
Player.Message(p, "Placed stone blocks {0} apart.", interval > 0 ? interval : distance);
|
||||
|
@ -444,7 +444,7 @@ namespace MCGalaxy {
|
||||
}
|
||||
|
||||
public void UpdateBlock(Player p, ushort x, ushort y, ushort z, byte block, byte ext,
|
||||
ushort flags = BlockDBFlags.ManualPlace) {
|
||||
ushort flags = BlockDBFlags.ManualPlace, bool buffered = false) {
|
||||
byte old = GetTile(x, y, z), oldExt = 0;
|
||||
if (old == Block.custom_block) oldExt = GetExtTile(x, y, z);
|
||||
|
||||
@ -457,7 +457,7 @@ namespace MCGalaxy {
|
||||
if (type == 1) return; // not different visually
|
||||
|
||||
int index = PosToInt(x, y, z);
|
||||
if (bufferblocks)
|
||||
if (buffered)
|
||||
BlockQueue.Addblock(p, index, block, ext);
|
||||
else
|
||||
Player.GlobalBlockchange(this, x, y, z, block, ext);
|
||||
|
Loading…
x
Reference in New Issue
Block a user