mirror of
https://github.com/EssentialsX/Essentials.git
synced 2026-11-12 20:02:00 -05:00
Compare commits
49
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5613975314 | ||
|
|
dc0ca35017 | ||
|
|
662d30ae45 | ||
|
|
4099755b9b | ||
|
|
57bee443b1 | ||
|
|
0f3c0e82f2 | ||
|
|
0e21d3287e | ||
|
|
3cedfeef2c | ||
|
|
a20f2b71da | ||
|
|
b2e3290038 | ||
|
|
979592c8ba | ||
|
|
7001798874 | ||
|
|
40a2bccf2d | ||
|
|
ee13d33b66 | ||
|
|
fdb46f60fd | ||
|
|
5027198010 | ||
|
|
90a5a4a470 | ||
|
|
85cab9533e | ||
|
|
304b13ca5e | ||
|
|
6a1c53dd01 | ||
|
|
d7b2ac97aa | ||
|
|
7b7289db4c | ||
|
|
ba2b827d7c | ||
|
|
621618e41f | ||
|
|
54559172c6 | ||
|
|
6ccb60813a | ||
|
|
2067bb8f0d | ||
|
|
b34119901e | ||
|
|
4f31d2779d | ||
|
|
ed29f29622 | ||
|
|
b8e41df0f6 | ||
|
|
602517473d | ||
|
|
cee0823db4 | ||
|
|
b317aef8c9 | ||
|
|
8b41219fcc | ||
|
|
61fa43a769 | ||
|
|
fdbc6fa94f | ||
|
|
28dd14d38c | ||
|
|
0ffe24903a | ||
|
|
f6e6e0042a | ||
|
|
e550a7cc44 | ||
|
|
9efc0840e3 | ||
|
|
82165a2af6 | ||
|
|
815b700eac | ||
|
|
fcda9f9d3b | ||
|
|
aa663c0c98 | ||
|
|
bda2f5e615 | ||
|
|
377f967dab | ||
|
|
d5c8d0c1bf |
No files matched your search
@@ -32,6 +32,7 @@ file.reference.iCo4.jar=../lib/iCo4.jar
|
||||
file.reference.iCo5.jar=../lib/iCo5.jar
|
||||
file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar
|
||||
file.reference.Permissions3.jar=../lib/Permissions3.jar
|
||||
file.reference.PermissionsEx.jar=../lib/PermissionsEx.jar
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
@@ -39,7 +40,8 @@ javac.classpath=\
|
||||
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
|
||||
${file.reference.iCo4.jar}:\
|
||||
${file.reference.iCo5.jar}:\
|
||||
${file.reference.BOSEconomy7.jar}
|
||||
${file.reference.BOSEconomy7.jar}:\
|
||||
${file.reference.PermissionsEx.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
||||
@@ -143,32 +143,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
LOGGER.log(Level.INFO, Util.i18n("bukkitFormatChanged"));
|
||||
}
|
||||
|
||||
final Plugin permissionsPlugin = pm.getPlugin("Permissions");
|
||||
|
||||
if (permissionsPlugin != null)
|
||||
{
|
||||
if (permissionsPlugin.getDescription().getVersion().charAt(0) == '3')
|
||||
{
|
||||
this.permissionsHandler = new Permissions3Handler(permissionsPlugin);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.permissionsHandler = new Permissions2Handler(permissionsPlugin);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.getSettings().useBukkitPermissions())
|
||||
{
|
||||
this.permissionsHandler = new BukkitPermissionsHandler();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.permissionsHandler = new ConfigPermissionsHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
final ServerListener serverListener = new EssentialsPluginListener(paymentMethod);
|
||||
final ServerListener serverListener = new EssentialsPluginListener(this);
|
||||
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.PLUGIN_DISABLE, serverListener, Priority.Low, this);
|
||||
|
||||
@@ -663,6 +638,11 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
return permissionsHandler;
|
||||
}
|
||||
|
||||
public void setPermissionsHandler(IPermissionsHandler handler)
|
||||
{
|
||||
this.permissionsHandler = handler;
|
||||
}
|
||||
|
||||
public BanWorkaround getBans()
|
||||
{
|
||||
|
||||
@@ -6,40 +6,76 @@ import java.util.logging.Logger;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
|
||||
public class EssentialsPluginListener extends ServerListener
|
||||
{
|
||||
private final Methods methods;
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
private final transient IEssentials ess;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
|
||||
public EssentialsPluginListener(Methods methods)
|
||||
public EssentialsPluginListener(final IEssentials ess)
|
||||
{
|
||||
this.methods = methods;
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPluginEnable(PluginEnableEvent event)
|
||||
public void onPluginEnable(final PluginEnableEvent event)
|
||||
{
|
||||
if (!methods.hasMethod())
|
||||
checkPermissions();
|
||||
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(event.getPlugin()))
|
||||
{
|
||||
if (methods.setMethod(event.getPlugin()))
|
||||
{
|
||||
logger.log(Level.INFO, "[Essentials] Payment method found (" + methods.getMethod().getName() + " version: " + methods.getMethod().getVersion() + ")");
|
||||
}
|
||||
LOGGER.log(Level.INFO, "[Essentials] Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginDisable(PluginDisableEvent event)
|
||||
{
|
||||
checkPermissions();
|
||||
// Check to see if the plugin thats being disabled is the one we are using
|
||||
if (methods != null && methods.hasMethod())
|
||||
if (ess.getPaymentMethod() != null && ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().checkDisabled(event.getPlugin()))
|
||||
{
|
||||
if (methods.checkDisabled(event.getPlugin()))
|
||||
LOGGER.log(Level.INFO, "[Essentials] Payment method was disabled. No longer accepting payments.");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkPermissions()
|
||||
{
|
||||
final PluginManager pm = ess.getServer().getPluginManager();
|
||||
final Plugin permissionsExPlugin = pm.getPlugin("PermissionsEx");
|
||||
|
||||
if (permissionsExPlugin == null || !permissionsExPlugin.isEnabled())
|
||||
{
|
||||
final Plugin permissionsPlugin = pm.getPlugin("Permissions");
|
||||
if (permissionsPlugin == null || !permissionsPlugin.isEnabled())
|
||||
{
|
||||
logger.log(Level.INFO, "[Essentials] Payment method was disabled. No longer accepting payments.");
|
||||
if (ess.getSettings().useBukkitPermissions())
|
||||
{
|
||||
ess.setPermissionsHandler(new BukkitPermissionsHandler());
|
||||
}
|
||||
else
|
||||
{
|
||||
ess.setPermissionsHandler(new ConfigPermissionsHandler(ess));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (permissionsPlugin.getDescription().getVersion().charAt(0) == '3')
|
||||
{
|
||||
ess.setPermissionsHandler(new Permissions3Handler(permissionsPlugin));
|
||||
}
|
||||
else
|
||||
{
|
||||
ess.setPermissionsHandler(new Permissions2Handler(permissionsPlugin));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ess.setPermissionsHandler(new PermissionsExHandler());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,9 +59,11 @@ public interface IEssentials extends Plugin
|
||||
|
||||
IPermissionsHandler getPermissionsHandler();
|
||||
|
||||
void setPermissionsHandler(IPermissionsHandler handler);
|
||||
|
||||
void showError(final CommandSender sender, final Throwable exception, final String commandLabel);
|
||||
|
||||
Map<String, User> getAllUsers();
|
||||
|
||||
|
||||
ItemDb getItemDb();
|
||||
}
|
||||
@@ -130,4 +130,6 @@ public interface ISettings extends IConf
|
||||
boolean isPlayerCommand(String string);
|
||||
|
||||
public boolean useBukkitPermissions();
|
||||
|
||||
public boolean addPrefixSuffix();
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import org.bukkit.plugin.Plugin;
|
||||
public class Permissions2Handler implements IPermissionsHandler
|
||||
{
|
||||
private final transient PermissionHandler permissionHandler;
|
||||
|
||||
|
||||
Permissions2Handler(final Plugin permissionsPlugin)
|
||||
{
|
||||
permissionHandler = ((Permissions)permissionsPlugin).getHandler();
|
||||
@@ -37,12 +37,13 @@ public class Permissions2Handler implements IPermissionsHandler
|
||||
|
||||
public String getPrefix(final Player base)
|
||||
{
|
||||
return permissionHandler.getGroupPrefix(base.getWorld().getName(), getGroup(base));
|
||||
final String prefix = permissionHandler.getGroupPrefix(base.getWorld().getName(), getGroup(base));
|
||||
return prefix == null ? "" : prefix;
|
||||
}
|
||||
|
||||
public String getSuffix(final Player base)
|
||||
{
|
||||
return permissionHandler.getGroupSuffix(base.getWorld().getName(), getGroup(base));
|
||||
final String suffix = permissionHandler.getGroupSuffix(base.getWorld().getName(), getGroup(base));
|
||||
return suffix == null ? "" : suffix;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import ru.tehkode.permissions.PermissionManager;
|
||||
import ru.tehkode.permissions.PermissionUser;
|
||||
import ru.tehkode.permissions.bukkit.PermissionsEx;
|
||||
|
||||
|
||||
class PermissionsExHandler implements IPermissionsHandler
|
||||
{
|
||||
private final transient PermissionManager manager;
|
||||
|
||||
public PermissionsExHandler()
|
||||
{
|
||||
manager = PermissionsEx.getPermissionManager();
|
||||
}
|
||||
|
||||
public String getGroup(Player base)
|
||||
{
|
||||
final PermissionUser user = manager.getUser(base.getName());
|
||||
if (user == null)
|
||||
{
|
||||
return "default";
|
||||
}
|
||||
return user.getGroupsNames()[0];
|
||||
}
|
||||
|
||||
public boolean canBuild(Player base, String group)
|
||||
{
|
||||
final PermissionUser user = manager.getUser(base.getName());
|
||||
if (user == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return user.getOptionBoolean("build", base.getWorld().getName(), true);
|
||||
}
|
||||
|
||||
public boolean inGroup(Player base, String group)
|
||||
{
|
||||
final PermissionUser user = manager.getUser(base.getName());
|
||||
if (user == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return user.inGroup(group);
|
||||
}
|
||||
|
||||
public boolean hasPermission(Player base, String node)
|
||||
{
|
||||
return manager.has(base.getName(), node, base.getWorld().getName());
|
||||
}
|
||||
|
||||
public String getPrefix(Player base)
|
||||
{
|
||||
final PermissionUser user = manager.getUser(base.getName());
|
||||
if (user == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return user.getPrefix();
|
||||
}
|
||||
|
||||
public String getSuffix(Player base)
|
||||
{
|
||||
final PermissionUser user = manager.getUser(base.getName());
|
||||
if (user == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return user.getSuffix();
|
||||
}
|
||||
}
|
||||
@@ -468,4 +468,9 @@ public class Settings implements ISettings
|
||||
{
|
||||
return config.getBoolean("use-bukkit-permissions", false);
|
||||
}
|
||||
|
||||
public boolean addPrefixSuffix()
|
||||
{
|
||||
return config.getBoolean("add-prefix-suffix", false);
|
||||
}
|
||||
}
|
||||
@@ -246,14 +246,17 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
}
|
||||
|
||||
final String prefix = ess.getPermissionsHandler().getPrefix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String suffix = ess.getPermissionsHandler().getSuffix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
|
||||
nickname.insert(0, prefix);
|
||||
nickname.append(suffix);
|
||||
if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
|
||||
if (ess.getSettings().addPrefixSuffix())
|
||||
{
|
||||
nickname.append("§f");
|
||||
final String prefix = ess.getPermissionsHandler().getPrefix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String suffix = ess.getPermissionsHandler().getSuffix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
|
||||
nickname.insert(0, prefix);
|
||||
nickname.append(suffix);
|
||||
if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
|
||||
{
|
||||
nickname.append("§f");
|
||||
}
|
||||
}
|
||||
|
||||
return nickname.toString();
|
||||
|
||||
@@ -216,21 +216,21 @@ public class Util
|
||||
return c.getTimeInMillis();
|
||||
}
|
||||
|
||||
public static Location getSafeDestination(Location loc) throws Exception
|
||||
public static Location getSafeDestination(final Location loc) throws Exception
|
||||
{
|
||||
if (loc == null)
|
||||
if (loc == null || loc.getWorld() == null)
|
||||
{
|
||||
throw new Exception(Util.i18n("destinationNotSet"));
|
||||
}
|
||||
World world = loc.getWorld();
|
||||
double x = Math.floor(loc.getX()) + 0.5;
|
||||
double y = Math.floor(loc.getY());
|
||||
double z = Math.floor(loc.getZ()) + 0.5;
|
||||
final World world = loc.getWorld();
|
||||
int x = loc.getBlockX();
|
||||
int y = loc.getBlockY();
|
||||
int z = loc.getBlockZ();
|
||||
|
||||
while (isBlockAboveAir(world, x, y, z))
|
||||
{
|
||||
y -= 1.0D;
|
||||
if (y < 0.0D)
|
||||
y -= 1;
|
||||
if (y < 0)
|
||||
{
|
||||
throw new Exception(Util.i18n("holeInFloor"));
|
||||
}
|
||||
@@ -238,33 +238,33 @@ public class Util
|
||||
|
||||
while (isBlockUnsafe(world, x, y, z))
|
||||
{
|
||||
y += 1.0D;
|
||||
if (y >= 110.0D)
|
||||
y += 1;
|
||||
if (y >= 127)
|
||||
{
|
||||
x += 1.0D;
|
||||
x += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (isBlockUnsafe(world, x, y, z))
|
||||
{
|
||||
y -= 1.0D;
|
||||
if (y <= 1.0D)
|
||||
y -= 1;
|
||||
if (y <= 1)
|
||||
{
|
||||
y = 110.0D;
|
||||
x += 1.0D;
|
||||
y = 127;
|
||||
x += 1;
|
||||
}
|
||||
}
|
||||
return new Location(world, x, y, z, loc.getYaw(), loc.getPitch());
|
||||
return new Location(world, x + 0.5D, y, z + 0.5D, loc.getYaw(), loc.getPitch());
|
||||
}
|
||||
|
||||
private static boolean isBlockAboveAir(World world, double x, double y, double z)
|
||||
private static boolean isBlockAboveAir(final World world, final int x, final int y, final int z)
|
||||
{
|
||||
return world.getBlockAt((int)Math.floor(x), (int)Math.floor(y - 1.0D), (int)Math.floor(z)).getType() == Material.AIR;
|
||||
return world.getBlockAt(x, y - 1, z).getType() == Material.AIR;
|
||||
}
|
||||
|
||||
public static boolean isBlockUnsafe(World world, double x, double y, double z)
|
||||
public static boolean isBlockUnsafe(final World world, final int x, final int y, final int z)
|
||||
{
|
||||
Block below = world.getBlockAt((int)Math.floor(x), (int)Math.floor(y - 1.0D), (int)Math.floor(z));
|
||||
final Block below = world.getBlockAt(x, y - 1, z);
|
||||
if (below.getType() == Material.LAVA || below.getType() == Material.STATIONARY_LAVA)
|
||||
{
|
||||
return true;
|
||||
@@ -275,8 +275,8 @@ public class Util
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((world.getBlockAt((int)Math.floor(x), (int)Math.floor(y), (int)Math.floor(z)).getType() != Material.AIR)
|
||||
|| (world.getBlockAt((int)Math.floor(x), (int)Math.floor(y + 1.0D), (int)Math.floor(z)).getType() != Material.AIR))
|
||||
if ((world.getBlockAt(x, y, z).getType() != Material.AIR)
|
||||
|| (world.getBlockAt(x, y + 1, z).getType() != Material.AIR))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ public class Util
|
||||
return str;
|
||||
}
|
||||
|
||||
public static double roundDouble(double d)
|
||||
public static double roundDouble(final double d)
|
||||
{
|
||||
return Math.round(d * 100.0) / 100.0;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,13 @@ public class Commandban extends EssentialsCommand
|
||||
}
|
||||
player.kickPlayer(banReason);
|
||||
ess.getBans().banByName(player.getName());
|
||||
server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
|
||||
for(Player p : server.getOnlinePlayers())
|
||||
{
|
||||
User u = ess.getUser(p);
|
||||
if(u.isAuthorized("essentials.ban.notify"))
|
||||
{
|
||||
p.sendMessage(Util.format("playerBanned", player.getName(), banReason));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class Commandhelp extends EssentialsCommand
|
||||
{
|
||||
if (!reported)
|
||||
{
|
||||
logger.log(Level.WARNING, "Error getting help for:" + pluginName, ex);
|
||||
logger.log(Level.WARNING, Util.format("commandHelpFailedForPlugin", pluginName), ex);
|
||||
}
|
||||
reported = true;
|
||||
continue;
|
||||
|
||||
@@ -102,6 +102,7 @@ public class Commandlist extends EssentialsCommand
|
||||
groupString.append("§7[HIDDEN]§f");
|
||||
}
|
||||
groupString.append(user.getDisplayName());
|
||||
groupString.append("§f");
|
||||
}
|
||||
sender.sendMessage(groupString.toString());
|
||||
}
|
||||
@@ -142,6 +143,7 @@ public class Commandlist extends EssentialsCommand
|
||||
onlineUsers.append("§7[HIDDEN]§f");
|
||||
}
|
||||
onlineUsers.append(user.getDisplayName());
|
||||
onlineUsers.append("§f");
|
||||
}
|
||||
sender.sendMessage(onlineUsers.toString());
|
||||
}
|
||||
|
||||
@@ -48,10 +48,25 @@ public class Commandmsg extends EssentialsCommand
|
||||
sender.sendMessage(Util.i18n("playerNotFound"));
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (Player p : matches)
|
||||
{
|
||||
final User u = ess.getUser(p);
|
||||
if (u.isHidden())
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i == matches.size())
|
||||
{
|
||||
sender.sendMessage(Util.i18n("playerNotFound"));
|
||||
return;
|
||||
}
|
||||
|
||||
charge(sender);
|
||||
for (Player p : matches)
|
||||
{
|
||||
{
|
||||
sender.sendMessage(Util.format("msgFormat", translatedMe, p.getDisplayName(), message));
|
||||
final User u = ess.getUser(p);
|
||||
if (sender instanceof Player && (u.isIgnoredPlayer(((Player)sender).getName()) || u.isHidden()))
|
||||
|
||||
@@ -164,7 +164,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
changeMobData(mobMount.name, spawnedMount, mountData, user);
|
||||
}
|
||||
}
|
||||
user.sendMessage(args[1] + " " + mob.name.toLowerCase() + mob.suffix + Util.i18n("spawned"));
|
||||
user.sendMessage(args[1] + " " + mob.name.toLowerCase() + mob.suffix + " " + Util.i18n("spawned"));
|
||||
}
|
||||
catch (MobException e1)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Commandtime extends EssentialsCommand
|
||||
else
|
||||
{
|
||||
charge(user);
|
||||
setPlayerTime(user, commandLabel);
|
||||
setPlayerTime(user, args[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -55,7 +55,8 @@ public class Commandunlimited extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack stack = ess.getItemDb().get(args[0], 1);
|
||||
final ItemStack stack = ess.getItemDb().get(args[0], 1);
|
||||
stack.setAmount(Math.min(stack.getType().getMaxStackSize(), 2));
|
||||
|
||||
String itemname = stack.getType().toString().toLowerCase().replace("_", "");
|
||||
if (!user.isAuthorized("essentials.unlimited.item-all")
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
@@ -44,7 +45,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
||||
User user = ess.getAllUsers().get(args[pos].toLowerCase());
|
||||
if (user != null)
|
||||
{
|
||||
if(!getOffline && user.isHidden())
|
||||
if(!getOffline && (user.getBase() instanceof OfflinePlayer || user.isHidden()))
|
||||
{
|
||||
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
|
||||
}
|
||||
|
||||
@@ -88,6 +88,14 @@ public class SignBlockListener extends BlockListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
if (user.isAuthorized("essentials.signs.color"))
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
event.setLine(i, event.getLine(i).replaceAll("&([0-9a-f])", "§$1"));
|
||||
}
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
@@ -103,14 +111,6 @@ public class SignBlockListener extends BlockListener
|
||||
return;
|
||||
}
|
||||
}
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
if (user.isAuthorized("essentials.signs.color"))
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
event.setLine(i, event.getLine(i).replaceAll("&([0-9a-f])", "§$1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -157,7 +158,7 @@ public class SignProtection extends EssentialsSign
|
||||
return SignProtectionState.ALLOWED;
|
||||
}
|
||||
}
|
||||
if (sign.getLine(3).substring(2).equalsIgnoreCase(username))
|
||||
if (ChatColor.stripColor(sign.getLine(3)).equalsIgnoreCase(username))
|
||||
{
|
||||
return SignProtectionState.OWNER;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@ nickname-prefix: '~'
|
||||
# Disable this if you have any other plugin, that modifies the displayname of a user.
|
||||
change-displayname: true
|
||||
|
||||
# Adds the prefix and suffix to the displayname of the player, so it will be displayed in messages and lists.
|
||||
# The prefix/suffix can be set using Permissions, Group Manager or PermissionsEx.
|
||||
# The value of change-displayname (above) has to be true.
|
||||
add-prefix-suffix: false
|
||||
|
||||
# The delay, in seconds, required between /home, /tp, etc.
|
||||
teleport-cooldown: 0
|
||||
|
||||
@@ -117,7 +122,8 @@ disabled-commands:
|
||||
# Restricted commands have been removed.
|
||||
# Now we have a whitelist, all commands not on this list are only available to ops.
|
||||
# These will have NO EFFECT if you have Permissions installed!
|
||||
# These are here only if you want something simpler than Permissions.
|
||||
# They are here only if you want something simpler than Permissions.
|
||||
# These are the permissions without the "essentials." part.
|
||||
player-commands:
|
||||
- afk
|
||||
- back
|
||||
@@ -127,6 +133,7 @@ player-commands:
|
||||
- compass
|
||||
- depth
|
||||
- getpos
|
||||
- geoip.show
|
||||
- help
|
||||
- helpop
|
||||
- home
|
||||
@@ -143,13 +150,31 @@ player-commands:
|
||||
- nick
|
||||
- pay
|
||||
- ping
|
||||
- portal
|
||||
- powertool
|
||||
- protect
|
||||
- r
|
||||
- rules
|
||||
- seen
|
||||
- sell
|
||||
- sethome
|
||||
- setxmpp
|
||||
- signs.create.protection
|
||||
- signs.create.trade
|
||||
- signs.break.protection
|
||||
- signs.break.trade
|
||||
- signs.use.balance
|
||||
- signs.use.buy
|
||||
- signs.use.disposal
|
||||
- signs.use.free
|
||||
- signs.use.heal
|
||||
- signs.use.mail
|
||||
- signs.use.protection
|
||||
- signs.use.sell
|
||||
- signs.use.time
|
||||
- signs.use.trade
|
||||
- signs.use.warp
|
||||
- signs.use.weather
|
||||
- spawn
|
||||
- suicide
|
||||
- tpa
|
||||
@@ -157,6 +182,7 @@ player-commands:
|
||||
- tpahere
|
||||
- tpdeny
|
||||
- warp
|
||||
- warp.list
|
||||
- world
|
||||
- worth
|
||||
- xmpp
|
||||
|
||||
@@ -29,7 +29,8 @@ canTalkAgain = \u00a77You can talk again
|
||||
cantFindGeoIpDB = Can''t find GeoIP database!
|
||||
cantReadGeoIpDB = Failed to read GeoIP database!
|
||||
cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
|
||||
commandFailed = Command {0} failed:
|
||||
commandFailed = Command {0} failed:
|
||||
commandHelpFailedForPlugin = Error getting help for: {0}
|
||||
commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
|
||||
compassBearing = \u00a77Bearing: {0} ({1} degrees).
|
||||
configFileMoveError = Failed to move config.yml to backup location.
|
||||
@@ -190,7 +191,7 @@ noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that k
|
||||
noKits = \u00a77There are no kits available yet
|
||||
noMail = You do not have any mail
|
||||
noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
|
||||
noMotd = \u00a7cThere is no message of the day."
|
||||
noMotd = \u00a7cThere is no message of the day.
|
||||
noNewMail = \u00a77You have no new mail.
|
||||
noPendingRequest = You do not have a pending request.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
@@ -219,7 +220,7 @@ playerMuted = \u00a77You have been muted
|
||||
playerMutedFor = \u00a77You have been muted for {0}
|
||||
playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
|
||||
playerNotFound = \u00a7cPlayer not found.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
playerUnmuted = \u00a77You have been unmuted
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
|
||||
powerToolAir = Command can''t be attached to air.
|
||||
|
||||
@@ -31,7 +31,8 @@ canTalkAgain = \u00a77Du kan snakke igen
|
||||
cantFindGeoIpDB = Kan ikke finde GeoIP database!
|
||||
cantReadGeoIpDB = Fejl ved l\u00e6sning af GeoIP database!
|
||||
cantSpawnItem = \u00a7cDu er ikke tilladt at spawne elementet {0}
|
||||
commandFailed = Kommando {0} fejlede:
|
||||
commandFailed = Kommando {0} fejlede:
|
||||
commandHelpFailedForPlugin=Fejl ved at f\u00e5 hj\u00e6lp til: {0}
|
||||
commandNotLoaded = \u00a7cCommand {0} er ikke indl\u00e6st korrekt.
|
||||
compassBearing = \u00a77B\u00e6rer: {0} ({1} grader).
|
||||
configFileMoveError = Kunne ikke flytte config.yml til backup placering.
|
||||
@@ -192,7 +193,7 @@ noKitPermission = \u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at br
|
||||
noKits = \u00a77Der er ikke nogen pakker tilg\u00e6ngelig endnu
|
||||
noMail = Du har ikke noget post
|
||||
noMailSendPerm = \u00a7cDu har ikke \u00a7fessentials.mail.send\u00a7c tilladelsen.
|
||||
noMotd = \u00a7cDer er ikke nogen besked for dagen."
|
||||
noMotd = \u00a7cDer er ikke nogen besked for dagen.
|
||||
noNewMail = \u00a77Du har ingen ny post.
|
||||
noPendingRequest = Du har ikke en ventende anmodning.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
@@ -221,7 +222,7 @@ playerMuted = \u00a77You have been muted
|
||||
playerMutedFor = \u00a77You have been muted for {0}
|
||||
playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server.
|
||||
playerNotFound = \u00a7cSpiller ikke fundet.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
playerUnmuted = \u00a77You have been unmuted
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}.
|
||||
powerToolAir = Kommando kan ikke blive tildelt luft.
|
||||
|
||||
@@ -29,7 +29,8 @@ canTalkAgain = \u00a77Du kannst wieder sprechen.
|
||||
cantFindGeoIpDB = Kann GeoIP-Datenbank nicht finden!
|
||||
cantReadGeoIpDB = Fehler beim Einlesen der GeoIP-Datenbank!
|
||||
cantSpawnItem = \u00a7cDu darfst {0} nicht erzeugen.
|
||||
commandFailed = Befehl {0} scheiterte:
|
||||
commandFailed = Befehl {0} scheiterte:
|
||||
commandHelpFailedForPlugin=Fehler beim Abrufen der Hilfe f\u00fcr: {0}
|
||||
commandNotLoaded = \u00a7cBefehl {0} ist nicht richtig geladen.
|
||||
compassBearing = \u00a77Peilung: {0} ({1} Grad).
|
||||
configFileMoveError = Verschieben von config.yml zu einer Sicherheitskopie gescheitert.
|
||||
@@ -168,7 +169,7 @@ month = Monat
|
||||
months = Monate
|
||||
moreThanZero = Anzahl muss gr\u00f6sser als 0 sein.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
muteExempt = \u00a7cDu darfst diesen Spieler nicht stumm machen.
|
||||
mutedPlayer = Player {0} ist nun stumm.
|
||||
mutedPlayerFor = Player {0} ist nun stumm f\u00fcr {1}.
|
||||
mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschalt.
|
||||
@@ -190,7 +191,7 @@ noKitPermission = \u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese
|
||||
noKits = \u00a77Es sind keine Ausr\u00fcstungen verf\u00fcgbar.
|
||||
noMail = Du hast keine Nachrichten
|
||||
noMailSendPerm = \u00a7cDu hast die Rechte \u00a7fessentials.mail.send\u00a7c nicht.
|
||||
noMotd = \u00a7cEs existiert keine Willkommensnachricht."
|
||||
noMotd = \u00a7cEs existiert keine Willkommensnachricht.
|
||||
noNewMail = \u00a77Du hast keine Nachrichten.
|
||||
noPendingRequest = Du hast keine Teleportierungsanfragen.
|
||||
noPlacePermission = \u00a7cDu hast keine Rechte, einen Block in der N\u00e4he des Schildes zu platzieren.
|
||||
@@ -215,11 +216,11 @@ playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}.
|
||||
playerJailed = \u00a77Spieler {0} eingesperrt.
|
||||
playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}.
|
||||
playerKicked = \u00a7cSpieler {0} rausgeworfen: {1}
|
||||
playerMuted = \u00a77You have been muted
|
||||
playerMutedFor = \u00a77You have been muted for {0}
|
||||
playerMuted = \u00a77Du bist jetzt stumm.
|
||||
playerMutedFor = \u00a77Du bist jetzt stumm f\u00fcr {0}.
|
||||
playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server.
|
||||
playerNotFound = \u00a7cSpieler nicht gefunden.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
playerUnmuted = \u00a77Du bist nicht mehr stumm.
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
|
||||
powerToolAir = Befehl kann nicht mit Luft verbunden werden.
|
||||
@@ -325,4 +326,4 @@ year = Jahr
|
||||
years = Jahre
|
||||
youAreHealed = \u00a77Du wurdest geheilt.
|
||||
youHaveNewMail = \u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
|
||||
invalidCharge = \u00a7cUng\u00fcltige Verf\u00fcgung.
|
||||
invalidCharge = \u00a7cUng\u00fcltige Verf\u00fcgung.
|
||||
@@ -29,7 +29,8 @@ canTalkAgain = \u00a77You can talk again
|
||||
cantFindGeoIpDB = Can''t find GeoIP database!
|
||||
cantReadGeoIpDB = Failed to read GeoIP database!
|
||||
cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
|
||||
commandFailed = Command {0} failed:
|
||||
commandFailed = Command {0} failed:
|
||||
commandHelpFailedForPlugin=Error getting help for: {0}
|
||||
commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
|
||||
compassBearing = \u00a77Bearing: {0} ({1} degrees).
|
||||
configFileMoveError = Failed to move config.yml to backup location.
|
||||
@@ -190,7 +191,7 @@ noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that k
|
||||
noKits = \u00a77There are no kits available yet
|
||||
noMail = You do not have any mail
|
||||
noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
|
||||
noMotd = \u00a7cThere is no message of the day."
|
||||
noMotd = \u00a7cThere is no message of the day.
|
||||
noNewMail = \u00a77You have no new mail.
|
||||
noPendingRequest = You do not have a pending request.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
@@ -219,7 +220,7 @@ playerMuted = \u00a77You have been muted
|
||||
playerMutedFor = \u00a77You have been muted for {0}
|
||||
playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
|
||||
playerNotFound = \u00a7cPlayer not found.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
playerUnmuted = \u00a77You have been unmuted
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
|
||||
powerToolAir = Command can''t be attached to air.
|
||||
|
||||
@@ -29,7 +29,8 @@ canTalkAgain = \u00a77Vous pouvez de nouveau parler.
|
||||
cantFindGeoIpDB = N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
|
||||
cantReadGeoIpDB = Echec de la lecture de la base de donn\u00e9s GeoIP!
|
||||
cantSpawnItem = \u00a7cVous n''avez pas le droit de faire apparaitre {0}
|
||||
commandFailed = \u00c9chec de la commande {0}:
|
||||
commandFailed = \u00c9chec de la commande {0}:
|
||||
commandHelpFailedForPlugin=Erreur d'obtention d'aider \u00e0: {0}
|
||||
commandNotLoaded = \u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e.
|
||||
compassBearing = \u00a77Orientation: {0} ({1} degr\u00e9s).
|
||||
configFileMoveError = \u00c9chec du d\u00e9placement de config.yml vers l''emplacement de backup.
|
||||
@@ -219,7 +220,7 @@ playerMuted = \u00a77You have been muted
|
||||
playerMutedFor = \u00a77You have been muted for {0}
|
||||
playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
|
||||
playerNotFound = \u00a7cLe joueur est introuvable.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
playerUnmuted = \u00a77You have been unmuted
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}.
|
||||
powerToolAir = La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air.
|
||||
|
||||
@@ -30,7 +30,8 @@ canTalkAgain = \u00a77Je kan weer praten.
|
||||
cantFindGeoIpDB = De GeoIP database kon niet gevonden worden!
|
||||
cantReadGeoIpDB = Fout bij het lezen van de GeoIP database!
|
||||
cantSpawnItem = \u00a7cJe bent niet bevoegd om {0} te spawnen.
|
||||
commandFailed = Opdracht {0} mislukt:
|
||||
commandFailed = Opdracht {0} mislukt:
|
||||
commandHelpFailedForPlugin=Fout bij het \u200b\u200bkrijgen van hulp voor: {0}
|
||||
commandNotLoaded = \u00a7cOpdracht {0} is fout geladen.
|
||||
compassBearing = \u00a77Ligging: {0} ({1} graden).
|
||||
configFileMoveError = Het verplaatsen van config.yml naar de backup locatie is mislukt.
|
||||
@@ -191,7 +192,7 @@ noKitPermission = \u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die k
|
||||
noKits = \u00a77Er zijn nog geen kits beschikbaar
|
||||
noMail = Je hebt geen berichten
|
||||
noMailSendPerm = \u00a7cJe hebt de \u00a7fessentials.mail.send\u00a7c toestemming niet.
|
||||
noMotd = \u00a7cEr is geen bericht van de dag."
|
||||
noMotd = \u00a7cEr is geen bericht van de dag.
|
||||
noNewMail = \u00a77Je hebt geen nieuwe berichten.
|
||||
noPendingRequest = Je hebt geen aanvragen.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
@@ -220,7 +221,7 @@ playerMuted = \u00a77You have been muted
|
||||
playerMutedFor = \u00a77You have been muted for {0}
|
||||
playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest.
|
||||
playerNotFound = \u00a7cSpeler niet gevonden.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
playerUnmuted = \u00a77You have been unmuted
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}.
|
||||
powerToolAir = Command kan niet worden bevestigd aan de lucht.
|
||||
|
||||
@@ -27,13 +27,11 @@ dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
|
||||
file.reference.Factions.jar=../lib/Factions.jar
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${file.reference.bukkit-0.0.1-SNAPSHOT.jar}:\
|
||||
${file.reference.Factions.jar}
|
||||
${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
||||
@@ -22,8 +22,7 @@ public class EssentialsChat extends JavaPlugin
|
||||
final PluginManager pluginManager = getServer().getPluginManager();
|
||||
final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials");
|
||||
|
||||
chatListener = new HashMap<String, IEssentialsChatListener>();
|
||||
//EssentialsChatPlayerListener.checkFactions(pluginManager);
|
||||
chatListener = new HashMap<String, IEssentialsChatListener>();
|
||||
|
||||
final EssentialsChatPlayerListener playerListener = new EssentialsChatPlayerListener(getServer(), ess, chatListener);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Highest, this);
|
||||
|
||||
@@ -52,11 +52,12 @@ public class EssentialsChatPlayerListener extends PlayerListener
|
||||
|
||||
event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '§').replace("§§", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase()));
|
||||
|
||||
final int radius = ess.getSettings().getChatRadius();
|
||||
long radius = ess.getSettings().getChatRadius();
|
||||
if (radius < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
radius *= radius;
|
||||
|
||||
if (event.getMessage().startsWith("!") && event.getMessage().length() > 1)
|
||||
{
|
||||
@@ -100,13 +101,13 @@ public class EssentialsChatPlayerListener extends PlayerListener
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (u.equals(user) && !u.isAuthorized("essentials.chat.spy"))
|
||||
if (!u.equals(user) && !u.isAuthorized("essentials.chat.spy"))
|
||||
{
|
||||
final Location l = u.getLocation();
|
||||
final int dx = Math.abs(x - l.getBlockX());
|
||||
final int dy = Math.abs(y - l.getBlockY());
|
||||
final int dz = Math.abs(z - l.getBlockZ());
|
||||
final int delta = dx + dy + dz;
|
||||
final int dx = x - l.getBlockX();
|
||||
final int dy = y - l.getBlockY();
|
||||
final int dz = z - l.getBlockZ();
|
||||
final long delta = dx*dx + dy*dy + dz*dz;
|
||||
if (delta > radius || world != l.getWorld())
|
||||
{
|
||||
continue;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user