mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-13 04:36:44 +00:00
Merge branch 'master' into release
This commit is contained in:
commit
63a4fe32c1
7 changed files with 59 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -453,7 +456,8 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||||
}
|
}
|
||||||
final User user = ess.getUser(event.getPlayer());
|
final User user = ess.getUser(event.getPlayer());
|
||||||
final String cmd = event.getMessage().toLowerCase().split(" ")[0].replace("/", "").toLowerCase();
|
final String cmd = event.getMessage().toLowerCase().split(" ")[0].replace("/", "").toLowerCase();
|
||||||
if (("msg".equals(cmd) || "r".equals(cmd) || "mail".equals(cmd)))
|
final List<String> commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email");
|
||||||
|
if (commands.contains(cmd))
|
||||||
{
|
{
|
||||||
for (Player player : ess.getServer().getOnlinePlayers())
|
for (Player player : ess.getServer().getOnlinePlayers())
|
||||||
{
|
{
|
||||||
|
|
|
@ -251,6 +251,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
|
|
||||||
nickname.insert(0, prefix);
|
nickname.insert(0, prefix);
|
||||||
nickname.append(suffix);
|
nickname.append(suffix);
|
||||||
|
if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
|
||||||
|
{
|
||||||
|
nickname.append("§f");
|
||||||
|
}
|
||||||
|
|
||||||
return nickname.toString();
|
return nickname.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class Commandmute extends EssentialsCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
User p = getPlayer(server, args, 0, true);
|
User p = getPlayer(server, args, 0, true);
|
||||||
if (p.isAuthorized("essentials.mute.exempt"))
|
if (!p.isMuted() && p.isAuthorized("essentials.mute.exempt"))
|
||||||
{
|
{
|
||||||
sender.sendMessage(Util.i18n("muteExempt"));
|
sender.sendMessage(Util.i18n("muteExempt"));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.earth2me.essentials.signs;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.ChargeException;
|
||||||
|
import com.earth2me.essentials.IEssentials;
|
||||||
|
import com.earth2me.essentials.Trade;
|
||||||
|
import com.earth2me.essentials.User;
|
||||||
|
import com.earth2me.essentials.commands.Commandspawnmob;
|
||||||
|
|
||||||
|
|
||||||
|
public class SignSpawnmob extends EssentialsSign
|
||||||
|
{
|
||||||
|
|
||||||
|
public SignSpawnmob()
|
||||||
|
{
|
||||||
|
super("Spawnmob");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean onSignCreate(ISign sign, User player, String username, IEssentials ess) throws SignException, ChargeException
|
||||||
|
{
|
||||||
|
validateInteger(sign, 1);
|
||||||
|
validateTrade(sign, 3, ess);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean onSignInteract(ISign sign, User player, String username, IEssentials ess) throws SignException, ChargeException
|
||||||
|
{
|
||||||
|
final Trade charge = getTrade(sign, 3, ess);
|
||||||
|
charge.isAffordableFor(player);
|
||||||
|
Commandspawnmob command = new Commandspawnmob();
|
||||||
|
command.setEssentials(ess);
|
||||||
|
String[] args = new String[] {
|
||||||
|
sign.getLine(2), sign.getLine(1)
|
||||||
|
};
|
||||||
|
try
|
||||||
|
{
|
||||||
|
command.run(ess.getServer(), player, "spawnmob", args);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new SignException(ex.getMessage(), ex);
|
||||||
|
}
|
||||||
|
charge.charge(player);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ public enum Signs
|
||||||
MAIL(new SignMail()),
|
MAIL(new SignMail()),
|
||||||
PROTECTION(new SignProtection()),
|
PROTECTION(new SignProtection()),
|
||||||
SELL(new SignSell()),
|
SELL(new SignSell()),
|
||||||
|
SPAWNMOB(new SignSpawnmob()),
|
||||||
TIME(new SignTime()),
|
TIME(new SignTime()),
|
||||||
TRADE(new SignTrade()),
|
TRADE(new SignTrade()),
|
||||||
WARP(new SignWarp()),
|
WARP(new SignWarp()),
|
||||||
|
|
|
@ -179,7 +179,7 @@ commands:
|
||||||
msg:
|
msg:
|
||||||
description: Sends a private message to the specified player.
|
description: Sends a private message to the specified player.
|
||||||
usage: /<command> <to> <message>
|
usage: /<command> <to> <message>
|
||||||
aliases: [m,t,emsg]
|
aliases: [m,t,emsg,tell]
|
||||||
mute:
|
mute:
|
||||||
description: Mutes or unmutes a player.
|
description: Mutes or unmutes a player.
|
||||||
usage: /<command> [player] <datediff>
|
usage: /<command> [player] <datediff>
|
||||||
|
|
BIN
lib/VanishNoPickup.jar
Normal file
BIN
lib/VanishNoPickup.jar
Normal file
Binary file not shown.
Loading…
Reference in a new issue