summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IUser.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkit.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java1
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java51
-rw-r--r--Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java35
-rw-r--r--Essentials/src/com/earth2me/essentials/permissions/Permissions.java1
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/General.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/user/User.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/user/UserBase.java9
-rw-r--r--Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java3
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java21
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java25
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java12
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java1
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java2
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java30
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java2
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java10
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java2
-rw-r--r--EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java23
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java8
21 files changed, 174 insertions, 86 deletions
diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java
index b7a22ac4d..d9811a9af 100644
--- a/Essentials/src/com/earth2me/essentials/api/IUser.java
+++ b/Essentials/src/com/earth2me/essentials/api/IUser.java
@@ -120,6 +120,8 @@ public interface IUser extends Player, IStorageObjectHolder<UserData>, IReload,
void setInvSee(boolean invsee);
+ boolean hasInvulnerabilityAfterTeleport();
+
void update(final Player base);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
index a6c1183ad..4130429f8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
@@ -90,16 +90,10 @@ public class Commandkit extends EssentialsCommand
throw new Exception(_("noKitPermission", "essentials.kit." + kitName));
}
final Kit kit = ess.getKits().getKit(kitName);
-
-
-
ess.getKits().checkTime(userFrom, kit);
-
final Trade charge = new Trade("kit-" + kitName, ess);
charge.isAffordableFor(userFrom);
-
ess.getKits().sendKit(userTo, kit);
-
charge.charge(userFrom);
userTo.sendMessage(_("kitGive", kitName));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
index 1f5a6912f..6cf391bf7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
@@ -34,6 +34,7 @@ public class Commandpowertool extends EssentialsCommand
}
final String itemName = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replaceAll("_", " ");
+ user.acquireReadLock();
List<String> powertools = user.getData().getPowertool(itemStack.getType());
if (command != null && !command.isEmpty())
{
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java
new file mode 100644
index 000000000..934d94fa2
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java
@@ -0,0 +1,51 @@
+package com.earth2me.essentials.craftbukkit;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.minecraft.server.ChunkPosition;
+import net.minecraft.server.Packet60Explosion;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.block.Block;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.entity.Player;
+import org.bukkit.event.entity.EntityExplodeEvent;
+
+
+public class FakeExplosion
+{
+ public static void createExplosion(final EntityExplodeEvent event, final Server server, final Player[] players)
+ {
+ try
+ {
+ final Set<ChunkPosition> set = new HashSet<ChunkPosition>(event.blockList().size());
+ final List<ChunkPosition> blocksUnderPlayers = new ArrayList<ChunkPosition>(players.length);
+ final Location loc = event.getLocation();
+ for (Player player : players)
+ {
+ if (player.getWorld().equals(loc.getWorld()))
+ {
+ blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()));
+ }
+ }
+ for (Block block : event.blockList())
+ {
+ final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ());
+ if (!blocksUnderPlayers.contains(cp))
+ {
+ set.add(cp);
+ }
+ }
+ ((CraftServer)server).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set));
+ }
+ catch (Throwable ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java
index 036da57d2..675d861f5 100644
--- a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java
@@ -5,9 +5,11 @@ import com.earth2me.essentials.api.IEssentials;
import com.earth2me.essentials.api.ISettings;
import com.earth2me.essentials.api.IUser;
import com.earth2me.essentials.permissions.Permissions;
+import com.earth2me.essentials.user.UserData.TimestampType;
import java.util.List;
import lombok.Cleanup;
import org.bukkit.Material;
+import org.bukkit.entity.Ageable;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@@ -33,34 +35,59 @@ public class EssentialsEntityListener implements Listener
{
final Entity eAttack = event.getDamager();
final Entity eDefend = event.getEntity();
+
if (eDefend instanceof Player && eAttack instanceof Player)
{
@Cleanup
final IUser attacker = ess.getUser((Player)eAttack);
+ @Cleanup
+ final IUser defender = ess.getUser((Player)eDefend);
+ @Cleanup
+ ISettings settings = ess.getSettings();
+ settings.acquireReadLock();
attacker.acquireReadLock();
+ defender.acquireReadLock();
+
attacker.updateActivity(true);
+ if (settings.getData().getGeneral().getLoginAttackDelay() > 0 && !Permissions.PVPDELAY_EXEMPT.isAuthorized(attacker)
+ && (System.currentTimeMillis() < (attacker.getTimestamp(TimestampType.LOGIN) + settings.getData().getGeneral().getLoginAttackDelay())))
+ {
+ event.setCancelled(true);
+ }
+ if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport())
+ {
+ event.setCancelled(true);
+ }
final ItemStack itemstack = attacker.getItemInHand();
final List<String> commandList = attacker.getData().getPowertool(itemstack.getType());
if (commandList != null && !commandList.isEmpty())
{
- for (String command : commandList)
+ for (final String command : commandList)
{
if (command != null && !command.isEmpty())
{
- attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", ((Player)eDefend).getName()));
+ ess.scheduleSyncDelayedTask(
+ new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ attacker.getServer().dispatchCommand(attacker.getBase(), command.replaceAll("\\{player\\}", defender.getName()));
+ }
+ });
event.setCancelled(true);
return;
}
}
}
}
- else if (eDefend instanceof Animals && eAttack instanceof Player)
+ else if (eDefend instanceof Ageable && eAttack instanceof Player)
{
final Player player = (Player)eAttack;
final ItemStack hand = player.getItemInHand();
if (hand != null && hand.getType() == Material.MILK_BUCKET)
{
- ((Animals)eDefend).setBaby();
+ ((Ageable)eDefend).setBaby();
hand.setType(Material.BUCKET);
player.setItemInHand(hand);
player.updateInventory();
diff --git a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java
index aa6bfa583..8cc9b060c 100644
--- a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java
+++ b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java
@@ -59,6 +59,7 @@ public enum Permissions implements IPermission
OVERSIZEDSTACKS(PermissionDefault.FALSE),
POWERTOOL_APPEND,
PTIME_OTHERS,
+ PVPDELAY_EXEMPT,
REPAIR_ARMOR,
REPAIR_ENCHANTED,
SEEN_BANREASON,
diff --git a/Essentials/src/com/earth2me/essentials/settings/General.java b/Essentials/src/com/earth2me/essentials/settings/General.java
index f1b827675..9647d3bed 100644
--- a/Essentials/src/com/earth2me/essentials/settings/General.java
+++ b/Essentials/src/com/earth2me/essentials/settings/General.java
@@ -80,9 +80,9 @@ public class General implements StorageObject
"This applies to /world, /back, /tp[a|o][here|all], but not warps.",
"Give someone permission to teleport to a world with essentials.world.<worldname>"
})
- private boolean worldTeleportPermissions = false;
-
+ private boolean worldTeleportPermissions = false;
private boolean worldHomePermissions = false;
+
@Comment("Prevent creatures spawning")
private Map<String, Boolean> creatureSpawn = new HashMap<String, Boolean>();
@@ -95,4 +95,12 @@ public class General implements StorageObject
}
return creatureSpawn.get(creatureName);
}
+
+ @Comment("Delay to wait before people can cause attack damage after logging in ")
+ private long loginAttackDelay = 0;
+
+ public long getLoginAttackDelay()
+ {
+ return loginAttackDelay * 1000;
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java
index fdd229794..fcb601c9a 100644
--- a/Essentials/src/com/earth2me/essentials/user/User.java
+++ b/Essentials/src/com/earth2me/essentials/user/User.java
@@ -739,6 +739,10 @@ public class User extends UserBase implements IUser
teleportInvulnerabilityTimestamp = 0;
}
}
+ public boolean hasInvulnerabilityAfterTeleport()
+ {
+ return teleportInvulnerabilityTimestamp != 0 && teleportInvulnerabilityTimestamp >= System.currentTimeMillis();
+ }
@Override
public void toggleVanished()
diff --git a/Essentials/src/com/earth2me/essentials/user/UserBase.java b/Essentials/src/com/earth2me/essentials/user/UserBase.java
index 4e0ab75fb..7daeba0c6 100644
--- a/Essentials/src/com/earth2me/essentials/user/UserBase.java
+++ b/Essentials/src/com/earth2me/essentials/user/UserBase.java
@@ -113,14 +113,7 @@ public abstract class UserBase extends AsyncStorageObjectHolder<UserData> implem
@Override
public Location getBedSpawnLocation()
{
- if (isOnlineUser())
- {
- return base.getBedSpawnLocation();
- }
- else
- {
- return offlinePlayer.getBedSpawnLocation();
- }
+ return base.getBedSpawnLocation();
}
@Override
diff --git a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
index 97338579d..865af41e3 100644
--- a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
+++ b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
@@ -696,7 +696,8 @@ public class EssentialsUpgrade
{
return;
}
- ess.getSettings().setMetricsEnabled(false);
+ //todo - metrics
+ // ess.getSettings().setMetricsEnabled(false);
doneFile.setProperty("warnMetrics", true);
doneFile.save();
}
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
index acf08a5dd..7618a66ab 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
@@ -112,6 +112,7 @@ public abstract class EssentialsChatPlayer implements Listener
protected void handleLocalChat(final PlayerChatEvent event, final ChatStore chatStore)
{
+
long radius = 0;
ISettings settings = ess.getSettings();
settings.acquireReadLock();
@@ -143,26 +144,6 @@ public abstract class EssentialsChatPlayer implements Listener
event.setFormat(_(format.toString(), event.getFormat()));
return;
}
- if (!onlineUser.equals(sender))
- {
- if (onlineUser.isAuthorized("essentials.chat.spy"))
- {
- type = type.concat(_("chatTypeSpy"));
- }
- else
- {
- final Location playerLoc = onlineUser.getLocation();
- if (playerLoc.getWorld() != world)
- {
- continue;
- }
- final double delta = playerLoc.distanceSquared(loc);
- if (delta > chatStore.getRadius())
- {
- continue;
- }
- }
- }
final StringBuilder errorMsg = new StringBuilder();
errorMsg.append("notAllowedTo").append(chatStore.getType().substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatStore.getType().substring(1));
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java
index 401fa1142..8788d755d 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java
@@ -44,28 +44,29 @@ public class EssentialsLocalChatEventListener implements Listener
}
if (!user.equals(sender))
{
- final Location playerLoc = user.getLocation();
- if (playerLoc.getWorld() != world)
+ if (Permissions.CHAT_SPY.isAuthorized(user))
{
- continue;
+ type = type.concat(_("chatTypeSpy"));
}
- final double delta = playerLoc.distanceSquared(loc);
-
- if (delta > event.getRadius())
+ else
{
- if (Permissions.CHAT_SPY.isAuthorized(user))
+ final Location playerLoc = user.getLocation();
+ if (playerLoc.getWorld() != world)
{
- type = type.concat(_("chatTypeSpy"));
+ continue;
}
- else
+ final double delta = playerLoc.distanceSquared(loc);
+
+ if (delta > event.getRadius())
{
continue;
}
}
- }
- final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage()));
- user.sendMessage(message);
+ final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage()));
+ user.sendMessage(message);
+ }
}
+
}
} \ No newline at end of file
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java
index e2d82d644..bf45e54c6 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java
@@ -24,4 +24,16 @@ public class ConfigHolder extends AsyncStorageObjectHolder<GeoIP>
return new File(geoip.getDataFolder(), "config.yml");
}
+ @Override
+ public void finishRead()
+ {
+
+ }
+
+ @Override
+ public void finishWrite()
+ {
+
+ }
+
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
index e475296b5..8cd0e271b 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.protect;
import com.earth2me.essentials.api.IEssentials;
+import com.earth2me.essentials.craftbukkit.FakeExplosion;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java
index 77f82bdb5..cb8e568aa 100644
--- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java
+++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java
@@ -3,7 +3,7 @@ package com.earth2me.essentials.signs;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.api.IEssentials;
import com.earth2me.essentials.api.IUser;
-import com.earth2me.essentials.Util;
+import com.earth2me.essentials.utils.Util;
public class SignBalance extends EssentialsSign
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java
index c678c2efa..a2465c76d 100644
--- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java
+++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java
@@ -1,8 +1,9 @@
package com.earth2me.essentials.signs;
import com.earth2me.essentials.api.IEssentials;
+import com.earth2me.essentials.api.ISettings;
import com.earth2me.essentials.api.IUser;
-import com.earth2me.essentials.Util;
+import com.earth2me.essentials.utils.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Material;
@@ -32,7 +33,9 @@ public class SignBlockListener implements Listener
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockBreak(final BlockBreakEvent event)
{
- if (ess.getSettings().areSignsDisabled())
+ ISettings settings = ess.getSettings();
+ settings.acquireReadLock();
+ if (plugin.getSettings().areSignsDisabled())
{
return;
}
@@ -65,15 +68,7 @@ public class SignBlockListener implements Listener
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
return true;
}
- for (EssentialsSign sign : ess.getSettings().enabledSigns())
- {
- if (sign.getBlocks().contains(block.getType())
- && !sign.onBlockBreak(block, player, ess))
- {
- LOGGER.log(Level.INFO, "A block was protected by a sign.");
- return true;
- }
- for (EssentialsSign sign : plugin.getSettings().getEnabledSigns())
+ for (EssentialsSign sign : plugin.getSettings().getEnabledSigns())
{
if (sign.getBlocks().contains(block.getType())
&& !sign.onBlockBreak(block, player, ess))
@@ -81,19 +76,18 @@ public class SignBlockListener implements Listener
LOGGER.log(Level.INFO, "A block was protected by a sign.");
return true;
}
- }
- }
+ }
return false;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onSignChange(final SignChangeEvent event)
{
- if (ess.getSettings().areSignsDisabled())
+ if (plugin.getSettings().areSignsDisabled())
{
return;
}
- User user = ess.getUser(event.getPlayer());
+ IUser user = ess.getUser(event.getPlayer());
for (int i = 0; i < 4; i++)
{
@@ -120,7 +114,7 @@ public class SignBlockListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockPlace(final BlockPlaceEvent event)
{
- if (ess.getSettings().areSignsDisabled())
+ if (plugin.getSettings().areSignsDisabled())
{
return;
}
@@ -154,7 +148,7 @@ public class SignBlockListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockBurn(final BlockBurnEvent event)
{
- if (ess.getSettings().areSignsDisabled())
+ if (plugin.getSettings().areSignsDisabled())
{
return;
}
@@ -182,7 +176,7 @@ public class SignBlockListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockIgnite(final BlockIgniteEvent event)
{
- if (ess.getSettings().areSignsDisabled())
+ if (plugin.getSettings().areSignsDisabled())
{
return;
}
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java
index 00ebc60d0..213b0e125 100644
--- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java
+++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java
@@ -48,7 +48,7 @@ public class SignEntityListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityChangeBlock(final EntityChangeBlockEvent event)
{
- if (ess.getSettings().areSignsDisabled())
+ if (plugin.getSettings().areSignsDisabled())
{
return;
}
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java
index 46bbb65db..b33e05a35 100644
--- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java
+++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.signs;
+import com.earth2me.essentials.Kits;
import com.earth2me.essentials.api.ChargeException;
import com.earth2me.essentials.economy.Trade;
import com.earth2me.essentials.api.IEssentials;
@@ -58,11 +59,10 @@ public class SignKit extends EssentialsSign
final Trade charge = getTrade(sign, 3, ess);
charge.isAffordableFor(player);
try
- {
- final Kit kit = ess.getKits().getKit(kitName);
- Kit.checkTime(player, kitName, kit);
- final List<String> items = Kit.getItems(player, kit);
- Kit.expandItems(ess, player, items);
+ {;
+ final Kit kit = ess.getKits().getKit(kitName);
+ ess.getKits().checkTime(player, kit);
+ ess.getKits().sendKit(player,kit);
charge.charge(player);
}
catch (Exception ex)
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java
index 1a401ce64..9d597820f 100644
--- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java
+++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java
@@ -25,7 +25,7 @@ public class SignPlayerListener implements Listener
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerInteract(final PlayerInteractEvent event)
{
- if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
+ if (plugin.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java
index dcf436b03..d5ece9f69 100644
--- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java
+++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java
@@ -12,6 +12,7 @@ public class SignsConfigHolder extends AsyncStorageObjectHolder<SignsConfig>
{
private final Plugin plugin;
private Set<EssentialsSign> enabledSigns = new HashSet<EssentialsSign>();
+ private boolean signsEnabled = false;
public SignsConfigHolder(final IEssentials ess, final Plugin plugin)
{
@@ -24,6 +25,11 @@ public class SignsConfigHolder extends AsyncStorageObjectHolder<SignsConfig>
Map<String, Boolean> signs = getData().getSigns();
for (Map.Entry<String, Boolean> entry : signs.entrySet())
{
+ if(entry.getKey().trim().toUpperCase(Locale.ENGLISH).equals("COLOR") || entry.getKey().trim().toUpperCase(Locale.ENGLISH).equals("COLOUR"))
+ {
+ signsEnabled = true;
+ continue;
+ }
Signs sign = Signs.valueOf(entry.getKey().toUpperCase(Locale.ENGLISH));
if (sign != null && entry.getValue())
{
@@ -61,4 +67,21 @@ public class SignsConfigHolder extends AsyncStorageObjectHolder<SignsConfig>
{
return enabledSigns;
}
+
+ public boolean areSignsDisabled()
+ {
+ return !signsEnabled;
+ }
+
+ @Override
+ public void finishRead()
+ {
+
+ }
+
+ @Override
+ public void finishWrite()
+ {
+
+ }
}
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java
index c00ef38af..194d7e98e 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java
@@ -12,11 +12,5 @@ public class InstallationFinishedEvent extends Event
public HandlerList getHandlers()
{
return handlers;
- }
-
- @Override
- public HandlerList getHandlers()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
+ }
}