Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 19:10:07 +01:00
Added a "hand" pseudo block type that uses the currently selected block.
Dieser Commit ist enthalten in:
Ursprung
8319eb6d91
Commit
768adee389
@ -397,7 +397,17 @@ public class WorldEdit {
|
|||||||
int data = -1;
|
int data = -1;
|
||||||
|
|
||||||
boolean parseDataValue = true;
|
boolean parseDataValue = true;
|
||||||
|
if ("hand".equalsIgnoreCase(testID)) {
|
||||||
|
// Get the block type from the item in the user's hand.
|
||||||
|
final BaseBlock blockInHand = player.getBlockInHand();
|
||||||
|
if (blockInHand.getClass() != BaseBlock.class) {
|
||||||
|
return blockInHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockId = blockInHand.getId();
|
||||||
|
blockType = BlockType.fromID(blockId);
|
||||||
|
data = blockInHand.getData();
|
||||||
|
} else {
|
||||||
// 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
|
||||||
try {
|
try {
|
||||||
@ -436,6 +446,7 @@ public class WorldEdit {
|
|||||||
if (!player.getWorld().isValidBlockType(blockId)) {
|
if (!player.getWorld().isValidBlockType(blockId)) {
|
||||||
throw new UnknownItemException(arg);
|
throw new UnknownItemException(arg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!allowNoData && data == -1) {
|
if (!allowNoData && data == -1) {
|
||||||
// No wildcards allowed => eliminate them.
|
// No wildcards allowed => eliminate them.
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren