mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-25 22:30:52 -04:00
Core: allow overwriting core blocks with /lb
This commit is contained in:
parent
e69498af48
commit
2033bc330b
@ -539,9 +539,6 @@ namespace MCGalaxy.Commands.CPE {
|
||||
if (blockId <= 0 || blockId >= 255) {
|
||||
Player.Message(p, "&cBlock id must be between 1-254"); return false;
|
||||
}
|
||||
if (!global && blockId < Block.CpeCount) {
|
||||
Player.Message(p, "&cYou can only redefine standard blocks with /gb."); return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -187,12 +187,13 @@ namespace MCGalaxy {
|
||||
for (int i = 1; i < defs.Length; i++) {
|
||||
BlockDefinition def = defs[i];
|
||||
if (def == null) continue;
|
||||
if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt, 2) && def.Shape != 0)
|
||||
if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt, 2) && def.Shape != 0) {
|
||||
SendDefineBlockExt(pl, def, true);
|
||||
else if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt) && def.Shape != 0)
|
||||
} else if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt) && def.Shape != 0) {
|
||||
SendDefineBlockExt(pl, def, false);
|
||||
else
|
||||
} else {
|
||||
SendDefineBlock(pl, def);
|
||||
}
|
||||
|
||||
if (pl.HasCpeExt(CpeExt.BlockPermissions))
|
||||
pl.SendSetBlockPermission(def.BlockID, pl.level.CanPlace, pl.level.CanDelete);
|
||||
|
@ -381,7 +381,7 @@ namespace MCGalaxy {
|
||||
|
||||
void RemoveOldLevelCustomBlocks(Level oldLevel) {
|
||||
BlockDefinition[] defs = oldLevel.CustomBlockDefs;
|
||||
for (int i = Block.CpeCount; i < 256; i++) {
|
||||
for (int i = 1; i < 256; i++) {
|
||||
BlockDefinition def = defs[i];
|
||||
if (def == null || def == BlockDefinition.GlobalDefs[i]) continue;
|
||||
SendRaw(Opcode.CpeRemoveBlockDefinition, (byte)i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user