mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-15 02:59:06 +02:00
Move social spy command definition to config file.
Fix the loading of some values from the config.
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
@@ -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(
|
||||
{
|
||||
|
@@ -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)
|
||||
|
27
Essentials/src/net/ess3/settings/commands/SocialSpy.java
Normal file
27
Essentials/src/net/ess3/settings/commands/SocialSpy.java
Normal file
@@ -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>();
|
||||
}
|
Reference in New Issue
Block a user