mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-26 06:43:25 -04:00
Fix /gun not checking if you can actually place the block.
This commit is contained in:
parent
b3b9dae5cb
commit
4054de78c2
@ -29,8 +29,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
protected override void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
|
||||
p.RevertBlock(x, y, z);
|
||||
if (p.modeType != Block.air)
|
||||
type = p.modeType;
|
||||
if (!Block.canPlace(p, type)) { Player.SendMessage(p, "You cannot place this block."); return; }
|
||||
|
||||
Thread gunThread = new Thread(() => DoShoot(p, type, extType));
|
||||
gunThread.Name = "MCG_Gun";
|
||||
@ -75,7 +74,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
if (t > 12 && bp.ending != EndType.Laser) {
|
||||
pos = previous[0];
|
||||
p.level.Blockchange(pos.x, pos.y, pos.z, Block.air);
|
||||
p.level.Blockchange(pos.x, pos.y, pos.z, Block.air, true);
|
||||
previous.RemoveAt(0);
|
||||
}
|
||||
|
||||
@ -90,7 +89,7 @@ namespace MCGalaxy.Commands {
|
||||
if (bp.ending == EndType.Laser) Thread.Sleep(400);
|
||||
|
||||
foreach (Pos pos1 in previous) {
|
||||
p.level.Blockchange(pos1.x, pos1.y, pos1.z, Block.air);
|
||||
p.level.Blockchange(pos1.x, pos1.y, pos1.z, Block.air, true);
|
||||
if (bp.ending != EndType.Laser) Thread.Sleep(20);
|
||||
}
|
||||
}
|
||||
|
@ -33,10 +33,8 @@ namespace MCGalaxy.Commands {
|
||||
p.ClearBlockchange();
|
||||
p.aiming = false;
|
||||
}
|
||||
p.RevertBlock(x, y, z);
|
||||
|
||||
if (p.modeType != Block.air)
|
||||
type = p.modeType;
|
||||
p.RevertBlock(x, y, z);
|
||||
if (!Block.canPlace(p, type)) { Player.SendMessage(p, "You cannot place this block."); return; }
|
||||
|
||||
Thread gunThread = new Thread(() => DoShoot(p, type, extType));
|
||||
gunThread.Name = "MCG_Missile";
|
||||
@ -107,7 +105,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
if (previous.Count > 12) {
|
||||
p.level.Blockchange(previous[0].x, previous[0].y, previous[0].z, Block.air);
|
||||
p.level.Blockchange(previous[0].x, previous[0].y, previous[0].z, Block.air, true);
|
||||
previous.RemoveAt(0);
|
||||
}
|
||||
Thread.Sleep(100);
|
||||
@ -120,7 +118,7 @@ namespace MCGalaxy.Commands {
|
||||
DoTeleport(p, previous[index]);
|
||||
}
|
||||
foreach (Pos pos1 in previous) {
|
||||
p.level.Blockchange(pos1.x, pos1.y, pos1.z, Block.air);
|
||||
p.level.Blockchange(pos1.x, pos1.y, pos1.z, Block.air, true);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user