mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-16 17:16:11 +00:00
Feature: add "h" as alias for "hand" and "oh" for "offhand" (#2033)
This commit is contained in:
parent
f98e526fa0
commit
c3ce162fd5
@ -408,14 +408,14 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
|||||||
TextComponent.of(blockAndExtraData[0])
|
TextComponent.of(blockAndExtraData[0])
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if ("hand".equalsIgnoreCase(typeString)) {
|
if ("hand".equalsIgnoreCase(typeString) || "h".equalsIgnoreCase(typeString)) {
|
||||||
// Get the block type from the item in the user's hand.
|
// Get the block type from the item in the user's hand.
|
||||||
final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND);
|
final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.MAIN_HAND);
|
||||||
//FAWE start
|
//FAWE start
|
||||||
state = blockInHand.toBlockState();
|
state = blockInHand.toBlockState();
|
||||||
nbt = blockInHand.getNbtData();
|
nbt = blockInHand.getNbtData();
|
||||||
//FAWE end
|
//FAWE end
|
||||||
} else if ("offhand".equalsIgnoreCase(typeString)) {
|
} else if ("offhand".equalsIgnoreCase(typeString) || "oh".equalsIgnoreCase(typeString)) {
|
||||||
// Get the block type from the item in the user's off hand.
|
// Get the block type from the item in the user's off hand.
|
||||||
final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND);
|
final BaseBlock blockInHand = getBlockInHand(context.requireActor(), HandSide.OFF_HAND);
|
||||||
//FAWE start
|
//FAWE start
|
||||||
|
@ -106,13 +106,13 @@ public class DefaultItemParser extends InputParser<BaseItem> {
|
|||||||
nbtString = input.substring(nbtStart);
|
nbtString = input.substring(nbtStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("hand".equalsIgnoreCase(typeString)) {
|
if ("hand".equalsIgnoreCase(typeString) || "h".equalsIgnoreCase(typeString)) {
|
||||||
BaseItemStack heldItem = getItemInHand(context.requireActor(), HandSide.MAIN_HAND);
|
BaseItemStack heldItem = getItemInHand(context.requireActor(), HandSide.MAIN_HAND);
|
||||||
//FAWE start
|
//FAWE start
|
||||||
itemType = heldItem.getType();
|
itemType = heldItem.getType();
|
||||||
itemNbtData = heldItem.getNbt();
|
itemNbtData = heldItem.getNbt();
|
||||||
//FAWE end
|
//FAWE end
|
||||||
} else if ("offhand".equalsIgnoreCase(typeString)) {
|
} else if ("offhand".equalsIgnoreCase(typeString) || "oh".equalsIgnoreCase(typeString)) {
|
||||||
BaseItemStack heldItem = getItemInHand(context.requireActor(), HandSide.OFF_HAND);
|
BaseItemStack heldItem = getItemInHand(context.requireActor(), HandSide.OFF_HAND);
|
||||||
//FAWE start
|
//FAWE start
|
||||||
itemType = heldItem.getType();
|
itemType = heldItem.getType();
|
||||||
|
Loading…
Reference in New Issue
Block a user