1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-12 17:45:08 +02:00

Random Cleanup

This commit is contained in:
KHobbits
2012-01-28 14:05:50 +00:00
parent f4413633b8
commit e960078e1a
7 changed files with 19 additions and 13 deletions

View File

@@ -16,6 +16,7 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.config.Configuration; import org.bukkit.util.config.Configuration;
@Deprecated @Deprecated
public class EssentialsConf extends Configuration public class EssentialsConf extends Configuration
{ {

View File

@@ -80,7 +80,6 @@ public class EssentialsLocalChatEvent extends Event implements Cancellable
ex.fillInStackTrace(); ex.fillInStackTrace();
throw ex; throw ex;
} }
this.format = format; this.format = format;
} }

View File

@@ -28,7 +28,6 @@ public class EssentialsLocalChatEventListener implements Listener
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onLocalChat(final EssentialsLocalChatEvent event) public void onLocalChat(final EssentialsLocalChatEvent event)
{ {
final Player sender = event.getPlayer(); final Player sender = event.getPlayer();
final Location loc = sender.getLocation(); final Location loc = sender.getLocation();
final World world = loc.getWorld(); final World world = loc.getWorld();

View File

@@ -28,7 +28,6 @@ public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
{ {
return; return;
} }
chargeChat(event, chatStore); chargeChat(event, chatStore);
} }
} }

View File

@@ -28,11 +28,9 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
{ {
return; return;
} }
final IUser user = ess.getUser(event.getPlayer()); final IUser user = ess.getUser(event.getPlayer());
final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage())); final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage()));
setChatStore(event, chatStore); setChatStore(event, chatStore);
formatChat(event, chatStore); formatChat(event, chatStore);
} }
} }

View File

@@ -98,12 +98,15 @@ public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IE
{ {
for (EventPriority priority : EventPriority.values()) for (EventPriority priority : EventPriority.values())
{ {
if (priority.toString().equalsIgnoreCase(getData().getRespawnPriority())) { if (priority.toString().equalsIgnoreCase(getData().getRespawnPriority()))
{
return priority; return priority;
} }
} }
return EventPriority.NORMAL; return EventPriority.NORMAL;
} finally { }
finally
{
unlock(); unlock();
} }
} }
@@ -113,12 +116,15 @@ public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IE
acquireReadLock(); acquireReadLock();
try try
{ {
if (getData().getNewbieSpawn() == null || getData().getNewbieSpawn().isEmpty() || if (getData().getNewbieSpawn() == null || getData().getNewbieSpawn().isEmpty()
getData().getNewbieSpawn().equalsIgnoreCase("none")) { || getData().getNewbieSpawn().equalsIgnoreCase("none"))
{
return null; return null;
} }
return getSpawn(getData().getNewbieSpawn()); return getSpawn(getData().getNewbieSpawn());
} finally { }
finally
{
unlock(); unlock();
} }
} }
@@ -129,7 +135,9 @@ public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IE
try try
{ {
return getData().getNewPlayerAnnouncement() != null && !getData().getNewPlayerAnnouncement().isEmpty(); return getData().getNewPlayerAnnouncement() != null && !getData().getNewPlayerAnnouncement().isEmpty();
} finally { }
finally
{
unlock(); unlock();
} }
} }
@@ -140,7 +148,9 @@ public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IE
try try
{ {
return getData().getNewPlayerAnnouncement().replace('&', '§').replace("§§", "&").replace("{PLAYER}", user.getDisplayName()).replace("{DISPLAYNAME}", user.getDisplayName()).replace("{GROUP}", user.getGroup()).replace("{USERNAME}", user.getName()).replace("{ADDRESS}", user.getAddress().toString()); return getData().getNewPlayerAnnouncement().replace('&', '§').replace("§§", "&").replace("{PLAYER}", user.getDisplayName()).replace("{DISPLAYNAME}", user.getDisplayName()).replace("{GROUP}", user.getGroup()).replace("{USERNAME}", user.getName()).replace("{ADDRESS}", user.getAddress().toString());
} finally { }
finally
{
unlock(); unlock();
} }
} }