summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalodev@gmx.co.uk>2012-10-09 13:47:55 +0100
committerementalo <ementalodev@gmx.co.uk>2012-10-09 13:47:55 +0100
commitb6e7daa036e4de8b73f736204596ea197e0fff05 (patch)
tree415f6084d057fc4b68a2cc9c0e3655c46ffe8a90
parent4fac9f95de7e111e42d01bfc52e6bf386859b1d5 (diff)
downloadEssentials-b6e7daa036e4de8b73f736204596ea197e0fff05.tar
Essentials-b6e7daa036e4de8b73f736204596ea197e0fff05.tar.gz
Essentials-b6e7daa036e4de8b73f736204596ea197e0fff05.tar.lz
Essentials-b6e7daa036e4de8b73f736204596ea197e0fff05.tar.xz
Essentials-b6e7daa036e4de8b73f736204596ea197e0fff05.zip
Move social spy command definition to config file.
Fix the loading of some values from the config.
-rw-r--r--Essentials/src/net/ess3/listener/EssentialsPlayerListener.java3
-rw-r--r--Essentials/src/net/ess3/settings/Commands.java1
-rw-r--r--Essentials/src/net/ess3/settings/WorldOptions.java13
-rw-r--r--Essentials/src/net/ess3/settings/commands/SocialSpy.java27
4 files changed, 36 insertions, 8 deletions
diff --git a/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java b/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java
index e974f2e14..0909f1d0b 100644
--- a/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java
+++ b/Essentials/src/net/ess3/listener/EssentialsPlayerListener.java
@@ -322,8 +322,7 @@ public class EssentialsPlayerListener implements Listener
{
final IUser user = ess.getUserMap().getUser(event.getPlayer());
final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH);
- final List<String> commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email");
- if (commands.contains(cmd))
+ if (ess.getSettings().getData().getCommands().getSocalspy().getSocialspyCommands().contains(cmd))
{
for (Player player : ess.getServer().getOnlinePlayers())
{
diff --git a/Essentials/src/net/ess3/settings/Commands.java b/Essentials/src/net/ess3/settings/Commands.java
index 03629c3ca..39c0f4203 100644
--- a/Essentials/src/net/ess3/settings/Commands.java
+++ b/Essentials/src/net/ess3/settings/Commands.java
@@ -26,6 +26,7 @@ public class Commands implements StorageObject
private Spawnmob spawnmob = new Spawnmob();
private Tpa tpa = new Tpa();
private Speed speed = new Speed();
+ private SocialSpy socalspy = new SocialSpy();
@ListType
@Comment(
{
diff --git a/Essentials/src/net/ess3/settings/WorldOptions.java b/Essentials/src/net/ess3/settings/WorldOptions.java
index 661f77c30..a0c9c8276 100644
--- a/Essentials/src/net/ess3/settings/WorldOptions.java
+++ b/Essentials/src/net/ess3/settings/WorldOptions.java
@@ -11,26 +11,27 @@ import net.ess3.storage.Comment;
import net.ess3.storage.StorageObject;
import org.bukkit.entity.EntityType;
+
@Data
@EqualsAndHashCode(callSuper = false)
public class WorldOptions implements StorageObject
{
-
public WorldOptions()
{
//Populate creature spawn values
- for (EntityType t : EntityType.values())
+ if (creatureSpawn.isEmpty())
{
- if (t.isAlive())
+ for (EntityType t : EntityType.values())
{
- creatureSpawn.put(t, false);
+ if (t.isAlive())
+ {
+ creatureSpawn.put(t, false);
+ }
}
}
}
-
@Comment("Disables godmode for all players if they teleport to this world.")
private boolean godmode = true;
-
@Comment("Prevent creatures spawning")
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
diff --git a/Essentials/src/net/ess3/settings/commands/SocialSpy.java b/Essentials/src/net/ess3/settings/commands/SocialSpy.java
new file mode 100644
index 000000000..9cb572689
--- /dev/null
+++ b/Essentials/src/net/ess3/settings/commands/SocialSpy.java
@@ -0,0 +1,27 @@
+package net.ess3.settings.commands;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import net.ess3.storage.Comment;
+import net.ess3.storage.ListType;
+import net.ess3.storage.StorageObject;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SocialSpy implements StorageObject
+{
+ public SocialSpy()
+ {
+ if (socialspyCommands.isEmpty())
+ {
+ socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"));
+ }
+ }
+ @ListType
+ @Comment("Commands to listen for in socialspy")
+ private List<String> socialspyCommands = new ArrayList<String>();
+}