mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Doing /lb edit will automatically copy a /gb to a /lb, fixes #345
This commit is contained in:
parent
68b1e0835a
commit
6ae822fbe4
@ -110,8 +110,9 @@ namespace MCGalaxy.Commands.CPE {
|
|||||||
BlockDefinition[] defs = global ? BlockDefinition.GlobalDefs : p.level.CustomBlockDefs;
|
BlockDefinition[] defs = global ? BlockDefinition.GlobalDefs : p.level.CustomBlockDefs;
|
||||||
|
|
||||||
BlockDefinition srcDef = defs[src.RawID], dstDef = defs[dst.RawID];
|
BlockDefinition srcDef = defs[src.RawID], dstDef = defs[dst.RawID];
|
||||||
if (srcDef == null && src.BlockID < Block.CpeCount)
|
if (srcDef == null && src.BlockID < Block.CpeCount) {
|
||||||
srcDef = DefaultSet.MakeCustomBlock(src.BlockID);
|
srcDef = DefaultSet.MakeCustomBlock(src.BlockID);
|
||||||
|
}
|
||||||
if (srcDef == null) { MessageNoBlock(p, src, global, cmd); return; }
|
if (srcDef == null) { MessageNoBlock(p, src, global, cmd); return; }
|
||||||
if (ExistsInScope(dstDef, dst, global)) { MessageAlreadyBlock(p, dst, global, cmd); return; }
|
if (ExistsInScope(dstDef, dst, global)) { MessageAlreadyBlock(p, dst, global, cmd); return; }
|
||||||
|
|
||||||
@ -309,12 +310,16 @@ namespace MCGalaxy.Commands.CPE {
|
|||||||
ExtBlock block;
|
ExtBlock block;
|
||||||
if (!CheckBlock(p, parts[1], out block)) return;
|
if (!CheckBlock(p, parts[1], out block)) return;
|
||||||
BlockDefinition[] defs = global ? BlockDefinition.GlobalDefs : p.level.CustomBlockDefs;
|
BlockDefinition[] defs = global ? BlockDefinition.GlobalDefs : p.level.CustomBlockDefs;
|
||||||
BlockDefinition def = defs[block.RawID];
|
BlockDefinition def = defs[block.RawID], globalDef = BlockDefinition.GlobalDefs[block.RawID];
|
||||||
|
|
||||||
if (def == null && block.BlockID < Block.CpeCount) {
|
if (def == null && block.BlockID < Block.CpeCount) {
|
||||||
def = DefaultSet.MakeCustomBlock(block.BlockID);
|
def = DefaultSet.MakeCustomBlock(block.BlockID);
|
||||||
AddBlock(p, def, global, cmd, BlockDefinition.DefaultProps(block));
|
AddBlock(p, def, global, cmd, BlockDefinition.DefaultProps(block));
|
||||||
}
|
}
|
||||||
|
if (def != null && !global && def == globalDef) {
|
||||||
|
def = globalDef.Copy();
|
||||||
|
AddBlock(p, def, global, cmd, BlockDefinition.DefaultProps(block));
|
||||||
|
}
|
||||||
if (!ExistsInScope(def, block, global)) { MessageNoBlock(p, block, global, cmd); return; }
|
if (!ExistsInScope(def, block, global)) { MessageNoBlock(p, block, global, cmd); return; }
|
||||||
|
|
||||||
string value = parts[3], blockName = def.Name;
|
string value = parts[3], blockName = def.Name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user