add some commands
This commit is contained in:
parent
6bf6831360
commit
d5269922b9
5 changed files with 65 additions and 1 deletions
|
@ -1671,6 +1671,16 @@ public class Player extends NetHandler implements ICrafting, Executor
|
|||
line);
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendEmote(String line) {
|
||||
if(!line.startsWith("*") || line.length() < 2)
|
||||
return false;
|
||||
String str = line.substring(1).trim();
|
||||
if(str.isEmpty())
|
||||
return false;
|
||||
this.server.sendPacket(new SPacketMessage(String.format(TextColor.LGRAY + "* %s %s", this.entity.getColoredName(TextColor.LGRAY), str), Type.CHAT));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean setVar(String line) {
|
||||
if(!this.isAdmin())
|
||||
|
@ -1969,7 +1979,7 @@ public class Player extends NetHandler implements ICrafting, Executor
|
|||
break;
|
||||
|
||||
case CHAT:
|
||||
if(!this.sendPlayer(msg))
|
||||
if(!this.sendPlayer(msg) && !this.sendEmote(msg))
|
||||
this.server.sendPacket(new SPacketMessage(String.format("%s %s", this.entity.getColoredName(TextColor.LGRAY), msg), Type.CHAT));
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue