Added !handItemName and !handItemID
This commit is contained in:
parent
4245aa115e
commit
7749201ef1
10
aliases.yml
10
aliases.yml
|
@ -26,4 +26,12 @@ gm:
|
||||||
0: /gamemode !name !oppositeGameMode
|
0: /gamemode !name !oppositeGameMode
|
||||||
# hand all parameters in order
|
# hand all parameters in order
|
||||||
s:
|
s:
|
||||||
"*": /say I want to say "!*", there I said it!
|
"*": /say I want to say "!*", there I said it!
|
||||||
|
|
||||||
|
# replaced with the item name in the player's hand
|
||||||
|
hand:
|
||||||
|
0: I have a !handItemName in my hand right now!
|
||||||
|
|
||||||
|
# replace with the item ID in the player's hand
|
||||||
|
handid:
|
||||||
|
0: /give !name !handItemID
|
|
@ -38,11 +38,15 @@ class BetterAliasPlayerListener implements Listener{
|
||||||
|
|
||||||
while(m.find()){
|
while(m.find()){
|
||||||
String text = m.group(0).substring(1);
|
String text = m.group(0).substring(1);
|
||||||
|
|
||||||
if(text.equalsIgnoreCase("*")){
|
if(text.equalsIgnoreCase("*")){
|
||||||
text = e.getMessage().replace("/"+cmd[0]+" ","");
|
text = e.getMessage().replace("/"+cmd[0]+" ","");
|
||||||
}else if(text.equalsIgnoreCase("name")){
|
}else if(text.equalsIgnoreCase("name")){
|
||||||
text = player.getName();
|
text = player.getName();
|
||||||
|
}else if(text.equalsIgnoreCase("handItemName")){
|
||||||
|
text = player.getItemOnCursor().getType().name();
|
||||||
|
}else if(text.equalsIgnoreCase("handItemID")){
|
||||||
|
text = new Integer(player.getItemInHand().getTypeId()).toString();
|
||||||
}else if(text.equalsIgnoreCase("oppositeGameMode")){
|
}else if(text.equalsIgnoreCase("oppositeGameMode")){
|
||||||
text = (player.getGameMode() == GameMode.SURVIVAL ? "1" : "0");
|
text = (player.getGameMode() == GameMode.SURVIVAL ? "1" : "0");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: BetterAlias
|
name: BetterAlias
|
||||||
main: com.gmail.Ne0nx3r0.BetterAlias
|
main: com.gmail.Ne0nx3r0.BetterAlias
|
||||||
version: '0.2.1'
|
version: '0.3'
|
||||||
database: false
|
database: false
|
||||||
description: Command alias system
|
description: Command alias system
|
Loading…
Reference in New Issue