Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 02:20:07 +01:00
Added an alias for wool colors as though they were blocks, so you can now do //set blue, etc.
Dieser Commit ist enthalten in:
Ursprung
5a3e703acc
Commit
7d81303fea
@ -198,7 +198,7 @@ public class WorldEdit {
|
|||||||
String[] args1 = args0[0].split(":", 2);
|
String[] args1 = args0[0].split(":", 2);
|
||||||
String testID = args1[0];
|
String testID = args1[0];
|
||||||
|
|
||||||
int data;
|
int data = -1;
|
||||||
|
|
||||||
// Attempt to parse the item ID or otherwise resolve an item/block
|
// Attempt to parse the item ID or otherwise resolve an item/block
|
||||||
// name to its numeric ID
|
// name to its numeric ID
|
||||||
@ -215,9 +215,18 @@ public class WorldEdit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (blockType == null) {
|
if (blockType == null) {
|
||||||
|
// Maybe it's a cloth
|
||||||
|
ClothColor col = ClothColor.lookup(testID);
|
||||||
|
|
||||||
|
if (col != null) {
|
||||||
|
blockType = BlockType.fromID(35);
|
||||||
|
data = col.getID();
|
||||||
|
} else {
|
||||||
throw new UnknownItemException(arg);
|
throw new UnknownItemException(arg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data == -1) { // Block data not yet detected
|
||||||
// Parse the block data (optional)
|
// Parse the block data (optional)
|
||||||
try {
|
try {
|
||||||
data = args1.length > 1 ? Integer.parseInt(args1[1]) : 0;
|
data = args1.length > 1 ? Integer.parseInt(args1[1]) : 0;
|
||||||
@ -256,6 +265,7 @@ public class WorldEdit {
|
|||||||
throw new InvalidItemException(arg, "Unknown data value '" + args1[1] + "'");
|
throw new InvalidItemException(arg, "Unknown data value '" + args1[1] + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the item is allowed
|
// Check if the item is allowed
|
||||||
if (allAllowed || player.hasPermission("worldedit.anyblock")
|
if (allAllowed || player.hasPermission("worldedit.anyblock")
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren