mirror of
https://github.com/EssentialsX/Essentials.git
synced 2026-11-05 01:00:13 -05:00
Compare commits
213
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e34a396cd | ||
|
|
ba96117f55 | ||
|
|
96b217cbe8 | ||
|
|
0dd5c0370e | ||
|
|
bdf32cde9e | ||
|
|
e91ed60441 | ||
|
|
8577202f48 | ||
|
|
7819b9d2f0 | ||
|
|
15c0565923 | ||
|
|
2b25ca2932 | ||
|
|
c7a6677d52 | ||
|
|
c3d5b32986 | ||
|
|
cbfb524195 | ||
|
|
b16a1f7237 | ||
|
|
e28f1b1be3 | ||
|
|
b512a243e7 | ||
|
|
873c9880dd | ||
|
|
e6736e48a5 | ||
|
|
caf598f55b | ||
|
|
619e099a04 | ||
|
|
faba1e3604 | ||
|
|
7cb728b15f | ||
|
|
3e3c7f0d54 | ||
|
|
a45c19a08b | ||
|
|
eb74a1de9c | ||
|
|
8450734cf1 | ||
|
|
016299a1dd | ||
|
|
d27ff9abb6 | ||
|
|
cdf5d45483 | ||
|
|
5622882602 | ||
|
|
b3d3928db8 | ||
|
|
6df3b9008a | ||
|
|
c36ca65e09 | ||
|
|
2e788802fe | ||
|
|
b0552019f5 | ||
|
|
dae69622a5 | ||
|
|
696b930fb2 | ||
|
|
e43a62f992 | ||
|
|
02c1cb05c7 | ||
|
|
b44d738867 | ||
|
|
e1818f7e62 | ||
|
|
e5081db7e4 | ||
|
|
ba346bd797 | ||
|
|
0670ece7f3 | ||
|
|
a8da3eebd7 | ||
|
|
056303b53c | ||
|
|
454f7d30de | ||
|
|
6d1c270976 | ||
|
|
d1001274bb | ||
|
|
3099855562 | ||
|
|
3f26d4ad98 | ||
|
|
bae337cc49 | ||
|
|
3823e7a108 | ||
|
|
1c2221f52f | ||
|
|
1b780a4364 | ||
|
|
ac3e65a829 | ||
|
|
332f19177e | ||
|
|
6ab57b9abe | ||
|
|
862f3aad59 | ||
|
|
e277acf80e | ||
|
|
9f893e68e9 | ||
|
|
833a5b2b55 | ||
|
|
340f0c68eb | ||
|
|
a5e3182dad | ||
|
|
10ae9c3aa2 | ||
|
|
bcf903de92 | ||
|
|
ad08d27504 | ||
|
|
d24f77dbd5 | ||
|
|
a5b38ce1a4 | ||
|
|
5d048d2c1d | ||
|
|
13d3cc3306 | ||
|
|
9f02fb4dd4 | ||
|
|
07baa6e611 | ||
|
|
50bd5869bf | ||
|
|
fa49fc91d2 | ||
|
|
28f478dd04 | ||
|
|
6fb8dad0ec | ||
|
|
9f605e9a88 | ||
|
|
e5b91dae73 | ||
|
|
e1749fecd1 | ||
|
|
358edff798 | ||
|
|
34f13ba89c | ||
|
|
945ba6f8ab | ||
|
|
46f05ee92f | ||
|
|
6d46fc66ce | ||
|
|
ed7fe9213f | ||
|
|
9c68cbae72 | ||
|
|
c0df771539 | ||
|
|
9bd0c33fef | ||
|
|
8042cefd3d | ||
|
|
16a0f44b4d | ||
|
|
1a2acb43ae | ||
|
|
36d07cb539 | ||
|
|
6ca1cdec4f | ||
|
|
e2abf05a27 | ||
|
|
d9e6f2975a | ||
|
|
d8ac3587ac | ||
|
|
85c4fbdf4f | ||
|
|
5a7f38fa29 | ||
|
|
417148f5da | ||
|
|
a85cbdd505 | ||
|
|
b4d91978c7 | ||
|
|
16bde87982 | ||
|
|
270533652b | ||
|
|
03d640260d | ||
|
|
f27b2290dc | ||
|
|
efda9beece | ||
|
|
c7c7e5e4ce | ||
|
|
f61f80164d | ||
|
|
d16fef9f7f | ||
|
|
4425d53664 | ||
|
|
ee5e015a63 | ||
|
|
839ce3d526 | ||
|
|
cc06117210 | ||
|
|
cbd5b6c0f4 | ||
|
|
867e66e774 | ||
|
|
45ffeaffec | ||
|
|
f91b622646 | ||
|
|
40a9c28699 | ||
|
|
081491d0a1 | ||
|
|
8d0230d6a8 | ||
|
|
37e5260cda | ||
|
|
19b8031933 | ||
|
|
99211fd407 | ||
|
|
3d839c2b21 | ||
|
|
e1e7a1cfdb | ||
|
|
0ed7f87ee0 | ||
|
|
579bbc9f2c | ||
|
|
e672de949c | ||
|
|
f72762bcb2 | ||
|
|
7ecc3c25b0 | ||
|
|
adcffba7cf | ||
|
|
e271e60144 | ||
|
|
16be86953f | ||
|
|
1f527cdb9e | ||
|
|
11e8240c5c | ||
|
|
4aecc034c2 | ||
|
|
a111a07bca | ||
|
|
eb71097546 | ||
|
|
c7fcb72d6c | ||
|
|
04af8ef329 | ||
|
|
4cdf803ab7 | ||
|
|
4595c15bee | ||
|
|
1e3d2fbfd2 | ||
|
|
57c25bf151 | ||
|
|
ae030b227a | ||
|
|
4f85751694 | ||
|
|
6b0d0daa2e | ||
|
|
401498a4f7 | ||
|
|
8bb50189bc | ||
|
|
eb665a059a | ||
|
|
3dc29be083 | ||
|
|
82e5447526 | ||
|
|
066f3fd726 | ||
|
|
f0acf733a5 | ||
|
|
96c4dd2ab9 | ||
|
|
df3b9a7ef9 | ||
|
|
70a3a5919e | ||
|
|
688d37ee60 | ||
|
|
3dcf8bc8fc | ||
|
|
7039d613ee | ||
|
|
256c963370 | ||
|
|
7b8c2a4575 | ||
|
|
7f1ba0d6ae | ||
|
|
7e5b79aa14 | ||
|
|
086343ee48 | ||
|
|
a1ad512a80 | ||
|
|
9bb2ef9cbe | ||
|
|
832910d480 | ||
|
|
13da2b2924 | ||
|
|
84ac520353 | ||
|
|
5613975314 | ||
|
|
662d30ae45 | ||
|
|
57bee443b1 | ||
|
|
621618e41f | ||
|
|
6ccb60813a | ||
|
|
b34119901e | ||
|
|
b317aef8c9 | ||
|
|
fdbc6fa94f | ||
|
|
0ffe24903a | ||
|
|
e550a7cc44 | ||
|
|
82165a2af6 | ||
|
|
63a4fe32c1 | ||
|
|
1c44a25a4a | ||
|
|
cf21ecee2e | ||
|
|
5467e502a5 | ||
|
|
6af9ec266b | ||
|
|
faa7e0e7a9 | ||
|
|
aa3606007a | ||
|
|
db5974970d | ||
|
|
ba2539db67 | ||
|
|
21d0661d79 | ||
|
|
9f3eb461a9 | ||
|
|
34b0deba29 | ||
|
|
d9a93d8dff | ||
|
|
747776344b | ||
|
|
f979a79081 | ||
|
|
367e9840cc | ||
|
|
ea590c2ed1 | ||
|
|
d93120257b | ||
|
|
e763b362d9 | ||
|
|
e5eb1ca0cb | ||
|
|
ea2649db5e | ||
|
|
b53fc9cadc | ||
|
|
4b35e1b729 | ||
|
|
40e106db13 | ||
|
|
3dc0659f66 | ||
|
|
e652ed2981 | ||
|
|
28db891aa5 | ||
|
|
b63ae9b771 | ||
|
|
27c84ceaac | ||
|
|
d67ccd03ca | ||
|
|
96b0f27c51 |
No files matched your search
@@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException;
|
||||
|
||||
public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
public static final int BUKKIT_VERSION = 1952;
|
||||
public static final int BUKKIT_VERSION = 1988;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient ISettings settings;
|
||||
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
||||
@@ -129,11 +129,11 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName()));
|
||||
}
|
||||
}
|
||||
final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion());
|
||||
final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion());
|
||||
if (versionMatch.matches())
|
||||
{
|
||||
final int versionNumber = Integer.parseInt(versionMatch.group(4));
|
||||
if (versionNumber < BUKKIT_VERSION)
|
||||
final int versionNumber = Integer.parseInt(versionMatch.group(1));
|
||||
if (versionNumber < BUKKIT_VERSION && versionNumber > 100)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("notRecommendedBukkit"));
|
||||
LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
|
||||
|
||||
@@ -32,7 +32,7 @@ public class EssentialsBlockListener implements Listener
|
||||
{
|
||||
return;
|
||||
}
|
||||
boolean unlimitedForUser = user.hasUnlimited(is);
|
||||
final boolean unlimitedForUser = user.hasUnlimited(is);
|
||||
if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL)
|
||||
{
|
||||
ess.scheduleSyncDelayedTask(
|
||||
|
||||
@@ -24,48 +24,47 @@ public class EssentialsEntityListener implements Listener
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDamage(EntityDamageEvent event)
|
||||
public void onEntityDamage(final EntityDamageByEntityEvent event)
|
||||
{
|
||||
if (event instanceof EntityDamageByEntityEvent)
|
||||
final Entity eAttack = event.getDamager();
|
||||
final Entity eDefend = event.getEntity();
|
||||
if (eDefend instanceof Player && eAttack instanceof Player)
|
||||
{
|
||||
EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event;
|
||||
Entity eAttack = edEvent.getDamager();
|
||||
Entity eDefend = edEvent.getEntity();
|
||||
if (eDefend instanceof Player && eAttack instanceof Player)
|
||||
final User defender = ess.getUser(eDefend);
|
||||
final User attacker = ess.getUser(eAttack);
|
||||
attacker.updateActivity(true);
|
||||
final List<String> commandList = attacker.getPowertool(attacker.getItemInHand());
|
||||
if (commandList != null && !commandList.isEmpty())
|
||||
{
|
||||
User defender = ess.getUser(eDefend);
|
||||
User attacker = ess.getUser(eAttack);
|
||||
attacker.updateActivity(true);
|
||||
ItemStack is = attacker.getItemInHand();
|
||||
List<String> commandList = attacker.getPowertool(is);
|
||||
if (commandList != null && !commandList.isEmpty())
|
||||
for (String command : commandList)
|
||||
{
|
||||
for (String command : commandList)
|
||||
if (command != null && !command.isEmpty())
|
||||
{
|
||||
|
||||
if (command != null && !command.isEmpty())
|
||||
{
|
||||
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (eDefend instanceof Animals && eAttack instanceof Player)
|
||||
}
|
||||
else if (eDefend instanceof Animals && eAttack instanceof Player)
|
||||
{
|
||||
final User player = ess.getUser(eAttack);
|
||||
final ItemStack hand = player.getItemInHand();
|
||||
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
||||
{
|
||||
User player = ess.getUser(eAttack);
|
||||
ItemStack hand = player.getItemInHand();
|
||||
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
||||
{
|
||||
((Animals)eDefend).setAge(-24000);
|
||||
hand.setType(Material.BUCKET);
|
||||
player.setItemInHand(hand);
|
||||
player.updateInventory();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
((Animals)eDefend).setAge(-24000);
|
||||
hand.setType(Material.BUCKET);
|
||||
player.setItemInHand(hand);
|
||||
player.updateInventory();
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDamage(final EntityDamageEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
|
||||
{
|
||||
final Player player = (Player)event.getEntity();
|
||||
@@ -76,7 +75,7 @@ public class EssentialsEntityListener implements Listener
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityCombust(EntityCombustEvent event)
|
||||
public void onEntityCombust(final EntityCombustEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
|
||||
{
|
||||
@@ -85,26 +84,22 @@ public class EssentialsEntityListener implements Listener
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDeath(final EntityDeathEvent event)
|
||||
public void onPlayerDeathEvent(final PlayerDeathEvent event)
|
||||
{
|
||||
if (event instanceof PlayerDeathEvent)
|
||||
final User user = ess.getUser(event.getEntity());
|
||||
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back"))
|
||||
{
|
||||
final PlayerDeathEvent pdevent = (PlayerDeathEvent)event;
|
||||
final User user = ess.getUser(pdevent.getEntity());
|
||||
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back"))
|
||||
{
|
||||
user.setLastLocation();
|
||||
user.sendMessage(_("backAfterDeath"));
|
||||
}
|
||||
if (!ess.getSettings().areDeathMessagesEnabled())
|
||||
{
|
||||
pdevent.setDeathMessage("");
|
||||
}
|
||||
user.setLastLocation();
|
||||
user.sendMessage(_("backAfterDeath"));
|
||||
}
|
||||
if (!ess.getSettings().areDeathMessagesEnabled())
|
||||
{
|
||||
event.setDeathMessage("");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event)
|
||||
public void onFoodLevelChange(final FoodLevelChangeEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
|
||||
{
|
||||
@@ -113,7 +108,7 @@ public class EssentialsEntityListener implements Listener
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityRegainHealth(EntityRegainHealthEvent event)
|
||||
public void onEntityRegainHealth(final EntityRegainHealthEvent event)
|
||||
{
|
||||
if (event.getRegainReason() == RegainReason.SATIATED && event.getEntity() instanceof Player
|
||||
&& ess.getUser(event.getEntity()).isAfk() && ess.getSettings().getFreezeAfkPlayers())
|
||||
|
||||
@@ -182,10 +182,16 @@ public class EssentialsPlayerListener implements Listener
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerLogin(final PlayerLoginEvent event)
|
||||
{
|
||||
if (event.getResult() != Result.ALLOWED && event.getResult() != Result.KICK_FULL && event.getResult() != Result.KICK_BANNED)
|
||||
switch (event.getResult())
|
||||
{
|
||||
case ALLOWED:
|
||||
case KICK_FULL:
|
||||
case KICK_BANNED:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
user.setNPC(false);
|
||||
|
||||
@@ -194,7 +200,7 @@ public class EssentialsPlayerListener implements Listener
|
||||
user.checkMuteTimeout(currentTime);
|
||||
user.checkJailTimeout(currentTime);
|
||||
|
||||
if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
|
||||
if (!banExpired && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
|
||||
{
|
||||
final String banReason = user.getBanReason();
|
||||
event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : _("defaultBanReason"));
|
||||
@@ -233,18 +239,13 @@ public class EssentialsPlayerListener implements Listener
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
//There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports.
|
||||
if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener())
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
user.setLastLocation();
|
||||
}
|
||||
|
||||
if (ess.getSettings().changeDisplayName())
|
||||
{
|
||||
user.setDisplayNick();
|
||||
}
|
||||
updateCompass(user);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@@ -277,51 +278,6 @@ public class EssentialsPlayerListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerAnimation(final PlayerAnimationEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
user.updateActivity(true);
|
||||
if (event.getAnimationType() == PlayerAnimationType.ARM_SWING
|
||||
&& user.hasPowerTools() && user.arePowerToolsEnabled())
|
||||
{
|
||||
usePowertools(user);
|
||||
}
|
||||
}
|
||||
|
||||
private void usePowertools(final User user)
|
||||
{
|
||||
final ItemStack is = user.getItemInHand();
|
||||
int id;
|
||||
if (is == null || (id = is.getTypeId()) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final List<String> commandList = user.getPowertool(id);
|
||||
if (commandList == null || commandList.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// We need to loop through each command and execute
|
||||
for (String command : commandList)
|
||||
{
|
||||
if (command.matches(".*\\{player\\}.*"))
|
||||
{
|
||||
//user.sendMessage("Click a player to use this command");
|
||||
continue;
|
||||
}
|
||||
else if (command.startsWith("c:"))
|
||||
{
|
||||
user.chat(command.substring(2));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.getServer().dispatchCommand(user.getBase(), command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
@@ -336,7 +292,7 @@ public class EssentialsPlayerListener implements Listener
|
||||
{
|
||||
for (Player player : ess.getServer().getOnlinePlayers())
|
||||
{
|
||||
User spyer = ess.getUser(player);
|
||||
final User spyer = ess.getUser(player);
|
||||
if (spyer.isSocialSpyEnabled() && !user.equals(spyer))
|
||||
{
|
||||
player.sendMessage(user.getDisplayName() + " : " + event.getMessage());
|
||||
@@ -352,9 +308,15 @@ public class EssentialsPlayerListener implements Listener
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerChangedWorld(final PlayerChangedWorldEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
if (ess.getSettings().changeDisplayName())
|
||||
{
|
||||
user.setDisplayNick();
|
||||
}
|
||||
updateCompass(user);
|
||||
|
||||
if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName()))
|
||||
{
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
if (user.isGodModeEnabledRaw())
|
||||
{
|
||||
user.sendMessage(_("noGodWorldWarning"));
|
||||
@@ -362,26 +324,84 @@ public class EssentialsPlayerListener implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
user.updateActivity(true);
|
||||
switch (event.getAction())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK)
|
||||
{
|
||||
event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation());
|
||||
case RIGHT_CLICK_BLOCK:
|
||||
if (event.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK)
|
||||
{
|
||||
event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation());
|
||||
}
|
||||
break;
|
||||
case LEFT_CLICK_AIR:
|
||||
case LEFT_CLICK_BLOCK:
|
||||
if (user.hasPowerTools() && user.arePowerToolsEnabled())
|
||||
{
|
||||
if (usePowertools(user))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean usePowertools(final User user)
|
||||
{
|
||||
final ItemStack is = user.getItemInHand();
|
||||
int id;
|
||||
if (is == null || (id = is.getTypeId()) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final List<String> commandList = user.getPowertool(id);
|
||||
if (commandList == null || commandList.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
boolean used = false;
|
||||
// We need to loop through each command and execute
|
||||
for (final String command : commandList)
|
||||
{
|
||||
if (command.matches(".*\\{player\\}.*"))
|
||||
{
|
||||
//user.sendMessage("Click a player to use this command");
|
||||
continue;
|
||||
}
|
||||
else if (command.startsWith("c:"))
|
||||
{
|
||||
used = true;
|
||||
user.chat(command.substring(2));
|
||||
}
|
||||
else
|
||||
{
|
||||
used = true;
|
||||
ess.scheduleSyncDelayedTask(
|
||||
new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
user.getServer().dispatchCommand(user.getBase(), command);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return used;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerPickupItem(PlayerPickupItemEvent event)
|
||||
public void onPlayerPickupItem(final PlayerPickupItemEvent event)
|
||||
{
|
||||
if (event.isCancelled() || !ess.getSettings().getDisableItemPickupWhileAfk())
|
||||
{
|
||||
|
||||
@@ -271,18 +271,18 @@ public class EssentialsUpgrade
|
||||
if (config.hasProperty("powertools"))
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
final Map<Integer, Object> powertools = (Map<Integer, Object>)config.getProperty("powertools");
|
||||
final Map<String, Object> powertools = config.getConfigurationSection("powertools").getValues(false);
|
||||
if (powertools == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (Map.Entry<Integer, Object> entry : powertools.entrySet())
|
||||
for (Map.Entry<String, Object> entry : powertools.entrySet())
|
||||
{
|
||||
if (entry.getValue() instanceof String)
|
||||
{
|
||||
List<String> temp = new ArrayList<String>();
|
||||
temp.add((String)entry.getValue());
|
||||
((Map<Integer, Object>)powertools).put(entry.getKey(), temp);
|
||||
((Map<String, Object>)powertools).put(entry.getKey(), temp);
|
||||
}
|
||||
}
|
||||
config.save();
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated This will be moved to the api package soon
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
|
||||
@@ -19,6 +20,8 @@ public interface ISettings extends IConf
|
||||
|
||||
boolean getAnnounceNewPlayers();
|
||||
|
||||
String getNewPlayerKit();
|
||||
|
||||
String getBackupCommand();
|
||||
|
||||
long getBackupInterval();
|
||||
@@ -39,9 +42,9 @@ public interface ISettings extends IConf
|
||||
|
||||
double getHealCooldown();
|
||||
|
||||
Object getKit(String name);
|
||||
Map<String, Object> getKit(String name);
|
||||
|
||||
Map<String, Object> getKits();
|
||||
ConfigurationSection getKits();
|
||||
|
||||
String getLocale();
|
||||
|
||||
@@ -115,8 +118,12 @@ public interface ISettings extends IConf
|
||||
|
||||
double getMaxMoney();
|
||||
|
||||
double getMinMoney();
|
||||
|
||||
boolean isEcoLogEnabled();
|
||||
|
||||
boolean isEcoLogUpdateEnabled();
|
||||
|
||||
boolean removeGodOnDisconnect();
|
||||
|
||||
boolean changeDisplayName();
|
||||
|
||||
@@ -32,6 +32,8 @@ public interface IUser extends Player
|
||||
void takeMoney(double value);
|
||||
|
||||
void giveMoney(double value);
|
||||
|
||||
boolean canAfford(double value);
|
||||
|
||||
String getGroup();
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -246,7 +246,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
user.sendMessage(_("jailMessage"));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import static com.earth2me.essentials.I18n.capitalCase;
|
||||
import com.earth2me.essentials.commands.NoChargeException;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import java.util.*;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
@@ -15,16 +17,16 @@ public class Kit
|
||||
{
|
||||
try
|
||||
{
|
||||
final Map<String, Object> kits = ess.getSettings().getKits();
|
||||
final ConfigurationSection kits = ess.getSettings().getKits();
|
||||
final StringBuilder list = new StringBuilder();
|
||||
for (String kiteItem : kits.keySet())
|
||||
for (String kiteItem : kits.getKeys(false))
|
||||
{
|
||||
if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
list.append(" ").append(kiteItem);
|
||||
list.append(" ").append(capitalCase(kiteItem));
|
||||
}
|
||||
}
|
||||
return list.toString();
|
||||
return list.toString().trim();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -59,11 +61,16 @@ public class Kit
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getItems(final User user, final Map<String, Object> els) throws Exception
|
||||
public static List<String> getItems(final User user, final Map<String, Object> kit) throws Exception
|
||||
{
|
||||
if (kit == null)
|
||||
{
|
||||
throw new Exception(_("kitError2"));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (List<String>)els.get("items");
|
||||
return (List<String>)kit.get("items");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -9,40 +10,40 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public enum Mob
|
||||
{
|
||||
CHICKEN("Chicken", Enemies.FRIENDLY, CreatureType.CHICKEN),
|
||||
COW("Cow", Enemies.FRIENDLY, CreatureType.COW),
|
||||
CREEPER("Creeper", Enemies.ENEMY, CreatureType.CREEPER),
|
||||
GHAST("Ghast", Enemies.ENEMY, CreatureType.GHAST),
|
||||
GIANT("Giant", Enemies.ENEMY, CreatureType.GIANT),
|
||||
PIG("Pig", Enemies.FRIENDLY, CreatureType.PIG),
|
||||
PIGZOMB("PigZombie", Enemies.NEUTRAL, CreatureType.PIG_ZOMBIE),
|
||||
SHEEP("Sheep", Enemies.FRIENDLY, "", CreatureType.SHEEP),
|
||||
SKELETON("Skeleton", Enemies.ENEMY, CreatureType.SKELETON),
|
||||
SLIME("Slime", Enemies.ENEMY, CreatureType.SLIME),
|
||||
SPIDER("Spider", Enemies.ENEMY, CreatureType.SPIDER),
|
||||
SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID),
|
||||
ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE),
|
||||
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF),
|
||||
CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER),
|
||||
ENDERMAN("Enderman", Enemies.ENEMY, "", CreatureType.ENDERMAN),
|
||||
SILVERFISH("Silverfish", Enemies.ENEMY, "", CreatureType.SILVERFISH),
|
||||
ENDERDRAGON("EnderDragon", Enemies.ENEMY, CreatureType.ENDER_DRAGON),
|
||||
VILLAGER("Villager", Enemies.FRIENDLY, CreatureType.VILLAGER),
|
||||
BLAZE("Blaze", Enemies.ENEMY, CreatureType.BLAZE),
|
||||
MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, CreatureType.MUSHROOM_COW),
|
||||
MAGMACUBE("MagmaCube", Enemies.ENEMY, CreatureType.MAGMA_CUBE),
|
||||
SNOWMAN("Snowman", Enemies.FRIENDLY, "", CreatureType.SNOWMAN);
|
||||
CHICKEN("Chicken", Enemies.FRIENDLY, EntityType.CHICKEN),
|
||||
COW("Cow", Enemies.FRIENDLY, EntityType.COW),
|
||||
CREEPER("Creeper", Enemies.ENEMY, EntityType.CREEPER),
|
||||
GHAST("Ghast", Enemies.ENEMY, EntityType.GHAST),
|
||||
GIANT("Giant", Enemies.ENEMY, EntityType.GIANT),
|
||||
PIG("Pig", Enemies.FRIENDLY, EntityType.PIG),
|
||||
PIGZOMB("PigZombie", Enemies.NEUTRAL, EntityType.PIG_ZOMBIE),
|
||||
SHEEP("Sheep", Enemies.FRIENDLY, "", EntityType.SHEEP),
|
||||
SKELETON("Skeleton", Enemies.ENEMY, EntityType.SKELETON),
|
||||
SLIME("Slime", Enemies.ENEMY, EntityType.SLIME),
|
||||
SPIDER("Spider", Enemies.ENEMY, EntityType.SPIDER),
|
||||
SQUID("Squid", Enemies.FRIENDLY, EntityType.SQUID),
|
||||
ZOMBIE("Zombie", Enemies.ENEMY, EntityType.ZOMBIE),
|
||||
WOLF("Wolf", Enemies.NEUTRAL, EntityType.WOLF),
|
||||
CAVESPIDER("CaveSpider", Enemies.ENEMY, EntityType.CAVE_SPIDER),
|
||||
ENDERMAN("Enderman", Enemies.ENEMY, "", EntityType.ENDERMAN),
|
||||
SILVERFISH("Silverfish", Enemies.ENEMY, "", EntityType.SILVERFISH),
|
||||
ENDERDRAGON("EnderDragon", Enemies.ENEMY, EntityType.ENDER_DRAGON),
|
||||
VILLAGER("Villager", Enemies.FRIENDLY, EntityType.VILLAGER),
|
||||
BLAZE("Blaze", Enemies.ENEMY, EntityType.BLAZE),
|
||||
MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, EntityType.MUSHROOM_COW),
|
||||
MAGMACUBE("MagmaCube", Enemies.ENEMY, EntityType.MAGMA_CUBE),
|
||||
SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN);
|
||||
|
||||
public static final Logger logger = Logger.getLogger("Minecraft");
|
||||
|
||||
private Mob(String n, Enemies en, String s, CreatureType type)
|
||||
private Mob(String n, Enemies en, String s, EntityType type)
|
||||
{
|
||||
this.suffix = s;
|
||||
this.name = n;
|
||||
@@ -50,7 +51,7 @@ public enum Mob
|
||||
this.bukkitType = type;
|
||||
}
|
||||
|
||||
private Mob(String n, Enemies en, CreatureType type)
|
||||
private Mob(String n, Enemies en, EntityType type)
|
||||
{
|
||||
this.name = n;
|
||||
this.type = en;
|
||||
@@ -59,7 +60,7 @@ public enum Mob
|
||||
public String suffix = "s";
|
||||
final public String name;
|
||||
final public Enemies type;
|
||||
final private CreatureType bukkitType;
|
||||
final private EntityType bukkitType;
|
||||
private static final Map<String, Mob> hashMap = new HashMap<String, Mob>();
|
||||
|
||||
static
|
||||
@@ -71,7 +72,7 @@ public enum Mob
|
||||
}
|
||||
|
||||
public static Set<String> getMobList() {
|
||||
return hashMap.keySet();
|
||||
return Collections.unmodifiableSet(hashMap.keySet());
|
||||
}
|
||||
|
||||
public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException
|
||||
@@ -99,7 +100,7 @@ public enum Mob
|
||||
final protected String type;
|
||||
}
|
||||
|
||||
public CreatureType getType()
|
||||
public EntityType getType()
|
||||
{
|
||||
return bukkitType;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.craftbukkit.OfflineBedLocation;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.*;
|
||||
import lombok.Delegate;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.conversations.Conversation;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.InventoryView.Property;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
@@ -172,11 +176,6 @@ public class OfflinePlayer implements Player
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isPlayer()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRemainingAir()
|
||||
{
|
||||
@@ -901,4 +900,131 @@ public class OfflinePlayer implements Player
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Projectile> T launchProjectile(Class<? extends T> arg0)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getType()
|
||||
{
|
||||
return EntityType.PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location lctn, Effect effect, T t)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setWindowProperty(Property prprt, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryView getOpenInventory()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryView openInventory(Inventory invntr)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryView openWorkbench(Location lctn, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryView openEnchanting(Location lctn, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(InventoryView iv)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemOnCursor()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemOnCursor(ItemStack is)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetadata(String string, MetadataValue mv)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MetadataValue> getMetadata(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMetadata(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMetadata(String string, Plugin plugin)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isConversing()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptConversationInput(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean beginConversation(Conversation c)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abandonConversation(Conversation c)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(String[] strings)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,15 @@ import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import com.earth2me.essentials.signs.EssentialsSign;
|
||||
import com.earth2me.essentials.signs.Signs;
|
||||
import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.SimpleTextInput;
|
||||
import com.earth2me.essentials.textreader.SimpleTextPager;
|
||||
import java.io.File;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.MemoryConfiguration;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@@ -209,25 +209,45 @@ public class Settings implements ISettings
|
||||
{
|
||||
return config.getDouble("heal-cooldown", 0);
|
||||
}
|
||||
private ConfigurationSection kits;
|
||||
|
||||
@Override
|
||||
public Object getKit(String name)
|
||||
public ConfigurationSection _getKits()
|
||||
{
|
||||
Map<String, Object> kits = (Map<String, Object>)config.get("kits");
|
||||
for (Map.Entry<String, Object> entry : kits.entrySet())
|
||||
if (config.isConfigurationSection("kits"))
|
||||
{
|
||||
if (entry.getKey().equalsIgnoreCase(name.replace('.', '_').replace('/', '_')))
|
||||
final ConfigurationSection section = config.getConfigurationSection("kits");
|
||||
final ConfigurationSection newSection = new MemoryConfiguration();
|
||||
for (String kitItem : section.getKeys(false))
|
||||
{
|
||||
return entry.getValue();
|
||||
if (section.isConfigurationSection(kitItem))
|
||||
{
|
||||
newSection.set(kitItem.toLowerCase(Locale.ENGLISH), section.getConfigurationSection(kitItem));
|
||||
}
|
||||
}
|
||||
return newSection;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getKits()
|
||||
public ConfigurationSection getKits()
|
||||
{
|
||||
return (Map<String, Object>)config.get("kits");
|
||||
return kits;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getKit(String name)
|
||||
{
|
||||
name = name.replace('.', '_').replace('/', '_');
|
||||
if (config.isConfigurationSection("kits"))
|
||||
{
|
||||
final ConfigurationSection kits = getKits();
|
||||
if (kits.isConfigurationSection(name))
|
||||
{
|
||||
return kits.getConfigurationSection(name).getValues(true);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -328,7 +348,13 @@ public class Settings implements ISettings
|
||||
@Override
|
||||
public IText getAnnounceNewPlayerFormat()
|
||||
{
|
||||
return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!")));
|
||||
return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNewPlayerKit()
|
||||
{
|
||||
return config.getString("newbies.kit", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -354,8 +380,9 @@ public class Settings implements ISettings
|
||||
{
|
||||
config.load();
|
||||
noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds"));
|
||||
enabledSigns = getEnabledSigns();
|
||||
itemSpawnBl = getItemSpawnBlacklist();
|
||||
enabledSigns = _getEnabledSigns();
|
||||
itemSpawnBl = _getItemSpawnBlacklist();
|
||||
kits = _getKits();
|
||||
chatFormats.clear();
|
||||
}
|
||||
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
|
||||
@@ -366,7 +393,7 @@ public class Settings implements ISettings
|
||||
return itemSpawnBl;
|
||||
}
|
||||
|
||||
private List<Integer> getItemSpawnBlacklist()
|
||||
private List<Integer> _getItemSpawnBlacklist()
|
||||
{
|
||||
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
||||
if (ess.getItemDb() == null)
|
||||
@@ -401,7 +428,7 @@ public class Settings implements ISettings
|
||||
return enabledSigns;
|
||||
}
|
||||
|
||||
private List<EssentialsSign> getEnabledSigns()
|
||||
private List<EssentialsSign> _getEnabledSigns()
|
||||
{
|
||||
List<EssentialsSign> newSigns = new ArrayList<EssentialsSign>();
|
||||
|
||||
@@ -533,6 +560,22 @@ public class Settings implements ISettings
|
||||
}
|
||||
return max;
|
||||
}
|
||||
private final static double MINMONEY = -10000000000000.0;
|
||||
|
||||
@Override
|
||||
public double getMinMoney()
|
||||
{
|
||||
double min = config.getDouble("min-money", MINMONEY);
|
||||
if (min > 0)
|
||||
{
|
||||
min = -min;
|
||||
}
|
||||
if (min < MINMONEY)
|
||||
{
|
||||
min = MINMONEY;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEcoLogEnabled()
|
||||
@@ -540,6 +583,12 @@ public class Settings implements ISettings
|
||||
return config.getBoolean("economy-log-enabled", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEcoLogUpdateEnabled()
|
||||
{
|
||||
return config.getBoolean("economy-log-update-enabled", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeGodOnDisconnect()
|
||||
{
|
||||
|
||||
@@ -143,8 +143,7 @@ public class Trade
|
||||
{
|
||||
if (getMoney() != null)
|
||||
{
|
||||
final double mon = user.getMoney();
|
||||
if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan"))
|
||||
if (!user.canAfford(getMoney()) && getMoney() > 0)
|
||||
{
|
||||
throw new ChargeException(_("notEnoughMoney"));
|
||||
}
|
||||
@@ -163,9 +162,8 @@ public class Trade
|
||||
&& !user.isAuthorized("essentials.nocommandcost.all")
|
||||
&& !user.isAuthorized("essentials.nocommandcost." + command))
|
||||
{
|
||||
final double mon = user.getMoney();
|
||||
final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
|
||||
if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan"))
|
||||
if (!user.canAfford(cost) && cost > 0)
|
||||
{
|
||||
throw new ChargeException(_("notEnoughMoney"));
|
||||
}
|
||||
@@ -200,7 +198,8 @@ public class Trade
|
||||
|
||||
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
|
||||
{
|
||||
if (!ess.getSettings().isEcoLogEnabled())
|
||||
if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled())
|
||||
|| (loc != null && !ess.getSettings().isEcoLogEnabled()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -106,10 +105,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
return;
|
||||
}
|
||||
setMoney(getMoney() + value);
|
||||
sendMessage(_("addedToAccount", Util.formatCurrency(value, ess)));
|
||||
sendMessage(_("addedToAccount", Util.displayCurrency(value, ess)));
|
||||
if (initiator != null)
|
||||
{
|
||||
initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
|
||||
initiator.sendMessage(_("addedToOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName(), Util.displayCurrency(getMoney(), ess)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,8 +122,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
setMoney(getMoney() - value);
|
||||
reciever.setMoney(reciever.getMoney() + value);
|
||||
sendMessage(_("moneySentTo", Util.formatCurrency(value, ess), reciever.getDisplayName()));
|
||||
reciever.sendMessage(_("moneyRecievedFrom", Util.formatCurrency(value, ess), getDisplayName()));
|
||||
sendMessage(_("moneySentTo", Util.displayCurrency(value, ess), reciever.getDisplayName()));
|
||||
reciever.sendMessage(_("moneyRecievedFrom", Util.displayCurrency(value, ess), getDisplayName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -145,17 +144,26 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
return;
|
||||
}
|
||||
setMoney(getMoney() - value);
|
||||
sendMessage(_("takenFromAccount", Util.formatCurrency(value, ess)));
|
||||
sendMessage(_("takenFromAccount", Util.displayCurrency(value, ess)));
|
||||
if (initiator != null)
|
||||
{
|
||||
initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
|
||||
initiator.sendMessage(_("takenFromOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName(), Util.displayCurrency(getMoney(), ess)));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canAfford(final double cost)
|
||||
{
|
||||
return canAfford(cost, true);
|
||||
}
|
||||
|
||||
public boolean canAfford(final double cost, final boolean permcheck)
|
||||
{
|
||||
final double mon = getMoney();
|
||||
return mon >= cost || isAuthorized("essentials.eco.loan");
|
||||
if (!permcheck || isAuthorized("essentials.eco.loan"))
|
||||
{
|
||||
return (mon - cost) >= ess.getSettings().getMinMoney();
|
||||
}
|
||||
return cost <= mon;
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
@@ -241,7 +249,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
return teleportRequestHere;
|
||||
}
|
||||
|
||||
public String getNick(boolean addprefixsuffix)
|
||||
public String getNick(final boolean addprefixsuffix)
|
||||
{
|
||||
final StringBuilder nickname = new StringBuilder();
|
||||
final String nick = getNickname();
|
||||
@@ -253,28 +261,31 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
nickname.append(ess.getSettings().getNicknamePrefix()).append(nick);
|
||||
}
|
||||
if (isOp())
|
||||
|
||||
if (addprefixsuffix && isOp())
|
||||
{
|
||||
try
|
||||
{
|
||||
nickname.insert(0, ess.getSettings().getOperatorColor().toString());
|
||||
nickname.append("§f");
|
||||
final String opPrefix = ess.getSettings().getOperatorColor().toString();
|
||||
if (opPrefix.length() > 0) {
|
||||
nickname.insert(0, opPrefix);
|
||||
nickname.append("§f");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (addprefixsuffix && ess.getSettings().addPrefixSuffix())
|
||||
{
|
||||
if (!ess.getSettings().disablePrefix())
|
||||
{
|
||||
final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§');
|
||||
nickname.insert(0, prefix);
|
||||
}
|
||||
if (!ess.getSettings().disableSuffix())
|
||||
{
|
||||
final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
|
||||
final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§');
|
||||
nickname.append(suffix);
|
||||
if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
|
||||
{
|
||||
@@ -322,6 +333,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
return super.getDisplayName() == null ? super.getName() : super.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Teleport getTeleport()
|
||||
{
|
||||
return teleport;
|
||||
@@ -379,6 +391,15 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
}
|
||||
super.setMoney(value);
|
||||
Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess);
|
||||
}
|
||||
|
||||
public void updateMoneyCache(final double value)
|
||||
{
|
||||
if (ess.getPaymentMethod().hasMethod() && super.getMoney() != value)
|
||||
{
|
||||
super.setMoney(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
savedInventory = _getSavedInventory();
|
||||
teleportEnabled = getTeleportEnabled();
|
||||
ignoredPlayers = getIgnoredPlayers();
|
||||
godmode = getGodModeEnabled();
|
||||
godmode = _getGodModeEnabled();
|
||||
muted = getMuted();
|
||||
muteTimeout = _getMuteTimeout();
|
||||
jailed = getJailed();
|
||||
@@ -58,6 +58,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
isNPC = _isNPC();
|
||||
arePowerToolsEnabled = _arePowerToolsEnabled();
|
||||
kitTimestamps = _getKitTimestamps();
|
||||
nickname = _getNickname();
|
||||
}
|
||||
private double money;
|
||||
|
||||
@@ -94,17 +95,11 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
private Map<String, Object> _getHomes()
|
||||
{
|
||||
Object o = config.getProperty("homes");
|
||||
|
||||
if (o instanceof Map)
|
||||
if (config.isConfigurationSection("homes"))
|
||||
{
|
||||
return (Map<String, Object>)o;
|
||||
return config.getConfigurationSection("homes").getValues(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
return new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
public Location getHome(String name) throws Exception
|
||||
@@ -195,13 +190,21 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getNickname()
|
||||
private String nickname;
|
||||
|
||||
public String _getNickname()
|
||||
{
|
||||
return config.getString("nickname");
|
||||
}
|
||||
|
||||
public String getNickname()
|
||||
{
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nick)
|
||||
{
|
||||
nickname = nick;
|
||||
config.setProperty("nickname", nick);
|
||||
config.save();
|
||||
}
|
||||
@@ -235,22 +238,15 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("unlimited", unlimited);
|
||||
config.save();
|
||||
}
|
||||
private Map<Integer, Object> powertools;
|
||||
private Map<String, Object> powertools;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<Integer, Object> _getPowertools()
|
||||
private Map<String, Object> _getPowertools()
|
||||
{
|
||||
Object o = config.getProperty("powertools");
|
||||
|
||||
if (o instanceof Map)
|
||||
if (config.isConfigurationSection("powertools"))
|
||||
{
|
||||
return (Map<Integer, Object>)o;
|
||||
return config.getConfigurationSection("powertools").getValues(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HashMap<Integer, Object>();
|
||||
}
|
||||
|
||||
return new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
public void clearAllPowertools()
|
||||
@@ -262,23 +258,23 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
public List<String> getPowertool(ItemStack stack)
|
||||
{
|
||||
return (List<String>)powertools.get(stack.getTypeId());
|
||||
return (List<String>)powertools.get("" + stack.getTypeId());
|
||||
}
|
||||
|
||||
|
||||
public List<String> getPowertool(int id)
|
||||
{
|
||||
return (List<String>)powertools.get(id);
|
||||
return (List<String>)powertools.get("" + id);
|
||||
}
|
||||
|
||||
public void setPowertool(ItemStack stack, List<String> commandList)
|
||||
{
|
||||
if (commandList == null || commandList.isEmpty())
|
||||
{
|
||||
powertools.remove(stack.getTypeId());
|
||||
powertools.remove("" + stack.getTypeId());
|
||||
}
|
||||
else
|
||||
{
|
||||
powertools.put(stack.getTypeId(), commandList);
|
||||
powertools.put("" + stack.getTypeId(), commandList);
|
||||
}
|
||||
config.setProperty("powertools", powertools);
|
||||
config.save();
|
||||
@@ -528,7 +524,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
}
|
||||
private boolean godmode;
|
||||
|
||||
private boolean getGodModeEnabled()
|
||||
private boolean _getGodModeEnabled()
|
||||
{
|
||||
return config.getBoolean("godmode", false);
|
||||
}
|
||||
@@ -739,7 +735,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
return ret;
|
||||
}
|
||||
private boolean newplayer;
|
||||
|
||||
private String geolocation;
|
||||
|
||||
private String _getGeoLocation()
|
||||
@@ -831,16 +826,12 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
private Map<String, Object> _getKitTimestamps()
|
||||
{
|
||||
final Object map = config.getProperty("timestamps.kits");
|
||||
|
||||
if (map instanceof Map)
|
||||
if (config.isConfigurationSection("timestamps.kits"))
|
||||
{
|
||||
return (Map<String, Object>)map;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HashMap<String, Object>();
|
||||
return config.getConfigurationSection("timestamps.kits").getValues(false);
|
||||
}
|
||||
return new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
public Long getKitTimestamp(final String name)
|
||||
|
||||
@@ -422,11 +422,11 @@ public class Util
|
||||
}
|
||||
return is;
|
||||
}
|
||||
private static DecimalFormat df = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
||||
private static DecimalFormat dFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
||||
|
||||
public static String formatCurrency(final double value, final IEssentials ess)
|
||||
public static String formatAsCurrency(final double value)
|
||||
{
|
||||
String str = ess.getSettings().getCurrencySymbol() + df.format(value);
|
||||
String str = dFormat.format(value);
|
||||
if (str.endsWith(".00"))
|
||||
{
|
||||
str = str.substring(0, str.length() - 3);
|
||||
@@ -434,6 +434,16 @@ public class Util
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String displayCurrency(final double value, final IEssentials ess)
|
||||
{
|
||||
return _("currency", ess.getSettings().getCurrencySymbol(), formatAsCurrency(value));
|
||||
}
|
||||
|
||||
public static String shortCurrency(final double value, final IEssentials ess)
|
||||
{
|
||||
return ess.getSettings().getCurrencySymbol() + formatAsCurrency(value);
|
||||
}
|
||||
|
||||
public static double roundDouble(final double d)
|
||||
{
|
||||
return Math.round(d * 100.0) / 100.0;
|
||||
|
||||
@@ -115,6 +115,10 @@ public final class Economy
|
||||
{
|
||||
throw new UserDoesNotExistException(name);
|
||||
}
|
||||
if (balance < ess.getSettings().getMinMoney())
|
||||
{
|
||||
throw new NoLoanPermittedException();
|
||||
}
|
||||
if (balance < 0.0 && !user.isAuthorized("essentials.eco.loan"))
|
||||
{
|
||||
throw new NoLoanPermittedException();
|
||||
@@ -245,7 +249,7 @@ public final class Economy
|
||||
{
|
||||
throw new RuntimeException(noCallBeforeLoad);
|
||||
}
|
||||
return Util.formatCurrency(amount, ess);
|
||||
return Util.displayCurrency(amount, ess);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,11 @@ public class Commandantioch extends EssentialsCommand
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
|
||||
ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it.");
|
||||
if (args.length > 0)
|
||||
{
|
||||
ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
|
||||
ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it.");
|
||||
}
|
||||
|
||||
final Location loc = Util.getTarget(user);
|
||||
loc.getWorld().spawn(loc, TNTPrimed.class);
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Commandbalance extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
|
||||
sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,6 +32,6 @@ public class Commandbalance extends EssentialsCommand
|
||||
|| user.isAuthorized("essentials.balance.other"))
|
||||
? user
|
||||
: getPlayer(server, args, 0, true)).getMoney();
|
||||
user.sendMessage(_("balance", Util.formatCurrency(bal, ess)));
|
||||
user.sendMessage(_("balance", Util.displayCurrency(bal, ess)));
|
||||
}
|
||||
}
|
||||
@@ -105,14 +105,18 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
{
|
||||
if (force || cacheage <= System.currentTimeMillis() - CACHETIME)
|
||||
{
|
||||
cache.getLines().clear();
|
||||
cache.getLines().clear();
|
||||
final Map<String, Double> balances = new HashMap<String, Double>();
|
||||
double totalMoney = 0d;
|
||||
for (String u : ess.getUserMap().getAllUniqueUsers())
|
||||
{
|
||||
final User user = ess.getUserMap().getUser(u);
|
||||
if (user != null)
|
||||
{
|
||||
balances.put(user.getDisplayName(), user.getMoney());
|
||||
final double userMoney = user.getMoney();
|
||||
user.updateMoneyCache(userMoney);
|
||||
totalMoney += userMoney;
|
||||
balances.put(user.getDisplayName(), userMoney);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,10 +129,12 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
return -entry1.getValue().compareTo(entry2.getValue());
|
||||
}
|
||||
});
|
||||
|
||||
cache.getLines().add(_("serverTotal", Util.displayCurrency(totalMoney, ess)));
|
||||
int pos = 1;
|
||||
for (Map.Entry<String, Double> entry : sortedEntries)
|
||||
{
|
||||
cache.getLines().add(pos + ". " + entry.getKey() + ", " + Util.formatCurrency(entry.getValue(), ess));
|
||||
cache.getLines().add(pos + ". " + entry.getKey() + ", " + Util.displayCurrency(entry.getValue(), ess));
|
||||
pos++;
|
||||
}
|
||||
cacheage = System.currentTimeMillis();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Server;
|
||||
@@ -33,7 +34,31 @@ public class Commandeco extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException(ex);
|
||||
}
|
||||
|
||||
if (args[1].contentEquals("*"))
|
||||
if (args[1].contentEquals("**"))
|
||||
{
|
||||
for (String sUser : ess.getUserMap().getAllUniqueUsers())
|
||||
{
|
||||
final User player = ess.getUser(sUser);
|
||||
switch (cmd)
|
||||
{
|
||||
case GIVE:
|
||||
player.giveMoney(amount);
|
||||
break;
|
||||
|
||||
case TAKE:
|
||||
if (player.canAfford(amount, false))
|
||||
{
|
||||
player.takeMoney(amount);
|
||||
}
|
||||
break;
|
||||
|
||||
case RESET:
|
||||
player.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args[1].contentEquals("*"))
|
||||
{
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
@@ -45,6 +70,10 @@ public class Commandeco extends EssentialsCommand
|
||||
break;
|
||||
|
||||
case TAKE:
|
||||
if (!player.canAfford(amount, false))
|
||||
{
|
||||
throw new Exception(_("notEnoughMoney"));
|
||||
}
|
||||
player.takeMoney(amount);
|
||||
break;
|
||||
|
||||
@@ -64,6 +93,10 @@ public class Commandeco extends EssentialsCommand
|
||||
break;
|
||||
|
||||
case TAKE:
|
||||
if (!player.canAfford(amount, false))
|
||||
{
|
||||
throw new Exception(_("notEnoughMoney"));
|
||||
}
|
||||
player.takeMoney(amount, sender);
|
||||
break;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
@@ -35,6 +36,10 @@ public class Commandessentials extends EssentialsCommand
|
||||
{
|
||||
run_nya(server, sender, commandLabel, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("moo"))
|
||||
{
|
||||
run_moo(server, sender, commandLabel, args);
|
||||
}
|
||||
else {
|
||||
run_reload(server, sender, commandLabel, args);
|
||||
}
|
||||
@@ -112,7 +117,7 @@ public class Commandessentials extends EssentialsCommand
|
||||
if (loc.getBlock().getTypeId() == 0)
|
||||
{
|
||||
noteBlocks.put(player, loc.getBlock());
|
||||
loc.getBlock().setType(Material.NOTE_BLOCK);
|
||||
player.sendBlockChange(loc, Material.NOTE_BLOCK, (byte)0);
|
||||
}
|
||||
}
|
||||
taskid = ess.scheduleSyncRepeatingTask(new Runnable()
|
||||
@@ -144,7 +149,6 @@ public class Commandessentials extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}, 20, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
private void stopTune()
|
||||
@@ -159,4 +163,12 @@ public class Commandessentials extends EssentialsCommand
|
||||
}
|
||||
noteBlocks.clear();
|
||||
}
|
||||
|
||||
private void run_moo(final Server server, final CommandSender sender, final String command, final String args[])
|
||||
{
|
||||
if(sender instanceof ConsoleCommandSender)
|
||||
sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } );
|
||||
else
|
||||
sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } );
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public class Commandkillall extends EssentialsCommand
|
||||
{
|
||||
if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob)
|
||||
{
|
||||
EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
|
||||
EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
|
||||
ess.getServer().getPluginManager().callEvent(event);
|
||||
entity.remove();
|
||||
numKills++;
|
||||
@@ -135,7 +135,7 @@ public class Commandkillall extends EssentialsCommand
|
||||
{
|
||||
if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime)
|
||||
{
|
||||
EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
|
||||
EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
|
||||
ess.getServer().getPluginManager().callEvent(event);
|
||||
entity.remove();
|
||||
numKills++;
|
||||
@@ -143,14 +143,14 @@ public class Commandkillall extends EssentialsCommand
|
||||
}
|
||||
else if (all)
|
||||
{
|
||||
EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
|
||||
EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
|
||||
ess.getServer().getPluginManager().callEvent(event);
|
||||
entity.remove();
|
||||
numKills++;
|
||||
}
|
||||
else if (entityClass != null && entityClass.isAssignableFrom(entity.getClass()))
|
||||
{
|
||||
EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
|
||||
EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
|
||||
ess.getServer().getPluginManager().callEvent(event);
|
||||
entity.remove();
|
||||
numKills++;
|
||||
|
||||
@@ -32,22 +32,22 @@ public class Commandkit extends EssentialsCommand
|
||||
else
|
||||
{
|
||||
final String kitName = args[0].toLowerCase(Locale.ENGLISH);
|
||||
final Object kit = ess.getSettings().getKit(kitName);
|
||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
||||
|
||||
if (!user.isAuthorized("essentials.kit." + kitName))
|
||||
{
|
||||
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 List<String> items = Kit.getItems(user, kit);
|
||||
|
||||
Kit.checkTime(user, kitName, kit);
|
||||
|
||||
final Trade charge = new Trade("kit-" + kitName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
|
||||
Kit.expandItems(ess, user, items);
|
||||
|
||||
|
||||
charge.charge(user);
|
||||
user.sendMessage(_("kitGive", kitName));
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.*;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -72,7 +73,7 @@ public class Commandlist extends EssentialsCommand
|
||||
for (String group : groups)
|
||||
{
|
||||
final StringBuilder groupString = new StringBuilder();
|
||||
groupString.append(group).append(": ");
|
||||
groupString.append(_("listGroupTag",Util.replaceColor(group)));
|
||||
final List<User> users = sort.get(group);
|
||||
Collections.sort(users);
|
||||
boolean first = true;
|
||||
|
||||
@@ -160,8 +160,8 @@ public class Commandsell extends EssentialsCommand
|
||||
user.updateInventory();
|
||||
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
|
||||
user.giveMoney(worth * amount);
|
||||
user.sendMessage(_("itemSold", Util.formatCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.formatCurrency(worth, ess)));
|
||||
logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess)));
|
||||
user.sendMessage(_("itemSold", Util.displayCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth, ess)));
|
||||
logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth * amount, ess), amount, Util.displayCurrency(worth, ess)));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
|
||||
public class Commandspawner extends EssentialsCommand
|
||||
@@ -54,7 +55,7 @@ public class Commandspawner extends EssentialsCommand
|
||||
}
|
||||
final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess);
|
||||
charge.isAffordableFor(user);
|
||||
((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType());
|
||||
((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType());
|
||||
charge.charge(user);
|
||||
user.sendMessage(_("setSpawner", mob.name));
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@ import com.earth2me.essentials.Mob;
|
||||
import com.earth2me.essentials.Mob.MobException;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
@@ -27,12 +25,13 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
Set<String> availableList = Mob.getMobList();
|
||||
for (String mob : availableList)
|
||||
final Set<String> mobList = Mob.getMobList();
|
||||
final Set<String> availableList = new HashSet<String>();
|
||||
for (String mob : mobList)
|
||||
{
|
||||
if (!user.isAuthorized("essentials.spawnmob." + mob.toLowerCase()))
|
||||
if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase()))
|
||||
{
|
||||
availableList.remove(mob);
|
||||
availableList.add(mob);
|
||||
}
|
||||
}
|
||||
if (availableList.isEmpty())
|
||||
@@ -176,7 +175,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
changeMobData(mobMount.getType(), spawnedMount, mountData, user);
|
||||
}
|
||||
}
|
||||
user.sendMessage(args[1] + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
|
||||
user.sendMessage(mobCount + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
|
||||
}
|
||||
catch (MobException e1)
|
||||
{
|
||||
@@ -197,9 +196,9 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
private void changeMobData(final CreatureType type, final Entity spawned, final String data, final User user) throws Exception
|
||||
private void changeMobData(final EntityType type, final Entity spawned, final String data, final User user) throws Exception
|
||||
{
|
||||
if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE)
|
||||
if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -210,18 +209,18 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
throw new Exception(_("slimeMalformedSize"), e);
|
||||
}
|
||||
}
|
||||
if ((type == CreatureType.SHEEP
|
||||
|| type == CreatureType.COW
|
||||
|| type == CreatureType.MUSHROOM_COW
|
||||
|| type == CreatureType.CHICKEN
|
||||
|| type == CreatureType.PIG
|
||||
|| type == CreatureType.WOLF)
|
||||
if ((type == EntityType.SHEEP
|
||||
|| type == EntityType.COW
|
||||
|| type == EntityType.MUSHROOM_COW
|
||||
|| type == EntityType.CHICKEN
|
||||
|| type == EntityType.PIG
|
||||
|| type == EntityType.WOLF)
|
||||
&& data.equalsIgnoreCase("baby"))
|
||||
{
|
||||
((Animals)spawned).setAge(-24000);
|
||||
return;
|
||||
}
|
||||
if (type == CreatureType.SHEEP)
|
||||
if (type == EntityType.SHEEP)
|
||||
{
|
||||
if (data.toLowerCase(Locale.ENGLISH).contains("baby"))
|
||||
{
|
||||
@@ -246,7 +245,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
throw new Exception(_("sheepMalformedColor"), e);
|
||||
}
|
||||
}
|
||||
if (type == CreatureType.WOLF
|
||||
if (type == EntityType.WOLF
|
||||
&& data.toLowerCase(Locale.ENGLISH).startsWith("tamed"))
|
||||
{
|
||||
final Wolf wolf = ((Wolf)spawned);
|
||||
@@ -258,7 +257,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
((Animals)spawned).setAge(-24000);
|
||||
}
|
||||
}
|
||||
if (type == CreatureType.WOLF
|
||||
if (type == EntityType.WOLF
|
||||
&& data.toLowerCase(Locale.ENGLISH).startsWith("angry"))
|
||||
{
|
||||
((Wolf)spawned).setAngry(true);
|
||||
@@ -267,7 +266,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
((Animals)spawned).setAge(-24000);
|
||||
}
|
||||
}
|
||||
if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered"))
|
||||
if (type == EntityType.CREEPER && data.equalsIgnoreCase("powered"))
|
||||
{
|
||||
((Creeper)spawned).setPowered(true);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
@@ -36,7 +37,7 @@ public class Commandsudo extends EssentialsCommand
|
||||
}
|
||||
|
||||
//TODO: Translate this.
|
||||
sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + arguments);
|
||||
sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + getFinalArg(arguments, 0));
|
||||
|
||||
final PluginCommand execCommand = ess.getServer().getPluginCommand(command);
|
||||
if (execCommand != null)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Commandsuicide extends EssentialsCommand
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
EntityDamageEvent ede = new EntityDamageEvent(user, EntityDamageEvent.DamageCause.SUICIDE, 1000);
|
||||
EntityDamageEvent ede = new EntityDamageEvent(user.getBase(), EntityDamageEvent.DamageCause.SUICIDE, 1000);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
user.damage(1000);
|
||||
user.setHealth(0);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Commandwhois extends EssentialsCommand
|
||||
sender.sendMessage(_("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ()));
|
||||
if (!ess.getSettings().isEcoDisabled())
|
||||
{
|
||||
sender.sendMessage(_("whoisMoney", Util.formatCurrency(user.getMoney(), ess)));
|
||||
sender.sendMessage(_("whoisMoney", Util.displayCurrency(user.getMoney(), ess)));
|
||||
}
|
||||
sender.sendMessage(user.isAfk()
|
||||
? _("whoisStatusAway")
|
||||
|
||||
@@ -51,14 +51,14 @@ public class Commandworth extends EssentialsCommand
|
||||
? _("worthMeta",
|
||||
iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
|
||||
iStack.getDurability(),
|
||||
Util.formatCurrency(worth * amount, ess),
|
||||
Util.displayCurrency(worth * amount, ess),
|
||||
amount,
|
||||
Util.formatCurrency(worth, ess))
|
||||
Util.displayCurrency(worth, ess))
|
||||
: _("worth",
|
||||
iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
|
||||
Util.formatCurrency(worth * amount, ess),
|
||||
Util.displayCurrency(worth * amount, ess),
|
||||
amount,
|
||||
Util.formatCurrency(worth, ess)));
|
||||
Util.displayCurrency(worth, ess)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,14 +95,14 @@ public class Commandworth extends EssentialsCommand
|
||||
? _("worthMeta",
|
||||
iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
|
||||
iStack.getDurability(),
|
||||
Util.formatCurrency(worth * amount, ess),
|
||||
Util.displayCurrency(worth * amount, ess),
|
||||
amount,
|
||||
Util.formatCurrency(worth, ess))
|
||||
Util.displayCurrency(worth, ess))
|
||||
: _("worth",
|
||||
iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
|
||||
Util.formatCurrency(worth * amount, ess),
|
||||
Util.displayCurrency(worth * amount, ess),
|
||||
amount,
|
||||
Util.formatCurrency(worth, ess)));
|
||||
Util.displayCurrency(worth, ess)));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.earth2me.essentials.craftbukkit;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
@@ -187,4 +192,34 @@ public class FakeInventory implements Inventory
|
||||
items[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> getViewers()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryType getType()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder getHolder()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<ItemStack> iterator()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import org.bukkit.entity.*;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@@ -584,4 +585,46 @@ public class FakeWorld implements World
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public LivingEntity spawnCreature(Location arg0, EntityType arg1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location lctn, Effect effect, T t)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> void playEffect(Location lctn, Effect effect, T t, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetadata(String string, MetadataValue mv)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MetadataValue> getMetadata(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMetadata(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMetadata(String string, Plugin plugin)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.earth2me.essentials.craftbukkit;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.IInventory;
|
||||
import net.minecraft.server.PlayerInventory;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class ShowInventory
|
||||
{
|
||||
public static void showEmptyInventory(final Player player)
|
||||
{
|
||||
try
|
||||
{
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle();
|
||||
final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle()));
|
||||
inv.clear();
|
||||
entityPlayer.a((IInventory)inv.getInventory());
|
||||
}
|
||||
catch (Throwable ex)
|
||||
{
|
||||
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void showFilledInventory(final Player player, final ItemStack stack)
|
||||
{
|
||||
try
|
||||
{
|
||||
final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle();
|
||||
final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle()));
|
||||
inv.clear();
|
||||
InventoryWorkaround.addItem(inv, true, stack);
|
||||
entityPlayer.a((IInventory)inv.getInventory());
|
||||
}
|
||||
catch (Throwable ex)
|
||||
{
|
||||
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ public class EssentialsSign
|
||||
final Double money = trade.getMoney();
|
||||
if (money != null)
|
||||
{
|
||||
sign.setLine(index, Util.formatCurrency(money, ess));
|
||||
sign.setLine(index, Util.shortCurrency(money, ess));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.craftbukkit.ShowInventory;
|
||||
|
||||
|
||||
public class SignDisposal extends EssentialsSign
|
||||
@@ -15,7 +14,10 @@ public class SignDisposal extends EssentialsSign
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess)
|
||||
{
|
||||
ShowInventory.showEmptyInventory(player.getBase());
|
||||
player.sendMessage("Bukkit broke this sign :(");
|
||||
//TODO: wait for a fix in bukkit
|
||||
//Problem: Items can be duplicated
|
||||
//player.getBase().openInventory(ess.getServer().createInventory(player, 36));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,10 @@ 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.craftbukkit.ShowInventory;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
@@ -32,8 +34,15 @@ public class SignFree extends EssentialsSign
|
||||
throw new SignException(_("cantSpawnItem", "Air"));
|
||||
}
|
||||
|
||||
item.setAmount(item.getType().getMaxStackSize() * 9 * 4);
|
||||
ShowInventory.showFilledInventory(player.getBase(), item);
|
||||
item.setAmount(item.getType().getMaxStackSize());
|
||||
InventoryWorkaround.addItem(player.getInventory(), true, item);
|
||||
player.sendMessage("Item added to your inventory.");
|
||||
player.updateInventory();
|
||||
//TODO: wait for a fix in bukkit
|
||||
//Problem: Items can be duplicated
|
||||
//Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST);
|
||||
//i.addItem(item);
|
||||
//player.openInventory(i);
|
||||
Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SignKit extends EssentialsSign
|
||||
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())
|
||||
@@ -56,10 +56,9 @@ public class SignKit extends EssentialsSign
|
||||
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);
|
||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
||||
final List<String> items = Kit.getItems(player, kit);
|
||||
Kit.expandItems(ess, player, items);
|
||||
charge.charge(player);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -135,11 +135,11 @@ public class SignTrade extends EssentialsSign
|
||||
final Double money = getMoney(split[0]);
|
||||
if (money != null)
|
||||
{
|
||||
if (Util.formatCurrency(money, ess).length() * 2 > 15)
|
||||
if (Util.shortCurrency(money, ess).length() * 2 > 15)
|
||||
{
|
||||
throw new SignException("Line can be too long!");
|
||||
}
|
||||
sign.setLine(index, Util.formatCurrency(money, ess) + ":0");
|
||||
sign.setLine(index, Util.shortCurrency(money, ess) + ":0");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public class SignTrade extends EssentialsSign
|
||||
{
|
||||
throw new SignException(_("moreThanZero"));
|
||||
}
|
||||
sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount, ess).substring(1));
|
||||
sign.setLine(index, Util.shortCurrency(money, ess) + ":" + Util.shortCurrency(amount, ess).substring(1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public class SignTrade extends EssentialsSign
|
||||
final Double amount = getDouble(split[1]);
|
||||
if (money != null && amount != null)
|
||||
{
|
||||
final String newline = Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount + value, ess).substring(1);
|
||||
final String newline = Util.shortCurrency(money, ess) + ":" + Util.shortCurrency(amount + value, ess).substring(1);
|
||||
if (newline.length() > 15)
|
||||
{
|
||||
throw new SignException("This sign is full: Line too long!");
|
||||
|
||||
@@ -30,9 +30,9 @@ public class HelpInput implements IText
|
||||
try
|
||||
{
|
||||
final PluginDescriptionFile desc = p.getDescription();
|
||||
final HashMap<String, HashMap<String, Object>> cmds = (HashMap<String, HashMap<String, Object>>)desc.getCommands();
|
||||
final Map<String, Map<String, Object>> cmds = desc.getCommands();
|
||||
pluginName = p.getDescription().getName().toLowerCase(Locale.ENGLISH);
|
||||
for (Map.Entry<String, HashMap<String, Object>> k : cmds.entrySet())
|
||||
for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet())
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class HelpInput implements IText
|
||||
{
|
||||
if (ess.getSettings().showNonEssCommandsInHelp())
|
||||
{
|
||||
final HashMap<String, Object> value = k.getValue();
|
||||
final Map<String, Object> value = k.getValue();
|
||||
Object permissions = null;
|
||||
if (value.containsKey(PERMISSION))
|
||||
{
|
||||
|
||||
@@ -196,4 +196,15 @@ public class User extends UserBase implements IUser
|
||||
unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAfford(final double cost)
|
||||
{
|
||||
final double mon = getMoney();
|
||||
if (isAuthorized("essentials.eco.loan"))
|
||||
{
|
||||
return (mon - cost) >= ess.getSettings().getMinMoney();
|
||||
}
|
||||
return cost <= mon;
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,6 @@
|
||||
# - CraftBukkit and Permissions have been updated: CraftBukkit and Essentials almost always line up, but sometimes other plugins fall behind CraftBukkit's multiple daily updates
|
||||
# - You have saved the document as UTF-8, NOT the default, ANSI
|
||||
|
||||
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | Essentials (Global) | #
|
||||
@@ -160,12 +158,19 @@ player-commands:
|
||||
# All kit names should be lower case, and will be treated as lower in permissions/costs.
|
||||
# Times are measured in seconds.
|
||||
kits:
|
||||
tools:
|
||||
dtools:
|
||||
delay: 10
|
||||
items:
|
||||
- 277 1
|
||||
- 278 1
|
||||
- 279 1
|
||||
tools:
|
||||
delay: 10
|
||||
items:
|
||||
- 272 1
|
||||
- 273 1
|
||||
- 274 1
|
||||
- 275 1
|
||||
|
||||
# Essentials Sign Control
|
||||
# See http://ess.khhq.net/wiki/Sign_Tutorial for instructions on how to use these.
|
||||
@@ -281,10 +286,10 @@ spawn-if-no-home: true
|
||||
update-bed-at-daytime: true
|
||||
|
||||
# Allow players to have multiple homes.
|
||||
# Players need essentials.sethome.multiple before they can have more than 1 home, default to 'default' below.
|
||||
# Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip
|
||||
# People with essentials.sethome.multiple.unlimited are not limited by these numbers.
|
||||
sethome-multiple:
|
||||
# essentials.sethome.multiple
|
||||
default: 3
|
||||
# essentials.sethome.multiple.vip
|
||||
vip: 5
|
||||
@@ -321,6 +326,10 @@ currency-symbol: '$'
|
||||
# The amount is always limited to 10 trillions because of the limitations of a java double
|
||||
max-money: 10000000000000
|
||||
|
||||
# Set the minimum amount of money a player can have
|
||||
# Setting this to 0, will disable overdrafts/loans compeltely. Users need 'essentials.eco.loan' perm to go below 0.
|
||||
min-money: -10000000000000
|
||||
|
||||
# Enable this to log all interactions with trade/buy/sell signs and sell command
|
||||
economy-log-enabled: false
|
||||
|
||||
@@ -368,8 +377,6 @@ chat:
|
||||
|
||||
# If your using group formats make sure to remove the '#' to allow the setting to be read.
|
||||
|
||||
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsProtect | #
|
||||
@@ -525,7 +532,6 @@ protect:
|
||||
# Should we tell people they are not allowed to build
|
||||
warn-on-build-disallow: true
|
||||
|
||||
|
||||
# Disable weather options
|
||||
weather:
|
||||
storm: false
|
||||
@@ -548,6 +554,11 @@ newbies:
|
||||
# When we spawn for the first time, which spawnpoint do we use?
|
||||
# Set to "none" if you want to use the spawn point of the world.
|
||||
spawnpoint: newbies
|
||||
|
||||
# Do we want to give users anything on first join? Set to '' to disable
|
||||
# This kit will be given reguardless of cost, and permissions.
|
||||
#kit: ''
|
||||
kit: tools
|
||||
|
||||
# Set this to lowest, if you want Multiverse to handle the respawning
|
||||
# Set this to high, if you want EssentialsSpawn to handle the respawning
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by:
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} has been added to your account.
|
||||
addedToOthersAccount=\u00a7a{0} has been added to {1} account.
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=broke:
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
|
||||
alertPlaced=placed:
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=Could not find template {0}
|
||||
creatingConfigFromTemplate=Creating config from template: {0}
|
||||
creatingEmptyConfig=Creating empty config: {0}
|
||||
creative=creative
|
||||
currency={0}{1}
|
||||
day=day
|
||||
days=days
|
||||
defaultBanReason=The Ban Hammer has spoken!
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77Smiting {0}
|
||||
listAfkTag = \u00a77[AFK]\u00a7f
|
||||
listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Failed to load warp {0}
|
||||
localFormat=Local: <{0}> {1}
|
||||
@@ -294,13 +296,14 @@ requestDenied=\u00a77Teleport request denied.
|
||||
requestDeniedFrom=\u00a77{0} denied your teleport request.
|
||||
requestSent=\u00a77Request sent to {0}\u00a77.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
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://dl.bukkit.org/downloads/craftbukkit/
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=second
|
||||
seconds=seconds
|
||||
seenOffline=Player {0} is offline since {1}
|
||||
seenOnline=Player {0} is online since {1}
|
||||
serverFull=Server is full
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=Changed spawner type to {0}
|
||||
sheepMalformedColor=Malformed color.
|
||||
shoutFormat=\u00a77[Shout]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Goodbye Cruel World...
|
||||
suicideSuccess= \u00a77{0} took their own life
|
||||
survival=survival
|
||||
takenFromAccount=\u00a7c{0} has been taken from your account.
|
||||
takenFromOthersAccount=\u00a7c{0} has been taken from {1} account.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Teleporting request sent to all players...
|
||||
teleportAll=\u00a77Teleporting all players...
|
||||
teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by: Dysp, dysperen@gmail.com
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} er blevet tilf\u00f8jet til din konto.
|
||||
addedToOthersAccount=\u00a7a{0} er blevet tilf\u00f8jet til {1} konto.
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=\u00f8delagde:
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3}
|
||||
alertPlaced=placerede:
|
||||
@@ -15,7 +15,7 @@ backUsageMsg=\u00a77Teleporterer til tidligere placering.
|
||||
backupFinished=Backup sluttet
|
||||
backupStarted=Backup startet
|
||||
balance=\u00a77Saldo: {0}
|
||||
balanceTop=\u00a77 Top saldoer ({0})
|
||||
balanceTop=\u00a77Top saldoer ({0})
|
||||
banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller.
|
||||
banIpAddress=\u00a77Bannede IP addresse
|
||||
bannedIpsFileError=Fejl i afl\u00e6sning af banned-ips.txt
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=Kunne ikke finde skabelon {0}
|
||||
creatingConfigFromTemplate=Opretter config fra skabelon: {0}
|
||||
creatingEmptyConfig=Opretter tom config: {0}
|
||||
creative=creative
|
||||
currency={0}{1}
|
||||
day=dag
|
||||
days=dage
|
||||
defaultBanReason=Banhammeren har talt!
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77Kaster lyn efter {0}
|
||||
listAfkTag = \u00a77[AFK]\u00a7f
|
||||
listAmount = \u00a79Der er \u00a7c{0}\u00a79 ud af maksimum\u00a7c{1}\u00a79 spillere online.
|
||||
listAmountHidden = \u00a79Der er \u00a7c{0}\u00a77/{1}\u00a79 ud af maksimum \u00a7c{2}\u00a79 spillere online.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Kunne ikke l\u00c3\u00a6se warp {0}
|
||||
localFormat=Local: <{0}> {1}
|
||||
@@ -301,6 +303,7 @@ seconds=sekunder
|
||||
seenOffline=Spilleren {0} har v\u00c3\u00a6ret offline i {1}
|
||||
seenOnline=Spilleren {0} har v\u00c3\u00a6ret online i {1}
|
||||
serverFull=Serveren er sgu fuld. Den b\u00c3\u00b8r melde sig til AA.
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=\u00c3\u0086ndrede spawner type til {0}
|
||||
sheepMalformedColor=Forkert farve. (Korrekt oversat?)
|
||||
shoutFormat=\u00a77[Shout]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Farvel grusomme verden...
|
||||
suicideSuccess= \u00a77{0} tog sit eget liv
|
||||
survival=survival
|
||||
takenFromAccount=\u00a7c{0} er blevet taget fra din konto.
|
||||
takenFromOthersAccount=\u00a7c{0} er blevet taget fra {1}''s konto.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere.
|
||||
teleportAll=\u00a77Teleporterer alle spillere...
|
||||
teleportAtoB=\u00a77{0}\u00a77 teleporterede dig til {1}\u00a77.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by:
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt.
|
||||
addedToOthersAccount=\u00a7a{0} wurden zu {1}s Konto hinzugef\u00fcgt.
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=zerst\u00f6rt:
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3}
|
||||
alertPlaced=platziert:
|
||||
@@ -15,7 +15,7 @@ backUsageMsg=\u00a77Kehre zur letzten Position zur\u00fcck.
|
||||
backupFinished=Backup beendet
|
||||
backupStarted=Backup gestartet
|
||||
balance=\u00a77Geldb\u00f6rse: {0}
|
||||
balanceTop=\u00a77 Top Guthaben ({0})
|
||||
balanceTop=\u00a77Top Guthaben ({0})
|
||||
banExempt=\u00a7cDu kannst diesen Spieler nicht sperren.
|
||||
banIpAddress=\u00a77IP-Adresse gesperrt.
|
||||
bannedIpsFileError=Fehler beim Lesen von banned-ips.txt
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=Vorlage {0} konnte nicht gefunden werden.
|
||||
creatingConfigFromTemplate=Erstelle Konfiguration aus Vorlage: {0}
|
||||
creatingEmptyConfig=Erstelle leere Konfiguration: {0}
|
||||
creative=creative
|
||||
currency={0}{1}
|
||||
day=Tag
|
||||
days=Tage
|
||||
defaultBanReason=Der Bann-Hammer hat gesprochen!
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77Peinige {0}
|
||||
listAfkTag = \u00a77[Inaktiv]\u00a7f
|
||||
listAmount = \u00a79Es sind \u00a7c{0}\u00a79 von maximal \u00a7c{1}\u00a79 Spielern online.
|
||||
listAmountHidden = \u00a79Es sind \u00a7c{0}\u00a77/{1}\u00a79 von maximal \u00a7c{2}\u00a79 Spielern online.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[Versteckt]\u00a7f
|
||||
loadWarpError=Fehler beim Laden von Warp-Punkt {0}
|
||||
localFormat=Lokal: <{0}> {1}
|
||||
@@ -301,6 +303,7 @@ seconds=Sekunden
|
||||
seenOffline=Spieler {0} ist offline seit {1}
|
||||
seenOnline=Spieler {0} ist online seit {1}
|
||||
serverFull=Server ist voll
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=\u00c4ndere Mob-Spawner zu {0}
|
||||
sheepMalformedColor=Ung\u00fcltige Farbe.
|
||||
shoutFormat=\u00a77[Schrei]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Lebewohl grausame Welt...
|
||||
suicideSuccess= \u00a77{0} hat sich das Leben genommen.
|
||||
survival=survival
|
||||
takenFromAccount=\u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen.
|
||||
takenFromOthersAccount=\u00a7c{0} wurde von {1} wurde Rechnung getragen.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet...
|
||||
teleportAll=\u00a77Teleportiere alle Spieler...
|
||||
teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by:
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} has been added to your account.
|
||||
addedToOthersAccount=\u00a7a{0} has been added to {1} account.
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=broke:
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
|
||||
alertPlaced=placed:
|
||||
@@ -15,7 +15,7 @@ backUsageMsg=\u00a77Returning to previous location.
|
||||
backupFinished=Backup finished
|
||||
backupStarted=Backup started
|
||||
balance=\u00a77Balance: {0}
|
||||
balanceTop=\u00a77 Top balances ({0})
|
||||
balanceTop=\u00a77Top balances ({0})
|
||||
banExempt=\u00a7cYou can not ban that player.
|
||||
banIpAddress=\u00a77Banned IP address
|
||||
bannedIpsFileError=Error reading banned-ips.txt
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=Could not find template {0}
|
||||
creatingConfigFromTemplate=Creating config from template: {0}
|
||||
creatingEmptyConfig=Creating empty config: {0}
|
||||
creative=creative
|
||||
currency={0}{1}
|
||||
day=day
|
||||
days=days
|
||||
defaultBanReason=The Ban Hammer has spoken!
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77Smiting {0}
|
||||
listAfkTag = \u00a77[AFK]\u00a7f
|
||||
listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Failed to load warp {0}
|
||||
localFormat=Local: <{0}> {1}
|
||||
@@ -301,6 +303,7 @@ seconds=seconds
|
||||
seenOffline=Player {0} is offline since {1}
|
||||
seenOnline=Player {0} is online since {1}
|
||||
serverFull=Server is full
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=Changed spawner type to {0}
|
||||
sheepMalformedColor=Malformed color.
|
||||
shoutFormat=\u00a77[Shout]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Goodbye Cruel World...
|
||||
suicideSuccess= \u00a77{0} took their own life
|
||||
survival=survival
|
||||
takenFromAccount=\u00a7c{0} has been taken from your account.
|
||||
takenFromOthersAccount=\u00a7c{0} has been taken from {1} account.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Teleporting request sent to all players...
|
||||
teleportAll=\u00a77Teleporting all players...
|
||||
teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by:
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} ha sido agregado a tu cuenta.
|
||||
addedToOthersAccount=\u00a7a{0} ha sido agregado a la cuenta de {1}.
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=roto:
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3}
|
||||
alertPlaced=situado:
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=No se puede encontrar el template {0}
|
||||
creatingConfigFromTemplate=Creando configuracion desde el template: {0}
|
||||
creatingEmptyConfig=Creando configuracion vacia: {0}
|
||||
creative=creative
|
||||
currency={0}{1}
|
||||
day=dia
|
||||
days=dias
|
||||
defaultBanReason=Baneado por incumplir las normas!
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77Golpeando a {0}
|
||||
listAfkTag = \u00a77[AFK]\u00a7f
|
||||
listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Error al cargar el tenetransporte {0}
|
||||
localFormat=Local: <{0}> {1}
|
||||
@@ -301,6 +303,7 @@ seconds=segundos
|
||||
seenOffline=El jugador {0} esta desconectado desde {1}
|
||||
seenOnline=El jugador {0} lleva conectado desde {1}
|
||||
serverFull=Servidor lleno
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=Cambiado tipo de lugar de nacimiento a {0}
|
||||
sheepMalformedColor=Color malformado.
|
||||
shoutFormat=\u00a77[Shout]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Adios mundo cruel...
|
||||
suicideSuccess= \u00a77{0} se quito su propia vida
|
||||
survival=survival
|
||||
takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta.
|
||||
takenFromOthersAccount=\u00a7c{0} ha sido sacado de la cuenta de {1}.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores...
|
||||
teleportAll=\u00a77Teletransportando a todos los jugadores...
|
||||
teleportAtoB=\u00a77{0}\u00a77 te teletransporto a {1}\u00a77.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by: L\u00e9a Gris
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 \u00e0 votre compte.
|
||||
addedToOthersAccount=\u00a7a{0} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte.
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=a cass\u00e9 :
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
|
||||
alertPlaced=a plac\u00e9 :
|
||||
@@ -15,7 +15,7 @@ backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent.
|
||||
backupFinished=Sauvegarde termin\u00e9
|
||||
backupStarted=D\u00e9but de la sauvegarde...
|
||||
balance=\u00a77Solde : {0}
|
||||
balanceTop=\u00a77 Meilleurs soldes au ({0})
|
||||
balanceTop=\u00a77Meilleurs soldes au ({0})
|
||||
banExempt=\u00a77Vous ne pouvez pas bannir ce joueur.
|
||||
banIpAddress=\u00a77Adresse IP bannie.
|
||||
bannedIpsFileError=Erreur de lecture de banned-ips.txt
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=Le mod\u00c3\u00a8le {0} est introuvable
|
||||
creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00c3\u00a8le : {0}
|
||||
creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0}
|
||||
creative=cr\u00e9atif
|
||||
currency={0}{1}
|
||||
day=jour
|
||||
days=jours
|
||||
defaultBanReason=Le marteau du bannissement a frapp\u00e9 !
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9.
|
||||
listAfkTag = \u00a77[AFK]\u00a7f
|
||||
listAmount = \u00a79Il y a \u00a7c{0}\u00a79 joueurs en ligne sur \u00a7c{1}\u00a79 au total.
|
||||
listAmountHidden = \u00a79Il y a \u00a7c{0}\u00a77/{1}\u00a79 sur un maximum de \u00a7c{2}\u00a79 joueurs en ligne.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[MASQU\u00c9]\u00a7f
|
||||
loadWarpError=\u00c9chec du chargement du point de t\u00e9l\u00e9portation {0}.
|
||||
localFormat=Locale : <{0}> {1}
|
||||
@@ -301,6 +303,7 @@ seconds=secondes
|
||||
seenOffline=Le joueur {0} est hors ligne depuis {1}
|
||||
seenOnline=Le joueur {0} est en ligne depuis {1}
|
||||
serverFull=Le serveur est plein.
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=Type de g\u00e9n\u00e9rateur chang\u00e9 en {0}
|
||||
sheepMalformedColor=Couleur mal form\u00e9e.
|
||||
shoutFormat=\u00a77[Crie]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Au revoir monde cruel...
|
||||
suicideSuccess=\u00a77{0} s''est suicid\u00e9.
|
||||
survival=survie
|
||||
takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte.
|
||||
takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 r\u00e9tir\u00e9 du compte de {1}.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs...
|
||||
teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs.
|
||||
teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# by: Geertje123
|
||||
action=* {0} {1}
|
||||
addedToAccount=\u00a7a{0} is gestort op je account.
|
||||
addedToOthersAccount=\u00a7a{0} is overgemaakt naar {1}''s rekening
|
||||
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
|
||||
alertBroke=gebroken:
|
||||
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3}
|
||||
alertPlaced=geplaatst:
|
||||
@@ -49,6 +49,7 @@ couldNotFindTemplate=Het sjabloon kon niet worden gevonden {0}
|
||||
creatingConfigFromTemplate=Bezig met aanmaken van een config vanaf sjabloon: {0}
|
||||
creatingEmptyConfig=Bezig met een lege config aanmaken: {0}
|
||||
creative=creative
|
||||
currency={0}{1}
|
||||
day=dag
|
||||
days=dagen
|
||||
defaultBanReason=De Ban Hamer heeft gesproken!
|
||||
@@ -169,6 +170,7 @@ lightningUse=\u00a77Brand {0}
|
||||
listAfkTag = \u00a77[AFK]\u00a7f
|
||||
listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listGroupTag={0}\u00a7f:
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Fout bij het laden van warp {0}
|
||||
localFormat=Local: <{0}> {1}
|
||||
@@ -301,6 +303,7 @@ seconds=seconde
|
||||
seenOffline=Speler {0} is offline vanaf {1}
|
||||
seenOnline=Speler {0} is online vanaf {1}
|
||||
serverFull=Server is vol
|
||||
serverTotal=Server Total: {0}
|
||||
setSpawner=Changed spawner type to {0}
|
||||
sheepMalformedColor=Misvoormde kleur.
|
||||
shoutFormat=\u00a77[Shout]\u00a7f {0}
|
||||
@@ -317,7 +320,7 @@ suicideMessage=\u00a77Vaarwel vreedzame wereld...
|
||||
suicideSuccess= \u00a77{0} pleegde zelfmoord
|
||||
survival=survival
|
||||
takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald.
|
||||
takenFromOthersAccount=\u00a7c{0} is overgenomen uit {1} account.
|
||||
takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
|
||||
teleportAAll=\u00a77Teleporting request sent to all players...
|
||||
teleportAll=\u00a77Bezig met teleporteren van alle spelers...
|
||||
teleportAtoB=\u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd.
|
||||
|
||||
+19
-19
@@ -13,8 +13,8 @@ commands:
|
||||
aliases: [eafk]
|
||||
antioch:
|
||||
description: 'A little surprise for operators.'
|
||||
usage: /<command>
|
||||
aliases: [eantioch]
|
||||
usage: /<command> [message]
|
||||
aliases: [eantioch,grenade,tnt,egrenade,etnt]
|
||||
back:
|
||||
description: Teleports you to your location prior to tp/spawn/warp.
|
||||
usage: /<command>
|
||||
@@ -26,7 +26,7 @@ commands:
|
||||
balance:
|
||||
description: States the current balance of a player.
|
||||
usage: /<command> [player]
|
||||
aliases: [bal,emoney,ebalance,ebal]
|
||||
aliases: [bal,money,emoney,ebalance,ebal]
|
||||
balancetop:
|
||||
description: Gets the top balance values.
|
||||
usage: /<command> <page>
|
||||
@@ -58,11 +58,11 @@ commands:
|
||||
clearinventory:
|
||||
description: Clear all items in your inventory.
|
||||
usage: /<command>
|
||||
aliases: [ci,eci,eclearinventory]
|
||||
aliases: [ci,eci,clearinvent,clean,eclean,eclearinvent,eclearinventory]
|
||||
compass:
|
||||
description: Describes your current bearing.
|
||||
usage: /<command>
|
||||
aliases: [ecompass]
|
||||
aliases: [ecompass,direction,edirection]
|
||||
delhome:
|
||||
description: Removes a home
|
||||
usage: /<command> [player:]<name>
|
||||
@@ -97,7 +97,7 @@ commands:
|
||||
feed:
|
||||
description: Satisfy the hunger.
|
||||
usage: /<command> [player]
|
||||
aliases: [efeed]
|
||||
aliases: [efeed,eat,eeat]
|
||||
itemdb:
|
||||
description: Searches for an item.
|
||||
usage: /<command> <item>
|
||||
@@ -113,7 +113,7 @@ commands:
|
||||
getpos:
|
||||
description: Get your current coordinates or those of a player.
|
||||
usage: /<command> [player]
|
||||
aliases: [coords,egetpos,whereami,ewhereami]
|
||||
aliases: [coords,egetpos,position,eposition,whereami,ewhereami]
|
||||
gc:
|
||||
description: Reports garbage collection info; useful to developers.
|
||||
usage: /<command>
|
||||
@@ -141,7 +141,7 @@ commands:
|
||||
home:
|
||||
description: Teleport to your home.
|
||||
usage: /<command> [player:][name]
|
||||
aliases: [ehome]
|
||||
aliases: [ehome,homes,ehomes]
|
||||
ignore:
|
||||
description: Ignore other players.
|
||||
usage: /<command> <player>
|
||||
@@ -165,7 +165,7 @@ commands:
|
||||
jump:
|
||||
description: Jumps to the nearest block in the line of sight.
|
||||
usage: /<command>
|
||||
aliases: [j,ejump]
|
||||
aliases: [j,ej,jumpto,ejumpto,ejump]
|
||||
kick:
|
||||
description: Kicks a specified player with a reason.
|
||||
usage: /<command> <player> [reason]
|
||||
@@ -177,7 +177,7 @@ commands:
|
||||
kit:
|
||||
description: Obtains the specified kit or views all available kits.
|
||||
usage: /<command> [kit]
|
||||
aliases: [ekit,kits]
|
||||
aliases: [ekit,kits,ekits]
|
||||
kill:
|
||||
description: Kills specified player.
|
||||
usage: /<command> <player>
|
||||
@@ -189,7 +189,7 @@ commands:
|
||||
list:
|
||||
description: List all online players.
|
||||
usage: /<command>
|
||||
aliases: [playerlist,who,online,elist,ewho,eplayerlist,eonline]
|
||||
aliases: [playerlist,who,online,plist,eplist,elist,ewho,eplayerlist,eonline]
|
||||
lightning:
|
||||
description: The power of Thor. Strike at cursor or player.
|
||||
usage: /<command> [player] [power]
|
||||
@@ -237,7 +237,7 @@ commands:
|
||||
ping:
|
||||
description: Pong!
|
||||
usage: /<command>
|
||||
aliases: [pong,eping,epong]
|
||||
aliases: [pong,echo,echo,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:|d:][command] [arguments]
|
||||
@@ -245,7 +245,7 @@ commands:
|
||||
powertooltoggle:
|
||||
description: Enables or disables all current powertools
|
||||
usage: /<command>
|
||||
aliases: [ptt,epowertooltoggle,eptt]
|
||||
aliases: [ptt,epowertooltoggle,pttoggle,epttoggle,eptt]
|
||||
ptime:
|
||||
description: Adjust player's client time. Add @ prefix to fix.
|
||||
usage: /<command> [list|reset|day|night|dawn|17:30|4pm|4000ticks] [player|*]
|
||||
@@ -337,11 +337,11 @@ commands:
|
||||
tp:
|
||||
description: Teleport to a player.
|
||||
usage: /<command> <player> [otherplayer]
|
||||
aliases: [tele,etele,etp,tp2p,etp2p]
|
||||
aliases: [tele,teleport,eteleport,etele,etp,tp2p,etp2p]
|
||||
tpa:
|
||||
description: Request to teleport to the specified player.
|
||||
usage: /<command> <player>
|
||||
aliases: [call,etpa,ecall]
|
||||
aliases: [call,tpask,etpask,etpa,ecall]
|
||||
tpaall:
|
||||
description: Requests all players online to teleport to you.
|
||||
usage: /<command> <player>
|
||||
@@ -389,11 +389,11 @@ commands:
|
||||
unban:
|
||||
description: Unbans the specified player.
|
||||
usage: /<command> <player>
|
||||
aliases: [pardon,eunban]
|
||||
aliases: [pardon,eunban,epardon]
|
||||
unbanip:
|
||||
description: Unbans the specified IP address.
|
||||
usage: /<command> <address>
|
||||
aliases: [eunbanip,pardonip]
|
||||
aliases: [eunbanip,pardonip,epardonip]
|
||||
unlimited:
|
||||
description: Allows the unlimited placing of items.
|
||||
usage: /<command> <list|item|clear> [player]
|
||||
@@ -401,7 +401,7 @@ commands:
|
||||
warp:
|
||||
description: List all warps or warp to the specified location.
|
||||
usage: /<command> <pagenumber|warp> [player]
|
||||
aliases: [ewarp,warps]
|
||||
aliases: [ewarp,warps,ewarps]
|
||||
weather:
|
||||
description: Setting the weather.
|
||||
usage: /<command> <storm/sun> [duration]
|
||||
@@ -417,4 +417,4 @@ commands:
|
||||
worth:
|
||||
description: Calculates the worth of items in hand or as specified.
|
||||
usage: /<command> [item] [amount]
|
||||
aliases: [eworth]
|
||||
aliases: [eworth,price,eprice]
|
||||
@@ -13,7 +13,11 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.help.HelpMap;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.map.MapView;
|
||||
@@ -677,4 +681,28 @@ public class FakeServer implements Server
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpMap getHelpMap()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory createInventory(InventoryHolder ih, InventoryType it)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory createInventory(InventoryHolder ih, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory createInventory(InventoryHolder ih, int i, String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
@@ -141,4 +141,9 @@ v 1.9:
|
||||
- Change Service registration to register WorldsHolder instead of AnjoPermissionsHandler. This is the correct entry point for all data.
|
||||
- Depreciate PlayerTeleportEvent, PlayerRespawnEvent and PlayerPortalEvent as it's all handled in PlayerChangedWorldEvent.
|
||||
This also means we no longer update permissions before we change worlds.
|
||||
- A command of '/manload' with no world arguments now performs a full reload of GM.
|
||||
- A command of '/manload' with no world arguments now performs a full reload of GM.
|
||||
- Update for Bukkit R5 compatability.
|
||||
- Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes.
|
||||
- Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups.
|
||||
- Prevent promoting players to, and demoting to GlobalGroups.
|
||||
- Make 'manload' reload the config correctly.
|
||||
@@ -4,10 +4,6 @@ settings:
|
||||
# The user will be able to promote players to the same group or even above.
|
||||
opOverrides: true
|
||||
|
||||
# If enabled any bukkit permissiosn which default to true will be left enabled.
|
||||
# If the player is op any permissions set to Op will follow suit.
|
||||
bukkit_perms_override: true
|
||||
|
||||
# Default setting for 'mantoglevalidate'
|
||||
# true will cause GroupManager to attempt name matching by default.
|
||||
validate_toggle: true
|
||||
|
||||
@@ -57,9 +57,6 @@ public class GMConfiguration {
|
||||
public boolean isOpOverride() {
|
||||
return GMconfig.getBoolean("settings.config.opOverrides", true);
|
||||
}
|
||||
public boolean isBukkitPermsOverride() {
|
||||
return GMconfig.getBoolean("settings.config.bukkit_perms_override", false);
|
||||
}
|
||||
public boolean isToggleValidate() {
|
||||
return GMconfig.getBoolean("settings.config.validate_toggle", true);
|
||||
}
|
||||
|
||||
@@ -121,15 +121,15 @@ public class GroupManager extends JavaPlugin {
|
||||
ch = new GMLoggerHandler();
|
||||
GroupManager.logger.addHandler(ch);
|
||||
logger.setLevel(Level.ALL);
|
||||
if (worldsHolder == null) {
|
||||
// Create the backup folder, if it doesn't exist.
|
||||
prepareFileFields();
|
||||
// Load the config.yml
|
||||
prepareConfig();
|
||||
// Load the global groups
|
||||
globalGroups = new GlobalGroups(this);
|
||||
worldsHolder = new WorldsHolder(this);
|
||||
}
|
||||
|
||||
// Create the backup folder, if it doesn't exist.
|
||||
prepareFileFields();
|
||||
// Load the config.yml
|
||||
prepareConfig();
|
||||
// Load the global groups
|
||||
globalGroups = new GlobalGroups(this);
|
||||
worldsHolder = new WorldsHolder(this);
|
||||
|
||||
|
||||
PluginDescriptionFile pdfFile = this.getDescription();
|
||||
if (worldsHolder == null) {
|
||||
@@ -398,6 +398,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// VALIDANDO PERMISSAO
|
||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||
@@ -1019,6 +1023,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group 2 does not exists!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// VALIDANDO PERMISSAO
|
||||
if (permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) {
|
||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)");
|
||||
@@ -1052,6 +1061,11 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group 2 does not exists!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// VALIDANDO PERMISSAO
|
||||
if (!permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) {
|
||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + ".");
|
||||
@@ -1222,6 +1236,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group does not exists!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||
return false;
|
||||
}
|
||||
// VALIDANDO PERMISSAO
|
||||
// PARECE OK
|
||||
auxString = "";
|
||||
@@ -1251,6 +1269,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group does not exists!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||
return false;
|
||||
}
|
||||
// VALIDANDO PERMISSAO
|
||||
if (!auxGroup.getVariables().hasVar(args[1])) {
|
||||
sender.sendMessage(ChatColor.RED + "The group doesn't have directly that variable!");
|
||||
@@ -1276,6 +1298,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group does not exists!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||
return false;
|
||||
}
|
||||
// VALIDANDO PERMISSAO
|
||||
// PARECE OK
|
||||
auxString = "";
|
||||
@@ -1313,6 +1339,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group does not exists!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||
return false;
|
||||
}
|
||||
// VALIDANDO PERMISSAO
|
||||
auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1], null);
|
||||
if (auxGroup2 == null) {
|
||||
@@ -1578,6 +1608,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
||||
return false;
|
||||
}
|
||||
// VALIDANDO PERMISSAO
|
||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
|
||||
@@ -1634,6 +1668,10 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
||||
return false;
|
||||
}
|
||||
if (auxGroup.isGlobal()) {
|
||||
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
||||
return false;
|
||||
}
|
||||
// VALIDANDO PERMISSAO
|
||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
|
||||
|
||||
@@ -48,6 +48,15 @@ public class Group extends DataUnit implements Cloneable {
|
||||
public Group(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this a GlobalGroup
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isGlobal() {
|
||||
return (getDataSource() == null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone this group
|
||||
@@ -57,7 +66,7 @@ public class Group extends DataUnit implements Cloneable {
|
||||
public Group clone() {
|
||||
Group clone;
|
||||
|
||||
if (getDataSource() == null) {
|
||||
if (isGlobal()) {
|
||||
clone = new Group(this.getName());
|
||||
} else {
|
||||
clone = new Group(getDataSource(), this.getName());
|
||||
@@ -85,7 +94,7 @@ public class Group extends DataUnit implements Cloneable {
|
||||
Group clone = dataSource.createGroup(this.getName());
|
||||
|
||||
// Don't add inheritance for GlobalGroups
|
||||
if (getDataSource() != null) {
|
||||
if (!isGlobal()) {
|
||||
clone.inherits = new ArrayList<String>(this.getInherits());
|
||||
}
|
||||
for (String perm : this.getPermissionList()) {
|
||||
@@ -110,26 +119,30 @@ public class Group extends DataUnit implements Cloneable {
|
||||
* @param inherit the inherits to set
|
||||
*/
|
||||
public void addInherits(Group inherit) {
|
||||
if (!this.getDataSource().groupExists(inherit.getName())) {
|
||||
getDataSource().addGroup(inherit);
|
||||
}
|
||||
if (!inherits.contains(inherit.getName().toLowerCase())) {
|
||||
inherits.add(inherit.getName().toLowerCase());
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED);
|
||||
}
|
||||
if (!isGlobal()) {
|
||||
if (!this.getDataSource().groupExists(inherit.getName())) {
|
||||
getDataSource().addGroup(inherit);
|
||||
}
|
||||
if (!inherits.contains(inherit.getName().toLowerCase())) {
|
||||
inherits.add(inherit.getName().toLowerCase());
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean removeInherits(String inherit) {
|
||||
if (this.inherits.contains(inherit.toLowerCase())) {
|
||||
this.inherits.remove(inherit.toLowerCase());
|
||||
flagAsChanged();
|
||||
GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED);
|
||||
return true;
|
||||
}
|
||||
if (!isGlobal()) {
|
||||
if (this.inherits.contains(inherit.toLowerCase())) {
|
||||
this.inherits.remove(inherit.toLowerCase());
|
||||
flagAsChanged();
|
||||
GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -145,15 +158,17 @@ public class Group extends DataUnit implements Cloneable {
|
||||
* @param varList
|
||||
*/
|
||||
public void setVariables(Map<String, Object> varList) {
|
||||
GroupVariables temp = new GroupVariables(this, varList);
|
||||
variables.clearVars();
|
||||
for (String key : temp.getVarKeyList()) {
|
||||
variables.addVar(key, temp.getVarObject(key));
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
GroupManagerEventHandler.callEvent(this, Action.GROUP_INFO_CHANGED);
|
||||
}
|
||||
if (!isGlobal()) {
|
||||
GroupVariables temp = new GroupVariables(this, varList);
|
||||
variables.clearVars();
|
||||
for (String key : temp.getVarKeyList()) {
|
||||
variables.addVar(key, temp.getVarObject(key));
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
GroupManagerEventHandler.callEvent(this, Action.GROUP_INFO_CHANGED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@ public class GMGroupEvent extends Event {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5294917600434510451L;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,6 @@ public class GMSystemEvent extends Event {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -8786811924448821548L;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,6 @@ public class GMUserEvent extends Event {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5294917600434510451L;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
+29
-7
@@ -1,12 +1,13 @@
|
||||
package com.earth2me.essentials.spawn;
|
||||
|
||||
import com.earth2me.essentials.*;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.SimpleTextPager;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -35,6 +36,11 @@ public class EssentialsSpawnPlayerListener implements Listener
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ess.getSettings().getRespawnAtHome())
|
||||
{
|
||||
Location home;
|
||||
@@ -62,13 +68,14 @@ public class EssentialsSpawnPlayerListener implements Listener
|
||||
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (user.hasPlayedBefore())
|
||||
if (event.getPlayer().hasPlayedBefore())
|
||||
{
|
||||
LOGGER.log(Level.FINE, "Old player join");
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn()))
|
||||
{
|
||||
ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L);
|
||||
@@ -81,6 +88,21 @@ public class EssentialsSpawnPlayerListener implements Listener
|
||||
ess.broadcastMessage(user, pager.getString(0));
|
||||
}
|
||||
|
||||
final String kitName = ess.getSettings().getNewPlayerKit();
|
||||
if (!kitName.isEmpty())
|
||||
{
|
||||
try
|
||||
{
|
||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName.toLowerCase(Locale.ENGLISH));
|
||||
final List<String> items = Kit.getItems(user, kit);
|
||||
Kit.expandItems(ess, user, items);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.log(Level.FINE, "New player join");
|
||||
}
|
||||
|
||||
@@ -104,7 +126,7 @@ public class EssentialsSpawnPlayerListener implements Listener
|
||||
|
||||
try
|
||||
{
|
||||
Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn());
|
||||
final Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn());
|
||||
if (spawn != null)
|
||||
{
|
||||
user.getTeleport().now(spawn, false, TeleportCause.PLUGIN);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
@@ -16,7 +16,7 @@ public class VersionInfo
|
||||
|
||||
public VersionInfo(final Configuration updateConfig, final String path)
|
||||
{
|
||||
changelog = updateConfig.getList(path + ".changelog", Collections.<String>emptyList());
|
||||
changelog = updateConfig.getStringList(path + ".changelog");
|
||||
minBukkit = updateConfig.getInt(path + ".min-bukkit", 0);
|
||||
maxBukkit = updateConfig.getInt(path + ".max-bukkit", 0);
|
||||
modules = new HashMap<String, ModuleInfo>();
|
||||
|
||||
+7
@@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.update.states;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
|
||||
public class InstallationFinishedEvent extends Event
|
||||
@@ -9,4 +10,10 @@ public class InstallationFinishedEvent extends Event
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user