mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-28 03:57:48 +01:00
Merge branch 'master' into release
This commit is contained in:
commit
081491d0a1
4
.gitignore
vendored
4
.gitignore
vendored
@ -35,4 +35,6 @@
|
||||
/EssentialsUpdate/dist/
|
||||
/EssentialsUpdate/build/
|
||||
/WebPush/apikey.php
|
||||
/WebPush/nbproject/private
|
||||
/WebPush/nbproject/private
|
||||
/.idea
|
||||
*.iml
|
@ -66,7 +66,8 @@ endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.BOSEconomy7.jar=../lib/BOSEconomy7.jar
|
||||
file.reference.bPermissions.jar=../lib/bPermissions.jar
|
||||
file.reference.craftbukkit-1.0.0-SNAPSHOT.jar=../lib/craftbukkit-1.0.0-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
file.reference.craftbukkit.jar=../lib/craftbukkit.jar
|
||||
file.reference.iCo4.jar=../lib/iCo4.jar
|
||||
file.reference.iCo5.jar=../lib/iCo5.jar
|
||||
file.reference.iCo6.jar=../lib/iCo6.jar
|
||||
@ -91,7 +92,8 @@ javac.classpath=\
|
||||
${file.reference.PermissionsBukkit-1.2.jar}:\
|
||||
${file.reference.lombok-0.10.1.jar}:\
|
||||
${reference.EssentialsGroupManager.jar}:\
|
||||
${file.reference.craftbukkit-1.0.0-SNAPSHOT.jar}
|
||||
${file.reference.bukkit.jar}:\
|
||||
${file.reference.craftbukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -151,4 +151,6 @@ public interface ISettings extends IConf
|
||||
public boolean getDisableItemPickupWhileAfk();
|
||||
|
||||
public Priority getRespawnPriority();
|
||||
|
||||
long getTpaAcceptCancellation();
|
||||
}
|
||||
|
113
Essentials/src/com/earth2me/essentials/Kit.java
Normal file
113
Essentials/src/com/earth2me/essentials/Kit.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.commands.NoChargeException;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import java.util.*;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Kit
|
||||
{
|
||||
//TODO: Convert this to use one of the new text classes?
|
||||
public static String listKits(final IEssentials ess, final User user) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
final Map<String, Object> kits = ess.getSettings().getKits();
|
||||
final StringBuilder list = new StringBuilder();
|
||||
for (String kiteItem : kits.keySet())
|
||||
{
|
||||
if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
list.append(" ").append(kiteItem);
|
||||
}
|
||||
}
|
||||
return list.toString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception(_("kitError"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void checkTime(final User user, final String kitName, final Map<String, Object> els) throws NoChargeException
|
||||
{
|
||||
final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0L;
|
||||
final Calendar c = new GregorianCalendar();
|
||||
c.add(Calendar.SECOND, -(int)delay);
|
||||
c.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));
|
||||
|
||||
final long mintime = c.getTimeInMillis();
|
||||
|
||||
final Long lastTime = user.getKitTimestamp(kitName);
|
||||
if (lastTime == null || lastTime < mintime)
|
||||
{
|
||||
final Calendar now = new GregorianCalendar();
|
||||
user.setKitTimestamp(kitName, now.getTimeInMillis());
|
||||
}
|
||||
else
|
||||
{
|
||||
final Calendar future = new GregorianCalendar();
|
||||
future.setTimeInMillis(lastTime);
|
||||
future.add(Calendar.SECOND, (int)delay);
|
||||
future.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
||||
user.sendMessage(_("kitTimed", Util.formatDateDiff(future.getTimeInMillis())));
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getItems(final User user, final Map<String, Object> els) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
return (List<String>)els.get("items");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
user.sendMessage(_("kitError2"));
|
||||
throw new Exception(_("kitErrorHelp"));
|
||||
}
|
||||
}
|
||||
|
||||
public static void expandItems(final IEssentials ess, final User user, final List<String> items) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
boolean spew = false;
|
||||
for (String d : items)
|
||||
{
|
||||
final String[] parts = d.split("[^0-9]+", 3);
|
||||
final int id = Material.getMaterial(Integer.parseInt(parts[0])).getId();
|
||||
final int amount = parts.length > 1 ? Integer.parseInt(parts[parts.length > 2 ? 2 : 1]) : 1;
|
||||
final short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0;
|
||||
final Map<Integer, ItemStack> overfilled;
|
||||
if (user.isAuthorized("essentials.oversizedstacks"))
|
||||
{
|
||||
overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), new ItemStack(id, amount, data));
|
||||
}
|
||||
else
|
||||
{
|
||||
overfilled = InventoryWorkaround.addItem(user.getInventory(), true, new ItemStack(id, amount, data));
|
||||
}
|
||||
for (ItemStack itemStack : overfilled.values())
|
||||
{
|
||||
user.getWorld().dropItemNaturally(user.getLocation(), itemStack);
|
||||
spew = true;
|
||||
}
|
||||
}
|
||||
user.updateInventory();
|
||||
if (spew)
|
||||
{
|
||||
user.sendMessage(_("kitInvFull"));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
user.updateInventory();
|
||||
throw new Exception(_("kitError2"));
|
||||
}
|
||||
}
|
||||
}
|
@ -816,4 +816,10 @@ public class OfflinePlayer implements Player
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Player getKiller()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
@ -606,4 +606,10 @@ public class Settings implements ISettings
|
||||
}
|
||||
return Priority.Normal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTpaAcceptCancellation()
|
||||
{
|
||||
return config.getLong("tpa-accept-cancellation", 0);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
private transient User teleportRequester;
|
||||
private transient boolean teleportRequestHere;
|
||||
private transient final Teleport teleport;
|
||||
private transient long teleportRequestTime;
|
||||
private transient long lastOnlineActivity;
|
||||
private transient long lastActivity = System.currentTimeMillis();
|
||||
private boolean hidden = false;
|
||||
@ -174,7 +175,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
@Override
|
||||
public int compareTo(final User other)
|
||||
{
|
||||
return ChatColor.stripColor(this.getDisplayName()).compareToIgnoreCase(ChatColor.stripColor(other.getDisplayName()));
|
||||
return Util.stripColor(this.getDisplayName()).compareToIgnoreCase(Util.stripColor(other.getDisplayName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -184,14 +185,14 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return ChatColor.stripColor(this.getDisplayName()).equalsIgnoreCase(ChatColor.stripColor(((User)object).getDisplayName()));
|
||||
return this.getName().equalsIgnoreCase(((User)object).getName());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return ChatColor.stripColor(this.getDisplayName()).hashCode();
|
||||
return this.getName().hashCode();
|
||||
}
|
||||
|
||||
public Boolean canSpawnItem(final int itemId)
|
||||
@ -222,6 +223,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
|
||||
public void requestTeleport(final User player, final boolean here)
|
||||
{
|
||||
teleportRequestTime = System.currentTimeMillis();
|
||||
teleportRequester = player;
|
||||
teleportRequestHere = here;
|
||||
}
|
||||
@ -537,4 +539,9 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
return ess.getPermissionsHandler().canBuild(base, getGroup());
|
||||
}
|
||||
|
||||
public long getTeleportRequestTime()
|
||||
{
|
||||
return teleportRequestTime;
|
||||
}
|
||||
}
|
||||
|
@ -477,4 +477,15 @@ public class Util
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
private static transient final Pattern COLOR_PATTERN = Pattern.compile("(?i)\u00A7[0-9A-F]");
|
||||
|
||||
public static String stripColor(final String input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return COLOR_PATTERN.matcher(input).replaceAll("");
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ public class Commandbreak extends EssentialsCommand
|
||||
super("break");
|
||||
}
|
||||
|
||||
//TODO: Switch to use util class
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ public class Commandbutcher extends EssentialsCommand
|
||||
super("butcher");
|
||||
}
|
||||
|
||||
//TODO: Tidy - missed this during command cleanup
|
||||
@Override
|
||||
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
{
|
||||
|
@ -1,14 +1,9 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import com.earth2me.essentials.*;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.*;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandkit extends EssentialsCommand
|
||||
@ -23,131 +18,39 @@ public class Commandkit extends EssentialsCommand
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
try
|
||||
final String kitList = Kit.listKits(ess, user);
|
||||
if (kitList.length() > 0)
|
||||
{
|
||||
final Map<String, Object> kits = ess.getSettings().getKits();
|
||||
final StringBuilder list = new StringBuilder();
|
||||
for (String kiteItem : kits.keySet())
|
||||
{
|
||||
if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
list.append(" ").append(kiteItem);
|
||||
}
|
||||
}
|
||||
if (list.length() > 0)
|
||||
{
|
||||
user.sendMessage(_("kits", list.toString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("noKits"));
|
||||
}
|
||||
user.sendMessage(_("kits", kitList));
|
||||
}
|
||||
catch (Exception ex)
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("kitError"));
|
||||
user.sendMessage(_("noKits"));
|
||||
}
|
||||
throw new NoChargeException();
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
final String kitName = args[0].toLowerCase(Locale.ENGLISH);
|
||||
final Object kit = ess.getSettings().getKit(kitName);
|
||||
|
||||
if (!user.isAuthorized("essentials.kit." + kitName))
|
||||
{
|
||||
final String kitName = args[0].toLowerCase(Locale.ENGLISH);
|
||||
final Object kit = ess.getSettings().getKit(kitName);
|
||||
List<String> items;
|
||||
|
||||
if (!user.isAuthorized("essentials.kit." + kitName))
|
||||
{
|
||||
user.sendMessage(_("noKitPermission", "essentials.kit." + kitName));
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
//System.out.println("Kit is timed");
|
||||
final Map<String, Object> els = (Map<String, Object>)kit;
|
||||
items = (List<String>)els.get("items");
|
||||
final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0L;
|
||||
final Calendar c = new GregorianCalendar();
|
||||
c.add(Calendar.SECOND, -(int)delay);
|
||||
c.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));
|
||||
|
||||
final long mintime = c.getTimeInMillis();
|
||||
|
||||
final Long lastTime = user.getKitTimestamp(kitName);
|
||||
if (lastTime == null || lastTime < mintime)
|
||||
{
|
||||
final Calendar now = new GregorianCalendar();
|
||||
user.setKitTimestamp(kitName, now.getTimeInMillis());
|
||||
}
|
||||
else
|
||||
{
|
||||
final Calendar future = new GregorianCalendar();
|
||||
future.setTimeInMillis(lastTime);
|
||||
future.add(Calendar.SECOND, (int)delay);
|
||||
future.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
||||
user.sendMessage(_("kitTimed", Util.formatDateDiff(future.getTimeInMillis())));
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
items = (List<String>)kit;
|
||||
}
|
||||
|
||||
final Trade charge = new Trade("kit-" + kitName, ess);
|
||||
try
|
||||
{
|
||||
charge.isAffordableFor(user);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
user.sendMessage(ex.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
boolean spew = false;
|
||||
for (String d : items)
|
||||
{
|
||||
final String[] parts = d.split("[^0-9]+", 3);
|
||||
final int id = Material.getMaterial(Integer.parseInt(parts[0])).getId();
|
||||
final int amount = parts.length > 1 ? Integer.parseInt(parts[parts.length > 2 ? 2 : 1]) : 1;
|
||||
final short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0;
|
||||
final Map<Integer, ItemStack> overfilled;
|
||||
if (user.isAuthorized("essentials.oversizedstacks"))
|
||||
{
|
||||
overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), new ItemStack(id, amount, data));
|
||||
}
|
||||
else
|
||||
{
|
||||
overfilled = InventoryWorkaround.addItem(user.getInventory(), true, new ItemStack(id, amount, data));
|
||||
}
|
||||
for (ItemStack itemStack : overfilled.values())
|
||||
{
|
||||
user.getWorld().dropItemNaturally(user.getLocation(), itemStack);
|
||||
spew = true;
|
||||
}
|
||||
}
|
||||
if (spew)
|
||||
{
|
||||
user.sendMessage(_("kitInvFull"));
|
||||
}
|
||||
try
|
||||
{
|
||||
charge.charge(user);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
user.sendMessage(ex.getMessage());
|
||||
}
|
||||
user.sendMessage(_("kitGive", kitName));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
user.sendMessage(_("kitError2"));
|
||||
user.sendMessage(_("kitErrorHelp"));
|
||||
throw new Exception(_("noKitPermission", "essentials.kit." + kitName));
|
||||
}
|
||||
final Map<String, Object> els = (Map<String, Object>)kit;
|
||||
final List<String> items = Kit.getItems(user, els);
|
||||
|
||||
Kit.checkTime(user, kitName, els);
|
||||
|
||||
final Trade charge = new Trade("kit-" + kitName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
|
||||
Kit.expandItems(ess, user, items);
|
||||
|
||||
charge.charge(user);
|
||||
user.sendMessage(_("kitGive", kitName));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
if (!u.isIgnoredPlayer(user.getName()))
|
||||
{
|
||||
u.addMail(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 2));
|
||||
u.addMail(user.getName() + ": " + getFinalArg(args, 2));
|
||||
}
|
||||
user.sendMessage(_("mailSent"));
|
||||
return;
|
||||
@ -69,7 +69,7 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("noPerm","essentials.mail.sendall"));
|
||||
}
|
||||
ess.scheduleAsyncDelayedTask(new SendAll(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 1)));
|
||||
ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + getFinalArg(args, 1)));
|
||||
user.sendMessage(_("mailSent"));
|
||||
return;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class Commandnear extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
long radius = 100;
|
||||
long radius = 200;
|
||||
User otherUser = null;
|
||||
|
||||
if (args.length > 0)
|
||||
@ -72,7 +72,7 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
long radius = 100;
|
||||
long radius = 200;
|
||||
if (args.length > 1)
|
||||
{
|
||||
try
|
||||
@ -111,7 +111,7 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
output.append(", ");
|
||||
}
|
||||
output.append(player.getDisplayName()).append("§f(§4").append(Math.sqrt(delta)).append("m§f)");
|
||||
output.append(player.getDisplayName()).append("§f(§4").append((long)Math.sqrt(delta)).append("m§f)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class Commandpowertool extends EssentialsCommand
|
||||
String command = getFinalArg(args, 0);
|
||||
|
||||
// check to see if this is a clear all command
|
||||
if (command != null && command.equalsIgnoreCase("c:"))
|
||||
if (command != null && command.equalsIgnoreCase("d:"))
|
||||
{
|
||||
user.clearAllPowertools();
|
||||
user.sendMessage(_("powerToolClearAll"));
|
||||
@ -76,11 +76,16 @@ public class Commandpowertool extends EssentialsCommand
|
||||
{
|
||||
if (command.startsWith("a:"))
|
||||
{
|
||||
if (!user.isAuthorized("essentials.powertool.append"))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.powertool.append"));
|
||||
}
|
||||
command = command.substring(2);
|
||||
if (powertools.contains(command))
|
||||
{
|
||||
throw new Exception(_("powerToolAlreadySet", command, itemName));
|
||||
}
|
||||
|
||||
}
|
||||
else if (powertools != null && !powertools.isEmpty())
|
||||
{
|
||||
|
@ -2,8 +2,8 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -31,9 +31,9 @@ public class Commandrealname extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
final String displayName = ChatColor.stripColor(u.getDisplayName()).toLowerCase(Locale.ENGLISH);
|
||||
final String displayName = Util.stripColor(u.getDisplayName()).toLowerCase(Locale.ENGLISH);
|
||||
if (!whois.equals(displayName)
|
||||
&& !displayName.equals(ChatColor.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
|
||||
&& !displayName.equals(Util.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
|
||||
&& !whois.equalsIgnoreCase(u.getName()))
|
||||
{
|
||||
continue;
|
||||
|
@ -31,6 +31,10 @@ public class Commandtpa extends EssentialsCommand
|
||||
player.sendMessage(_("teleportRequest", user.getDisplayName()));
|
||||
player.sendMessage(_("typeTpaccept"));
|
||||
player.sendMessage(_("typeTpdeny"));
|
||||
if (ess.getSettings().getTpaAcceptCancellation() != 0)
|
||||
{
|
||||
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("requestSent", player.getDisplayName()));
|
||||
}
|
||||
|
@ -50,6 +50,10 @@ public class Commandtpaall extends EssentialsCommand
|
||||
player.requestTeleport(user, true);
|
||||
player.sendMessage(_("teleportHereRequest", user.getDisplayName()));
|
||||
player.sendMessage(_("typeTpaccept"));
|
||||
if (ess.getSettings().getTpaAcceptCancellation() != 0)
|
||||
{
|
||||
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -27,6 +27,13 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
long timeout = ess.getSettings().getTpaAcceptCancellation();
|
||||
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
|
||||
{
|
||||
user.requestTeleport(null, false);
|
||||
throw new Exception(_("requestTimedOut"));
|
||||
}
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
if (user.isTeleportRequestHere())
|
||||
{
|
||||
|
@ -28,6 +28,10 @@ public class Commandtpahere extends EssentialsCommand
|
||||
player.requestTeleport(user, true);
|
||||
player.sendMessage(_("teleportHereRequest", user.getDisplayName()));
|
||||
player.sendMessage(_("typeTpaccept"));
|
||||
if (ess.getSettings().getTpaAcceptCancellation() != 0)
|
||||
{
|
||||
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
|
||||
}
|
||||
user.sendMessage(_("requestSent", player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,14 @@ public class Commandtree extends EssentialsCommand
|
||||
{
|
||||
tree = TreeType.TREE;
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("redmushroom"))
|
||||
{
|
||||
tree = TreeType.RED_MUSHROOM;
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("brownmushroom"))
|
||||
{
|
||||
tree = TreeType.BROWN_MUSHROOM;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
|
@ -70,6 +70,7 @@ public class Commandwarp extends EssentialsCommand
|
||||
|
||||
}
|
||||
|
||||
//TODO: Use one of the new text classes, like /help ?
|
||||
private void warpList(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
final Warps warps = ess.getWarps();
|
||||
|
@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -37,7 +36,7 @@ public class Commandwhois extends EssentialsCommand
|
||||
showhidden = true;
|
||||
}
|
||||
final String whois = args[0].toLowerCase(Locale.ENGLISH);
|
||||
final int prefixLength = ChatColor.stripColor(ess.getSettings().getNicknamePrefix()).length();
|
||||
final int prefixLength = Util.stripColor(ess.getSettings().getNicknamePrefix()).length();
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final User user = ess.getUser(onlinePlayer);
|
||||
@ -45,7 +44,7 @@ public class Commandwhois extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
final String nickName = ChatColor.stripColor(user.getNickname());
|
||||
final String nickName = Util.stripColor(user.getNickname());
|
||||
if (!whois.equalsIgnoreCase(nickName)
|
||||
&& !whois.substring(prefixLength).equalsIgnoreCase(nickName)
|
||||
&& !whois.equalsIgnoreCase(user.getName()))
|
||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class BPermissionsHandler implements IPermissionsHandler
|
||||
public class BPermissionsHandler extends SuperpermsHandler
|
||||
{
|
||||
private final transient WorldPermissionsManager wpm;
|
||||
private final transient InfoReader info;
|
||||
@ -71,9 +71,4 @@ public class BPermissionsHandler implements IPermissionsHandler
|
||||
return info.getSuffix(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(final Player base, final String node)
|
||||
{
|
||||
return base.hasPermission(node);
|
||||
}
|
||||
}
|
||||
|
73
Essentials/src/com/earth2me/essentials/signs/SignKit.java
Normal file
73
Essentials/src/com/earth2me/essentials/signs/SignKit.java
Normal file
@ -0,0 +1,73 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.*;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class SignKit extends EssentialsSign
|
||||
{
|
||||
public SignKit()
|
||||
{
|
||||
super("Kit");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
|
||||
{
|
||||
validateTrade(sign, 3, ess);
|
||||
|
||||
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH);
|
||||
|
||||
if (kitName.isEmpty())
|
||||
{
|
||||
sign.setLine(1, "§dKit name!");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
ess.getSettings().getKit(kitName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new SignException(ex.getMessage(), ex);
|
||||
}
|
||||
final String group = sign.getLine(2);
|
||||
if ("Everyone".equalsIgnoreCase(group) || "Everybody".equalsIgnoreCase(group))
|
||||
{
|
||||
sign.setLine(2, "§2Everyone");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
||||
{
|
||||
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH);
|
||||
final String group = sign.getLine(2);
|
||||
if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group)))
|
||||
|| (group.isEmpty() && (player.isAuthorized("essentials.kit." + kitName))))
|
||||
{
|
||||
final Trade charge = getTrade(sign, 3, ess);
|
||||
charge.isAffordableFor(player);
|
||||
try
|
||||
{
|
||||
final Object kit = ess.getSettings().getKit(kitName);
|
||||
final Map<String, Object> els = (Map<String, Object>)kit;
|
||||
final List<String> items = Kit.getItems(player, els);
|
||||
Kit.expandItems(ess, player, items);
|
||||
charge.charge(player);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new SignException(ex.getMessage(), ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -5,8 +5,8 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
@ -147,7 +147,7 @@ public class SignProtection extends EssentialsSign
|
||||
{
|
||||
return SignProtectionState.OWNER;
|
||||
}
|
||||
if (ChatColor.stripColor(sign.getLine(3)).equalsIgnoreCase(username))
|
||||
if (Util.stripColor(sign.getLine(3)).equalsIgnoreCase(username))
|
||||
{
|
||||
return SignProtectionState.OWNER;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ public enum Signs
|
||||
FREE(new SignFree()),
|
||||
GAMEMODE(new SignGameMode()),
|
||||
HEAL(new SignHeal()),
|
||||
KIT(new SignKit()),
|
||||
MAIL(new SignMail()),
|
||||
PROTECTION(new SignProtection()),
|
||||
SELL(new SignSell()),
|
||||
|
@ -273,6 +273,10 @@ sethome-multiple:
|
||||
# essentials.sethome.multiple.staff
|
||||
staff: 10
|
||||
|
||||
#Set timeout in seconds for players to accept tpa before request is cancelled.
|
||||
#Set to 0 for no timeout
|
||||
tpa-accept-cancellation: 0
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsEco | #
|
||||
@ -368,24 +372,21 @@ protect:
|
||||
|
||||
# For which block types would you like to be alerted?
|
||||
# You can find a list of IDs in plugins/Essentials/items.csv after loading Essentials for the first time.
|
||||
# 10 = lava :: 11 = still lava :: 46 = TNT :: 327 = lava bucket
|
||||
alert:
|
||||
# 10: lava
|
||||
# 11: still lava
|
||||
# 46: TNT
|
||||
on-placement: 10,11,46
|
||||
on-use:
|
||||
# 46: TNT
|
||||
on-placement: 10,11,46,327
|
||||
on-use: 327
|
||||
on-break:
|
||||
|
||||
# Users cannot PLACE these types of blocks/items.
|
||||
# < 255 designates a BLOCK
|
||||
# > 255 designates an ITEM (Some blocks can be placed as blocks OR items; lava blocks can be placed by lava buckets, for example.)
|
||||
blacklist:
|
||||
placement: 327,326,14,56,46,11,10,9,8
|
||||
usage: 327,326,325
|
||||
|
||||
# Which blocks should people be prevented from placing
|
||||
placement: 10,11,46,327
|
||||
|
||||
#prevent people from breaking blocks
|
||||
#break: 20,50
|
||||
# Which items should people be prevented from using
|
||||
usage: 327
|
||||
|
||||
# Which blocks should people be prevented from breaking
|
||||
break:
|
||||
|
||||
# Which blocks should not be pushed by pistons
|
||||
|
@ -1425,13 +1425,13 @@ btable,116,0
|
||||
bdesk,116,0
|
||||
mtable,116,0
|
||||
mdesk,116,0
|
||||
brewingstand,117,0
|
||||
brewer,117,0
|
||||
potionstand,117,0
|
||||
potionbrewer,117,0
|
||||
pstand,117,0
|
||||
bstand,117,0
|
||||
pbrewer,117,0
|
||||
brewingstandblock,117,0
|
||||
brewerblock,117,0
|
||||
potionstandblock,117,0
|
||||
potionbrewerblock,117,0
|
||||
pstandblock,117,0
|
||||
bstandblock,117,0
|
||||
pbrewerblock,117,0
|
||||
cauldron,118,0
|
||||
steelcauldron,118,0
|
||||
ironcauldron,118,0
|
||||
@ -2405,8 +2405,10 @@ gcream,378,0
|
||||
bcream,378,0
|
||||
combinedcream,378,0
|
||||
ccream,378,0
|
||||
brewingstanditem,379,0
|
||||
potionstanditem,379,0
|
||||
bstand,379,0
|
||||
pstand,379,0
|
||||
brewingstand,379,0
|
||||
potionstand,379,0
|
||||
cauldronitem,380,0
|
||||
ironcauldronitem,380,0
|
||||
steelcauldronitem,380,0
|
||||
|
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Error reading banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt not found
|
||||
bigTreeFailure=\u00a7cBig tree generation failure. Try again on grass or dirt.
|
||||
bigTreeSuccess= \u00a77Big tree spawned.
|
||||
blockList=Essentials blocked the following commands, due to command conflicts:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cYou are not permitted to build
|
||||
bukkitFormatChanged=Bukkit version format changed. Version not checked.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cYou are not authorized to use question.
|
||||
notAllowedToShout=\u00a7cYou are not authorized to shout.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=You do not have sufficient funds.
|
||||
notRecommendedBukkit=Bukkit version is not the recommended build for Essentials.
|
||||
notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Essentials.
|
||||
notSupportedYet=Not supported yet.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=now
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request.
|
||||
requestDenied=\u00a77Teleport request denied.
|
||||
requestDeniedFrom=\u00a77{0} denied your teleport request.
|
||||
requestSent=\u00a77Request sent to {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit= * ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Error occurred when trying to return player to jail.
|
||||
second=second
|
||||
seconds=seconds
|
||||
@ -402,3 +402,5 @@ year=year
|
||||
years=years
|
||||
youAreHealed=\u00a77You have been healed.
|
||||
youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Fejl i afl\u00e6sning af banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt ikke fundet
|
||||
bigTreeFailure=\u00a7cFejl i generering af stort tr\u00e6. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
|
||||
bigTreeSuccess= \u00a77Stort tr\u00e6 bygget.
|
||||
blockList=Essentials blokerede f\u00c3\u00b8lgende kommandoer som f\u00c3\u00b8lge af kommando-konflikter:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cMeddelelse\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cDu har ikke tilladelse til at bygge
|
||||
bukkitFormatChanged=Bukkit versionsformat er \u00e6ndret. Versionen er ikke checket.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cDu har ikke tilladelse til at bruge sp\u00f8rgsm\u00
|
||||
notAllowedToShout=\u00a7cDu har ikke tilladelse til at r\u00e5be.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=Du har ikke tilstr\u00e6kkeligt med penge.
|
||||
notRecommendedBukkit=Bukkit version er ikke den anbefalede build til Essentials.
|
||||
notRecommendedBukkit=* ! * Bukkit version er ikke den anbefalede build til Essentials.
|
||||
notSupportedYet=Ikke underst\u00f8ttet endnu.
|
||||
nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd.
|
||||
now=nu
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} accepterede din anmodning om teleport.
|
||||
requestDenied=\u00a77Anmodning om teleport afvist.
|
||||
requestDeniedFrom=\u00a77{0} afviste din anmodning om teleport.
|
||||
requestSent=\u00a77Anmodning sendt til {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=En fejl opstod ved fors\u00f8g p\u00e5 at returnere spilleren til f\u00e6ngsel.
|
||||
second=sekund
|
||||
seconds=sekunder
|
||||
@ -402,3 +402,5 @@ year=\u00e5r
|
||||
years=\u00e5r
|
||||
youAreHealed=\u00a77Du er blevet healed. Halleluja!
|
||||
youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Fehler beim Lesen von banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt nicht gefunden
|
||||
bigTreeFailure=\u00a7cFehler beim Pflanzen eines grossen Baums. Versuch es auf Gras oder Dreck.
|
||||
bigTreeSuccess= \u00a77Grosser Baum gepflanzt.
|
||||
blockList=Essentials blocked the following commands, due to command conflicts:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cRundruf\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cDu hast keine Rechte zum Bauen.
|
||||
bukkitFormatChanged=Bukkit-Versionsformat hat sich ge\u00e4ndert. Version nicht kontrolliert.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cDu bist nicht berechtigt zu fragen.
|
||||
notAllowedToShout=\u00a7cDu bist nicht berechtigt zu schreien.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=Du hast nicht genug Geld.
|
||||
notRecommendedBukkit=Die verwendete Bukkit-Version ist nicht f\u00fcr Essentials empfohlen.
|
||||
notRecommendedBukkit=* ! * Die verwendete Bukkit-Version ist nicht f\u00fcr Essentials empfohlen.
|
||||
notSupportedYet=Noch nicht verf\u00fcgbar.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=jetzt
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} hat deine Teleportierungsanfrage angenommen.
|
||||
requestDenied=\u00a77Teleportierungsanfrage verweigert.
|
||||
requestDeniedFrom=\u00a77{0} hat deine Teleportierungsanfrage abgelehnt.
|
||||
requestSent=\u00a77Anfrage gesendet an {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
|
||||
second=Sekunde
|
||||
seconds=Sekunden
|
||||
@ -402,3 +402,5 @@ year=Jahr
|
||||
years=Jahre
|
||||
youAreHealed=\u00a77Du wurdest geheilt.
|
||||
youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Error reading banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt not found
|
||||
bigTreeFailure=\u00a7cBig tree generation failure. Try again on grass or dirt.
|
||||
bigTreeSuccess= \u00a77Big tree spawned.
|
||||
blockList=Essentials blocked the following commands, due to command conflicts:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cYou are not permitted to build
|
||||
bukkitFormatChanged=Bukkit version format changed. Version not checked.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cYou are not authorized to use question.
|
||||
notAllowedToShout=\u00a7cYou are not authorized to shout.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=You do not have sufficient funds.
|
||||
notRecommendedBukkit=Bukkit version is not the recommended build for Essentials.
|
||||
notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essentials.
|
||||
notSupportedYet=Not supported yet.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=now
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request.
|
||||
requestDenied=\u00a77Teleport request denied.
|
||||
requestDeniedFrom=\u00a77{0} denied your teleport request
|
||||
requestSent=\u00a77Request sent to {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Error occurred when trying to return player to jail.
|
||||
second=second
|
||||
seconds=seconds
|
||||
@ -402,3 +402,5 @@ year=year
|
||||
years=years
|
||||
youAreHealed=\u00a77You have been healed.
|
||||
youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Error leyendo banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt no encontrado
|
||||
bigTreeFailure=\u00a7cBig Generacion de arbol fallida. Prueba de nuevo en hierba o arena.
|
||||
bigTreeSuccess= \u00a77Big Arbol generado.
|
||||
blockList=Essentials blocked the following commands, due to command conflicts:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cNo tienes permisos para construir
|
||||
bukkitFormatChanged=Version de formato de Bukkit cambiado. Version no comprobada.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cYou estas autorizado para usar las preguntas.
|
||||
notAllowedToShout=\u00a7cNo estas autorizado para gritar.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=No tienes el dinero suficiente.
|
||||
notRecommendedBukkit=La version de bukkit no es la recomendada para esta version de Essentials.
|
||||
notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta version de Essentials.
|
||||
notSupportedYet=No esta soportado aun.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=ahora
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} acepto tu peticion de teletransporte.
|
||||
requestDenied=\u00a77Peticion de teletransporte denegada.
|
||||
requestDeniedFrom=\u00a77{0} ha denegado tu peticion de teletransporte.
|
||||
requestSent=\u00a77Peticion enviada a {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Error al intentar quitar al jugador de la carcel.
|
||||
second=segundo
|
||||
seconds=segundos
|
||||
@ -402,3 +402,5 @@ year=año
|
||||
years=años
|
||||
youAreHealed=\u00a77Has sido curado.
|
||||
youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Erreur lors de la lecture de banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt introuvable.
|
||||
bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l''herbe.
|
||||
bigTreeSuccess=\u00a77Gros arbre cr\u00e9e.
|
||||
blockList=Essentials blocked the following commands, due to command conflicts:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cMessage\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cVous n''avez pas la permission de construire.
|
||||
bukkitFormatChanged=Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des
|
||||
notAllowedToShout=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=Vous n''avez pas les fonds n\u00e9cessaires.
|
||||
notRecommendedBukkit=La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
|
||||
notRecommendedBukkit=* ! * La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
|
||||
notSupportedYet=Pas encore pris en charge.
|
||||
nothingInHand = \u00a7cVous n''avez rien en main.
|
||||
now=maintenant
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} a accept\u00e9 votre demande de t\u00e9l\u00e9por
|
||||
requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
|
||||
requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation.
|
||||
requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur.
|
||||
second=seconde
|
||||
seconds=secondes
|
||||
@ -402,3 +402,5 @@ year=ann\u00e9e
|
||||
years=ann\u00e9es
|
||||
youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
|
||||
youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -24,7 +24,7 @@ bannedPlayersFileError=Fout bij het lezen van banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt werd niet gevonden
|
||||
bigTreeFailure=\u00a7cMaken van een grote boom is mislukt. Probeer het opnieuw op gras of dirt.
|
||||
bigTreeSuccess= \u00a77Grote boom gemaakt.
|
||||
blockList=Essentials blocked the following commands, due to command conflicts:
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cJe bent niet bevoegd om te bouwen
|
||||
bukkitFormatChanged=Bukkit versie formaat veranderd. Versie niet nagekeken.
|
||||
@ -233,7 +233,7 @@ notAllowedToQuestion=\u00a7cJe bent niet bevoegd om de vraag functie te gebruike
|
||||
notAllowedToShout=\u00a7cJe bent niet bevoegd om de roep functie te gebruiken.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=Je hebt niet voldoende middelen.
|
||||
notRecommendedBukkit=De Bukkit versie is niet de aangeraden build voor Essentials.
|
||||
notRecommendedBukkit=* ! * De Bukkit versie is niet de aangeraden build voor Essentials.
|
||||
notSupportedYet=Nog niet ondersteund.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=nu
|
||||
@ -291,7 +291,7 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request.
|
||||
requestDenied=\u00a77Teleporteer aanvraag geweigerd.
|
||||
requestDeniedFrom=\u00a77{0} denied your teleport request.
|
||||
requestSent=\u00a77Aanvraag verstuurd naar {0}\u00a77.
|
||||
requiredBukkit=You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Fout opgetreden bij terugzetten van speler in gevangenis.
|
||||
second=seconde
|
||||
seconds=seconde
|
||||
@ -402,3 +402,5 @@ year=jaar
|
||||
years=jaren
|
||||
youAreHealed=\u00a77Je bent genezen.
|
||||
youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
|
@ -240,7 +240,7 @@ commands:
|
||||
aliases: [pong,eping,epong]
|
||||
powertool:
|
||||
description: Assigns a command to the item in hand, {player} will be replaced by the name of the player that you click.
|
||||
usage: /<command> [l:|a:|r:|c:][command] [arguments]
|
||||
usage: /<command> [l:|a:|r:|c:|d:][command] [arguments]
|
||||
aliases: [pt,epowertool,ept]
|
||||
powertooltoggle:
|
||||
description: Enables or disables all current powertools
|
||||
|
@ -531,6 +531,24 @@ public class FakeServer implements Server
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getFirstPlayed()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLastPlayed()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPlayedBefore()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -599,4 +617,10 @@ public class FakeServer implements Server
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAllowEnd()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsChat.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
includes=**
|
||||
jar.compress=true
|
||||
javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
|
||||
${file.reference.bukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -4,10 +4,12 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@ -15,8 +17,10 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
public class EssentialsChat extends JavaPlugin
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private Map<String, IEssentialsChatListener> chatListener;
|
||||
private transient Map<String, IEssentialsChatListener> chatListener;
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
final PluginManager pluginManager = getServer().getPluginManager();
|
||||
@ -31,11 +35,13 @@ public class EssentialsChat extends JavaPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
chatListener = new HashMap<String, IEssentialsChatListener>();
|
||||
chatListener = new ConcurrentSkipListMap<String, IEssentialsChatListener>();
|
||||
final Map<PlayerChatEvent, String> charges = new HashMap<PlayerChatEvent, String>();
|
||||
|
||||
|
||||
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatListener);
|
||||
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatListener);
|
||||
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatListener);
|
||||
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatListener, charges);
|
||||
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatListener, charges);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerLowest, Priority.Lowest, this);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerNormal, Priority.Normal, this);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this);
|
||||
@ -43,6 +49,7 @@ public class EssentialsChat extends JavaPlugin
|
||||
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable()
|
||||
{
|
||||
if (chatListener != null)
|
||||
|
@ -10,14 +10,25 @@ import org.bukkit.event.player.PlayerChatEvent;
|
||||
|
||||
public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
|
||||
{
|
||||
public EssentialsChatPlayerListenerHighest(Server server, IEssentials ess, Map<String, IEssentialsChatListener> listeners)
|
||||
private final transient Map<PlayerChatEvent, String> charges;
|
||||
|
||||
public EssentialsChatPlayerListenerHighest(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners,
|
||||
final Map<PlayerChatEvent, String> charges)
|
||||
{
|
||||
super(server, ess, listeners);
|
||||
this.charges = charges;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
{
|
||||
String charge = charges.remove(event);
|
||||
if (charge == null)
|
||||
{
|
||||
charge = "chat";
|
||||
}
|
||||
if (isAborted(event))
|
||||
{
|
||||
return;
|
||||
@ -27,22 +38,14 @@ public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
|
||||
* This file should handle charging the user for the action before returning control back
|
||||
*/
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final String chatType = getChatType(event.getMessage());
|
||||
final StringBuilder command = new StringBuilder();
|
||||
command.append("chat");
|
||||
|
||||
if (chatType.length() > 0)
|
||||
{
|
||||
command.append("-").append(chatType);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
charge(user, command.toString());
|
||||
charge(user, charge);
|
||||
}
|
||||
catch (ChargeException e)
|
||||
{
|
||||
ess.showError(user, e, command.toString());
|
||||
ess.showError(user, e, charge);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -10,7 +10,9 @@ import org.bukkit.event.player.PlayerChatEvent;
|
||||
|
||||
public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
|
||||
{
|
||||
public EssentialsChatPlayerListenerLowest(Server server, IEssentials ess, Map<String, IEssentialsChatListener> listeners)
|
||||
public EssentialsChatPlayerListenerLowest(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners)
|
||||
{
|
||||
super(server, ess, listeners);
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.earth2me.essentials.chat;
|
||||
|
||||
import com.earth2me.essentials.ChargeException;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
@ -12,9 +11,15 @@ import org.bukkit.event.player.PlayerChatEvent;
|
||||
|
||||
public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
|
||||
{
|
||||
public EssentialsChatPlayerListenerNormal(Server server, IEssentials ess, Map<String, IEssentialsChatListener> listeners)
|
||||
private final transient Map<PlayerChatEvent, String> charges;
|
||||
|
||||
public EssentialsChatPlayerListenerNormal(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners,
|
||||
final Map<PlayerChatEvent, String> charges)
|
||||
{
|
||||
super(server, ess, listeners);
|
||||
this.charges = charges;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -29,49 +34,46 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
|
||||
* This file should handle detection of the local chat features... if local chat is enabled, we need to handle
|
||||
* it here
|
||||
*/
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final String chatType = getChatType(event.getMessage());
|
||||
final StringBuilder command = new StringBuilder();
|
||||
command.append("chat");
|
||||
|
||||
if (chatType.length() > 0)
|
||||
{
|
||||
command.append("-").append(chatType);
|
||||
}
|
||||
long radius = ess.getSettings().getChatRadius();
|
||||
if (radius < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
radius *= radius;
|
||||
try
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (event.getMessage().length() > 0 && chatType.length() > 0)
|
||||
{
|
||||
if (event.getMessage().length() > 0 && chatType.length() > 0)
|
||||
final StringBuilder permission = new StringBuilder();
|
||||
permission.append("essentials.chat.").append(chatType);
|
||||
|
||||
final StringBuilder format = new StringBuilder();
|
||||
format.append(chatType).append("Format");
|
||||
|
||||
final StringBuilder errorMsg = new StringBuilder();
|
||||
errorMsg.append("notAllowedTo").append(chatType.substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatType.substring(1));
|
||||
|
||||
if (user.isAuthorized(permission.toString()))
|
||||
{
|
||||
StringBuilder permission = new StringBuilder();
|
||||
permission.append("essentials.chat.").append(chatType);
|
||||
|
||||
StringBuilder command = new StringBuilder();
|
||||
command.append("chat-").append(chatType);
|
||||
|
||||
StringBuilder format = new StringBuilder();
|
||||
format.append(chatType).append("Format");
|
||||
|
||||
StringBuilder errorMsg = new StringBuilder();
|
||||
errorMsg.append("notAllowedTo").append(chatType.substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatType.substring(1));
|
||||
|
||||
if (user.isAuthorized(permission.toString()))
|
||||
{
|
||||
charge(user, command.toString());
|
||||
event.setMessage(event.getMessage().substring(1));
|
||||
event.setFormat(_(format.toString(), event.getFormat()));
|
||||
return;
|
||||
}
|
||||
|
||||
user.sendMessage(_(errorMsg.toString()));
|
||||
event.setCancelled(true);
|
||||
event.setMessage(event.getMessage().substring(1));
|
||||
event.setFormat(_(format.toString(), event.getFormat()));
|
||||
charges.put(event, command.toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (ChargeException ex)
|
||||
{
|
||||
ess.showError(user, ex, "Shout");
|
||||
|
||||
user.sendMessage(_(errorMsg.toString()));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
sendLocalChat(user, radius, event);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,6 @@ main: com.earth2me.essentials.chat.EssentialsChat
|
||||
version: TeamCity
|
||||
website: http://www.earth2me.net:8001/
|
||||
description: Provides chat control features for Essentials. Requires Permissions.
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, Okamosy]
|
||||
depend: [Essentials]
|
||||
#softdepend: [Factions]
|
@ -63,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsGeoIP.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
includes=**
|
||||
jar.compress=true
|
||||
javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
|
||||
${file.reference.bukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -39,14 +39,14 @@ dist.jar=${dist.dir}/EssentialsGroupBridge.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
includes=**
|
||||
jar.archive.disabled=${jnlp.enabled}
|
||||
jar.compress=true
|
||||
jar.index=${jnlp.enabled}
|
||||
javac.classpath=\
|
||||
${reference.EssentialsGroupManager.jar}:\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
|
||||
${file.reference.bukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -2,6 +2,6 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="../lib/bukkit-0.0.1-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="../lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="../lib/craftbukkit.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -39,11 +39,11 @@ dist.jar=${dist.dir}/EssentialsGroupManager.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/craftbukkit.jar
|
||||
includes=**
|
||||
jar.compress=true
|
||||
javac.classpath=\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
|
||||
${file.reference.craftbukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -79,4 +79,7 @@ v 1.6:
|
||||
- Optimize sorting to speedup permission tests.
|
||||
- Fix superperms to pass all tests http://dev.bukkit.org/server-mods/superpermstest/
|
||||
- Optimizations include changing the return of comparePermissionString.
|
||||
- Added file details in error messages for loading groups/users.
|
||||
- Added file details in error messages for loading groups/users.
|
||||
v 1.7:
|
||||
- GM now supports offline players without having to mantogglevalidate
|
||||
- Offline player checks now support partial name matches.
|
@ -16,6 +16,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -30,6 +31,7 @@ import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
import org.anjocaido.groupmanager.utils.Tasks;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
@ -325,7 +327,7 @@ public class GroupManager extends JavaPlugin {
|
||||
PermissionCheckResult permissionResult = null;
|
||||
ArrayList<User> removeList = null;
|
||||
String auxString = null;
|
||||
List<Player> match = null;
|
||||
List<String> match = null;
|
||||
User auxUser = null;
|
||||
Group auxGroup = null;
|
||||
Group auxGroup2 = null;
|
||||
@ -373,15 +375,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -427,15 +426,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -467,15 +463,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -509,15 +502,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub <user> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -596,15 +586,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -664,15 +651,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -718,17 +702,13 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> (+))");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
} else
|
||||
targetPlayer = this.getServer().getPlayer(match.get(0).getName());
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -765,6 +745,7 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
// bukkit perms
|
||||
if ((args.length == 2) && (args[1].equalsIgnoreCase("+"))) {
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null) {
|
||||
sender.sendMessage(ChatColor.YELLOW + "Superperms reports: ");
|
||||
for (String line : BukkitPermissions.listPerms(targetPlayer))
|
||||
@ -786,19 +767,16 @@ public class GroupManager extends JavaPlugin {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
} else
|
||||
targetPlayer = this.getServer().getPlayer(match.get(0).getName());
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
// VALIDANDO PERMISSAO
|
||||
permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]);
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||
@ -1089,15 +1067,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable> <value>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1124,15 +1099,12 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1155,15 +1127,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1192,15 +1160,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1359,15 +1323,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1393,15 +1353,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1431,15 +1387,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1613,15 +1565,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1673,15 +1621,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
auxUser = dataHolder.getUser(match.get(0));
|
||||
} else {
|
||||
auxUser = dataHolder.getUser(args[0]);
|
||||
}
|
||||
@ -1841,6 +1785,49 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a List of players matching the name given. If none online, check
|
||||
* Offline.
|
||||
*
|
||||
* @param playerName, sender
|
||||
* @return true if a single match is found
|
||||
*/
|
||||
private List<String> validatePlayer(String playerName, CommandSender sender) {
|
||||
|
||||
List<Player> players = new ArrayList<Player>();
|
||||
List<String> match = new ArrayList<String>();
|
||||
|
||||
players = this.getServer().matchPlayer(playerName);
|
||||
if (players.isEmpty()) {
|
||||
// Check for an offline player (exact match).
|
||||
if (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) {
|
||||
match.add(playerName);
|
||||
} else {
|
||||
//look for partial matches
|
||||
for (OfflinePlayer offline : this.getServer().getOfflinePlayers()) {
|
||||
if (offline.getName().toLowerCase().startsWith(playerName.toLowerCase()))
|
||||
match.add(offline.getName());
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
for (Player player : players) {
|
||||
match.add(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
if (match.isEmpty() || match == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
return null;
|
||||
} else if (match.size() > 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Too many matches found! (" + match.toString() + ")");
|
||||
return null;
|
||||
}
|
||||
|
||||
return match;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the config
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: GroupManager
|
||||
version: "1.6 (Phoenix)"
|
||||
version: "1.7 (Phoenix)"
|
||||
main: org.anjocaido.groupmanager.GroupManager
|
||||
website: http://www.anjocaido.info/
|
||||
description: Provides on-the-fly system for permissions system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
||||
|
@ -63,7 +63,7 @@ dist.jar=${dist.dir}/original-EssentialsProtect.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
file.reference.c3p0-0.9.1.2.jar=..\\lib\\c3p0-0.9.1.2.jar
|
||||
includes=**
|
||||
jar.archive.disabled=${jnlp.enabled}
|
||||
@ -72,7 +72,7 @@ jar.index=${jnlp.enabled}
|
||||
javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${file.reference.c3p0-0.9.1.2.jar}:\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
|
||||
${file.reference.bukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -5,5 +5,5 @@ main: com.earth2me.essentials.protect.EssentialsProtect
|
||||
version: TeamCity
|
||||
website: http://www.earth2me.net:8001/
|
||||
description: Provides protection for various parts of the world.
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
|
||||
softdepend: [Essentials]
|
@ -63,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsSpawn.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
includes=**
|
||||
jar.compress=true
|
||||
javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}
|
||||
${file.reference.bukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -5,7 +5,7 @@ main: com.earth2me.essentials.spawn.EssentialsSpawn
|
||||
version: TeamCity
|
||||
website: http://www.earth2me.net:8001/
|
||||
description: Provides spawn control commands, utilizing Essentials.
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
|
||||
depend: [Essentials]
|
||||
commands:
|
||||
setspawn:
|
||||
|
@ -63,7 +63,7 @@ dist.jar=${dist.dir}/original-EssentialsXMPP.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar=../lib/bukkit-1.0.0-R1-SNAPSHOT.jar
|
||||
file.reference.bukkit.jar=../lib/bukkit.jar
|
||||
file.reference.smack-3.2.1.jar=../lib/smack-3.2.1.jar
|
||||
includes=**
|
||||
jar.archive.disabled=${jnlp.enabled}
|
||||
@ -71,8 +71,8 @@ jar.compress=true
|
||||
jar.index=${jnlp.enabled}
|
||||
javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${file.reference.bukkit-1.0.0-R1-SNAPSHOT.jar}:\
|
||||
${file.reference.smack-3.2.1.jar}
|
||||
${file.reference.smack-3.2.1.jar}:\
|
||||
${file.reference.bukkit.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=-Xlint:unchecked
|
||||
javac.deprecation=false
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user