mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Replace the 'Cannot build here' message with an actually useful one.
This commit is contained in:
parent
95d5ffed9c
commit
6a1ade461b
@ -50,6 +50,8 @@ namespace MCGalaxy {
|
|||||||
if (old == Block.Zero) return;
|
if (old == Block.Zero) return;
|
||||||
if (jailed || !agreed || !canBuild) { RevertBlock(x, y, z); return; }
|
if (jailed || !agreed || !canBuild) { RevertBlock(x, y, z); return; }
|
||||||
if (level.IsMuseum && Blockchange == null) return;
|
if (level.IsMuseum && Blockchange == null) return;
|
||||||
|
if (action > 1) { Leave("Unknown block action!", true); return; }
|
||||||
|
bool doDelete = !painting && action == 0;
|
||||||
|
|
||||||
if (!deleteMode) {
|
if (!deleteMode) {
|
||||||
PhysicsArgs args = level.foundInfo(x, y, z);
|
PhysicsArgs args = level.foundInfo(x, y, z);
|
||||||
@ -76,7 +78,7 @@ namespace MCGalaxy {
|
|||||||
if (PlayerBlockChange != null)
|
if (PlayerBlockChange != null)
|
||||||
PlayerBlockChange(this, x, y, z, block, extBlock);
|
PlayerBlockChange(this, x, y, z, block, extBlock);
|
||||||
OnBlockChangeEvent.Call(this, x, y, z, block, extBlock);
|
OnBlockChangeEvent.Call(this, x, y, z, block, extBlock);
|
||||||
if ( cancelBlock ) { cancelBlock = false; return; }
|
if (cancelBlock) { cancelBlock = false; return; }
|
||||||
|
|
||||||
if (group.Permission == LevelPermission.Banned) return;
|
if (group.Permission == LevelPermission.Banned) return;
|
||||||
if (checkPlaceDist && group.Permission == LevelPermission.Guest) {
|
if (checkPlaceDist && group.Permission == LevelPermission.Guest) {
|
||||||
@ -90,7 +92,7 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Block.canPlace(this, old) && !Block.BuildIn(old) && !Block.AllowBreak(old)) {
|
if (!Block.canPlace(this, old) && !Block.BuildIn(old) && !Block.AllowBreak(old)) {
|
||||||
SendMessage("Cannot build here!");
|
Formatter.MessageBlock(this, doDelete ? "delete " : "replace ", old);
|
||||||
RevertBlock(x, y, z); return;
|
RevertBlock(x, y, z); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,12 +101,11 @@ namespace MCGalaxy {
|
|||||||
RevertBlock(x, y, z); return;
|
RevertBlock(x, y, z); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old >= 200 && old < 220) {
|
if (old >= Block.air_flood && old <= Block.air_door_air) {
|
||||||
SendMessage("Block is active, you cant disturb it!");
|
SendMessage("Block is active, you cannot disturb it.");
|
||||||
RevertBlock(x, y, z); return;
|
RevertBlock(x, y, z); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action > 1 ) { Leave("Unknown block action!", true); return; }
|
|
||||||
byte blockRaw = block;
|
byte blockRaw = block;
|
||||||
if (block < Block.CpeCount) block = bindings[block];
|
if (block < Block.CpeCount) block = bindings[block];
|
||||||
|
|
||||||
@ -119,8 +120,7 @@ namespace MCGalaxy {
|
|||||||
byte heldExt = 0;
|
byte heldExt = 0;
|
||||||
byte heldBlock = GetActualHeldBlock(out heldExt);
|
byte heldBlock = GetActualHeldBlock(out heldExt);
|
||||||
int index = level.PosToInt(x, y, z);
|
int index = level.PosToInt(x, y, z);
|
||||||
|
if (doDelete) {
|
||||||
if (!painting && action == 0) {
|
|
||||||
if (DeleteBlock(old, x, y, z, block, extBlock))
|
if (DeleteBlock(old, x, y, z, block, extBlock))
|
||||||
level.AddToBlockDB(this, index, heldBlock, heldExt, true);
|
level.AddToBlockDB(this, index, heldBlock, heldExt, true);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user