mirror of
https://github.com/EssentialsX/Essentials.git
synced 2026-11-05 17:12:42 -05:00
Compare commits
164
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ca1cdec4f | ||
|
|
86a1dda46c | ||
|
|
4326ce0d4a | ||
|
|
3ff1f4adbb | ||
|
|
492c4e8521 | ||
|
|
e3f3fe84ea | ||
|
|
6e2ac3b56e | ||
|
|
5c19e71858 | ||
|
|
92fa415848 | ||
|
|
2942ef40f3 | ||
|
|
e2abf05a27 | ||
|
|
8500542e93 | ||
|
|
d9e6f2975a | ||
|
|
2f1d9ad82c | ||
|
|
d8ac3587ac | ||
|
|
a2418a68d9 | ||
|
|
85c4fbdf4f | ||
|
|
dff8f541fe | ||
|
|
d0a5656fa4 | ||
|
|
bc76e87366 | ||
|
|
bf9a67a2e4 | ||
|
|
95885e46c9 | ||
|
|
5a7f38fa29 | ||
|
|
6a5fefb102 | ||
|
|
c47c008871 | ||
|
|
a31f5e219d | ||
|
|
9ee78bdaec | ||
|
|
735f9ce212 | ||
|
|
417148f5da | ||
|
|
8f0350570e | ||
|
|
27365d1f1b | ||
|
|
ebb3a77430 | ||
|
|
b3252168f6 | ||
|
|
e1abdbdd37 | ||
|
|
3deff2afe7 | ||
|
|
a85cbdd505 | ||
|
|
c6aa34076a | ||
|
|
92f83dfe73 | ||
|
|
00057eaca4 | ||
|
|
2f96c9763f | ||
|
|
137b60c5f2 | ||
|
|
292b7b0546 | ||
|
|
d1d31e9769 | ||
|
|
f7c6759433 | ||
|
|
5137502646 | ||
|
|
9ff8b69282 | ||
|
|
7f269187c5 | ||
|
|
6d34a2aa17 | ||
|
|
9b58b2b9c0 | ||
|
|
b4d91978c7 | ||
|
|
8aa260ee34 | ||
|
|
25976edc2b | ||
|
|
8e9094a3ef | ||
|
|
16bde87982 | ||
|
|
b8944d0b25 | ||
|
|
69209eeb2f | ||
|
|
746eb353a2 | ||
|
|
3708f2b3bb | ||
|
|
e563405a7d | ||
|
|
ae2cf3d95c | ||
|
|
270533652b | ||
|
|
324dd05c97 | ||
|
|
2a0c3eebbc | ||
|
|
e1660d47ba | ||
|
|
03d640260d | ||
|
|
da3a6af92d | ||
|
|
593cb8d56e | ||
|
|
f40f5f880b | ||
|
|
8390594682 | ||
|
|
a13740f638 | ||
|
|
5f19cbf17b | ||
|
|
145b0be2f3 | ||
|
|
1dab4f95dd | ||
|
|
f27b2290dc | ||
|
|
0ea41d9169 | ||
|
|
f93769dd1d | ||
|
|
125ea7c701 | ||
|
|
6e03ea7b7d | ||
|
|
9041596384 | ||
|
|
efda9beece | ||
|
|
4b61ac9043 | ||
|
|
72edfacfb8 | ||
|
|
aa88205d95 | ||
|
|
8d441a4cc7 | ||
|
|
766935871f | ||
|
|
f5d65371b2 | ||
|
|
662749be8b | ||
|
|
e46fe381b4 | ||
|
|
04a43eb5d0 | ||
|
|
792f70efa5 | ||
|
|
46298ae858 | ||
|
|
d08b1a5089 | ||
|
|
e015cad131 | ||
|
|
008f0d595f | ||
|
|
7ee3919175 | ||
|
|
2560bdca4a | ||
|
|
16d537bd6c | ||
|
|
5f04d1867c | ||
|
|
a10f6850e5 | ||
|
|
36bc1adf83 | ||
|
|
cd8cc63113 | ||
|
|
947bee98a0 | ||
|
|
9c052b5178 | ||
|
|
64af5b465d | ||
|
|
5c1d49fd0e | ||
|
|
79a13e97a2 | ||
|
|
89c41b0508 | ||
|
|
e7fd26ee64 | ||
|
|
8fc6684290 | ||
|
|
a66ffd8921 | ||
|
|
1f2c669eca | ||
|
|
1d5a09a03e | ||
|
|
4435121c84 | ||
|
|
813e66b4f2 | ||
|
|
26d63f3666 | ||
|
|
0fb07d4cc1 | ||
|
|
cd2f819c29 | ||
|
|
149ce7d74d | ||
|
|
c7c7e5e4ce | ||
|
|
f26cccb663 | ||
|
|
81ec87d893 | ||
|
|
91563e9dca | ||
|
|
359ea194b8 | ||
|
|
1a0b03db4d | ||
|
|
c860b1c668 | ||
|
|
c584d74852 | ||
|
|
6e82419c15 | ||
|
|
3f6b9586b4 | ||
|
|
29d4e09983 | ||
|
|
f61f80164d | ||
|
|
f0def90301 | ||
|
|
d0e5685ac0 | ||
|
|
856cef3286 | ||
|
|
d16fef9f7f | ||
|
|
43f1c0f89d | ||
|
|
256d202d50 | ||
|
|
4884bed117 | ||
|
|
3fdde2f764 | ||
|
|
390b17f0d8 | ||
|
|
fe9d5645f6 | ||
|
|
eb5c88ef08 | ||
|
|
6eea852b1d | ||
|
|
768c92e5bf | ||
|
|
2a478fe03d | ||
|
|
58057a771d | ||
|
|
4c485f3147 | ||
|
|
7726fd0081 | ||
|
|
9a568992f1 | ||
|
|
283dc9b3c1 | ||
|
|
3aba996e97 | ||
|
|
69847af08a | ||
|
|
debcf4714a | ||
|
|
791e8f2d14 | ||
|
|
5d4f22ad84 | ||
|
|
31e80ba698 | ||
|
|
a2202439bb | ||
|
|
7c8c40c790 | ||
|
|
abd86347c7 | ||
|
|
5bb7d82fca | ||
|
|
afe8ecd3df | ||
|
|
244673e1fb | ||
|
|
de40f7f556 | ||
|
|
ac77bbb0b4 | ||
|
|
815a9dcca2 |
No files matched your search
+3
-1
@@ -37,4 +37,6 @@
|
||||
/WebPush/apikey.php
|
||||
/WebPush/nbproject/private
|
||||
/.idea
|
||||
*.iml
|
||||
*.iml
|
||||
/EssentialsGroupManager/bin
|
||||
/EssentialsGroupManager/.externalToolBuilders
|
||||
@@ -922,6 +922,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@@ -933,6 +941,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
||||
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=51b33957
|
||||
nbproject/build-impl.xml.script.CRC32=c8376938
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=c5170bed
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
@@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
||||
@@ -4,8 +4,8 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=a830bc14
|
||||
nbproject/build-impl.xml.script.CRC32=40df7eaf
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=a9f8842a
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15
|
||||
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
|
||||
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1
|
||||
@@ -71,11 +71,12 @@ file.reference.craftbukkit.jar=../lib/craftbukkit.jar
|
||||
file.reference.iCo4.jar=../lib/iCo4.jar
|
||||
file.reference.iCo5.jar=../lib/iCo5.jar
|
||||
file.reference.iCo6.jar=../lib/iCo6.jar
|
||||
file.reference.lombok-0.10.1.jar=../lib/lombok-0.10.1.jar
|
||||
file.reference.lombok.jar=../lib/lombok-0.10.8.jar
|
||||
file.reference.MultiCurrency.jar=../lib/MultiCurrency.jar
|
||||
file.reference.Permissions3.jar=../lib/Permissions3.jar
|
||||
file.reference.PermissionsBukkit-1.2.jar=../lib/PermissionsBukkit-1.2.jar
|
||||
file.reference.PermissionsEx.jar=../lib/PermissionsEx.jar
|
||||
file.reference.Vault.jar=../lib/Vault.jar
|
||||
includes=**
|
||||
jar.archive.disabled=${jnlp.enabled}
|
||||
jar.compress=true
|
||||
@@ -90,10 +91,11 @@ javac.classpath=\
|
||||
${file.reference.PermissionsEx.jar}:\
|
||||
${file.reference.bPermissions.jar}:\
|
||||
${file.reference.PermissionsBukkit-1.2.jar}:\
|
||||
${file.reference.lombok-0.10.1.jar}:\
|
||||
${file.reference.lombok.jar}:\
|
||||
${reference.EssentialsGroupManager.jar}:\
|
||||
${file.reference.bukkit.jar}:\
|
||||
${file.reference.craftbukkit.jar}
|
||||
${file.reference.craftbukkit.jar}:\
|
||||
${file.reference.Vault.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
||||
@@ -54,6 +54,12 @@ public class Enchantments
|
||||
ENCHANTMENTS.put("silktouch", Enchantment.SILK_TOUCH);
|
||||
ENCHANTMENTS.put("waterworker", Enchantment.WATER_WORKER);
|
||||
ENCHANTMENTS.put("aquaaffinity", Enchantment.WATER_WORKER);
|
||||
ENCHANTMENTS.put("firearrow", Enchantment.ARROW_FIRE);
|
||||
ENCHANTMENTS.put("arrowdamage", Enchantment.ARROW_DAMAGE);
|
||||
ENCHANTMENTS.put("arrowknockback", Enchantment.ARROW_KNOCKBACK);
|
||||
ENCHANTMENTS.put("arrowkb", Enchantment.ARROW_KNOCKBACK);
|
||||
ENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE);
|
||||
ENCHANTMENTS.put("infarrows", Enchantment.ARROW_INFINITE);
|
||||
}
|
||||
|
||||
public static Enchantment getByName(String name) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.earth2me.essentials.commands.EssentialsCommand;
|
||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import com.earth2me.essentials.commands.NoChargeException;
|
||||
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
|
||||
import com.earth2me.essentials.craftbukkit.ItemDupeFix;
|
||||
import com.earth2me.essentials.perm.PermissionsHandler;
|
||||
import com.earth2me.essentials.register.payment.Methods;
|
||||
import com.earth2me.essentials.signs.SignBlockListener;
|
||||
@@ -36,7 +35,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -46,10 +44,12 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.event.world.WorldLoadEvent;
|
||||
import org.bukkit.event.world.WorldUnloadEvent;
|
||||
import org.bukkit.plugin.InvalidDescriptionException;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
@@ -61,7 +61,7 @@ import org.yaml.snakeyaml.error.YAMLException;
|
||||
|
||||
public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
public static final int BUKKIT_VERSION = 1597;
|
||||
public static final int BUKKIT_VERSION = 1846;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient ISettings settings;
|
||||
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
||||
@@ -179,14 +179,14 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
LOGGER.log(Level.SEVERE, _("essentialsHelp1"));
|
||||
}
|
||||
LOGGER.log(Level.SEVERE, exception.toString());
|
||||
pm.registerEvent(Type.PLAYER_JOIN, new PlayerListener()
|
||||
pm.registerEvents(new Listener()
|
||||
{
|
||||
@Override
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
event.getPlayer().sendMessage("Essentials failed to load, read the log file.");
|
||||
}
|
||||
}, Priority.Low, this);
|
||||
}, this);
|
||||
for (Player player : getServer().getOnlinePlayers())
|
||||
{
|
||||
player.sendMessage("Essentials failed to load, read the log file.");
|
||||
@@ -198,63 +198,40 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
|
||||
alternativeCommandsHandler = new AlternativeCommandsHandler(this);
|
||||
final EssentialsPluginListener serverListener = new EssentialsPluginListener(this);
|
||||
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.PLUGIN_DISABLE, serverListener, Priority.Low, this);
|
||||
pm.registerEvents(serverListener, this);
|
||||
confList.add(serverListener);
|
||||
|
||||
final EssentialsPlayerListener playerListener = new EssentialsPlayerListener(this);
|
||||
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
|
||||
pm.registerEvent(Type.PLAYER_QUIT, playerListener, Priority.Monitor, this);
|
||||
pm.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Lowest, this);
|
||||
pm.registerEvent(Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Lowest, this);
|
||||
pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_LOGIN, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_EGG_THROW, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
|
||||
pm.registerEvent(Type.PLAYER_CHANGED_WORLD, playerListener, Priority.Normal, this);
|
||||
pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.Monitor, this);
|
||||
pm.registerEvent(Type.PLAYER_PICKUP_ITEM, playerListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.PLAYER_TELEPORT, new ItemDupeFix(), Priority.Monitor, this);
|
||||
pm.registerEvents(playerListener, this);
|
||||
|
||||
final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
|
||||
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
|
||||
pm.registerEvents(blockListener, this);
|
||||
|
||||
final SignBlockListener signBlockListener = new SignBlockListener(this);
|
||||
pm.registerEvent(Type.SIGN_CHANGE, signBlockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_PLACE, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_BREAK, signBlockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_IGNITE, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_BURN, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_PISTON_EXTEND, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_PISTON_RETRACT, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvents(signBlockListener, this);
|
||||
|
||||
final SignPlayerListener signPlayerListener = new SignPlayerListener(this);
|
||||
pm.registerEvent(Type.PLAYER_INTERACT, signPlayerListener, Priority.Low, this);
|
||||
pm.registerEvents(signPlayerListener, this);
|
||||
|
||||
final SignEntityListener signEntityListener = new SignEntityListener(this);
|
||||
pm.registerEvent(Type.ENTITY_EXPLODE, signEntityListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.ENDERMAN_PICKUP, signEntityListener, Priority.Low, this);
|
||||
pm.registerEvents(signEntityListener, this);
|
||||
|
||||
final EssentialsEntityListener entityListener = new EssentialsEntityListener(this);
|
||||
pm.registerEvent(Type.ENTITY_DAMAGE, entityListener, Priority.Lowest, this);
|
||||
pm.registerEvent(Type.ENTITY_COMBUST, entityListener, Priority.Lowest, this);
|
||||
pm.registerEvent(Type.ENTITY_DEATH, entityListener, Priority.Lowest, this);
|
||||
pm.registerEvent(Type.ENTITY_REGAIN_HEALTH, entityListener, Priority.Lowest, this);
|
||||
pm.registerEvent(Type.FOOD_LEVEL_CHANGE, entityListener, Priority.Lowest, this);
|
||||
pm.registerEvents(entityListener, this);
|
||||
|
||||
final EssentialsWorldListener worldListener = new EssentialsWorldListener(this);
|
||||
pm.registerEvents(worldListener, this);
|
||||
|
||||
//TODO: Check if this should be here, and not above before reload()
|
||||
jails = new Jails(this);
|
||||
confList.add(jails);
|
||||
|
||||
pm.registerEvent(Type.ENTITY_EXPLODE, tntListener, Priority.High, this);
|
||||
pm.registerEvents(tntListener, this);
|
||||
|
||||
final EssentialsTimer timer = new EssentialsTimer(this);
|
||||
getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100);
|
||||
Economy.setEss(this);
|
||||
execTimer.mark("RegListeners");
|
||||
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Util.joinList(this.getDescription().getAuthors())));
|
||||
final String timeroutput = execTimer.end();
|
||||
if (getSettings().isDebug())
|
||||
{
|
||||
@@ -440,7 +417,12 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
}
|
||||
if (base instanceof String)
|
||||
{
|
||||
return userMap.getUser((String)base);
|
||||
final User user = userMap.getUser((String)base);
|
||||
if (user != null && user.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
((OfflinePlayer)user.getBase()).setName((String)base);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -472,7 +454,12 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
@Override
|
||||
public User getOfflineUser(final String name)
|
||||
{
|
||||
return userMap.getUser(name);
|
||||
final User user = userMap.getUser(name);
|
||||
if (user != null && user.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
((OfflinePlayer)user.getBase()).setName(name);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -585,4 +572,46 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
return i18n;
|
||||
}
|
||||
|
||||
private static class EssentialsWorldListener implements Listener, Runnable {
|
||||
private transient final IEssentials ess;
|
||||
|
||||
public EssentialsWorldListener(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onWorldLoad(final WorldLoadEvent event)
|
||||
{
|
||||
ess.getJails().onReload();
|
||||
ess.getWarps().reloadConfig();
|
||||
for (IConf iConf : ((Essentials)ess).confList)
|
||||
{
|
||||
if (iConf instanceof IEssentialsModule) {
|
||||
iConf.reloadConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onWorldUnload(final WorldUnloadEvent event)
|
||||
{
|
||||
ess.getJails().onReload();
|
||||
ess.getWarps().reloadConfig();
|
||||
for (IConf iConf : ((Essentials)ess).confList)
|
||||
{
|
||||
if (iConf instanceof IEssentialsModule) {
|
||||
iConf.reloadConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
ess.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,24 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.block.BlockListener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class EssentialsBlockListener extends BlockListener
|
||||
public class EssentialsBlockListener implements Listener
|
||||
{
|
||||
private final IEssentials ess;
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public EssentialsBlockListener(IEssentials ess)
|
||||
public EssentialsBlockListener(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlace(BlockPlaceEvent event)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onBlockPlace(final BlockPlaceEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
|
||||
@@ -110,9 +110,10 @@ public class EssentialsConf extends Configuration
|
||||
super.load();
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, "File broken: " + configFile.toString());
|
||||
throw e;
|
||||
{
|
||||
File broken = new File(configFile.getAbsolutePath() + ".broken." + System.currentTimeMillis());
|
||||
configFile.renameTo(broken);
|
||||
LOGGER.log(Level.SEVERE, "The file " + configFile.toString() + " is broken, it has been renamed to " + broken.toString(), e.getCause());
|
||||
}
|
||||
|
||||
if (this.root == null)
|
||||
|
||||
@@ -2,19 +2,20 @@ package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Animals;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.entity.*;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class EssentialsEntityListener extends EntityListener
|
||||
public class EssentialsEntityListener implements Listener
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private final IEssentials ess;
|
||||
|
||||
public EssentialsEntityListener(IEssentials ess)
|
||||
@@ -22,7 +23,7 @@ public class EssentialsEntityListener extends EntityListener
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDamage(EntityDamageEvent event)
|
||||
{
|
||||
if (event instanceof EntityDamageByEntityEvent)
|
||||
@@ -55,7 +56,8 @@ public class EssentialsEntityListener extends EntityListener
|
||||
{
|
||||
User player = ess.getUser(eAttack);
|
||||
ItemStack hand = player.getItemInHand();
|
||||
if (hand != null && hand.getType() == Material.MILK_BUCKET) {
|
||||
if (hand != null && hand.getType() == Material.MILK_BUCKET)
|
||||
{
|
||||
((Animals)eDefend).setAge(-24000);
|
||||
hand.setType(Material.BUCKET);
|
||||
player.setItemInHand(hand);
|
||||
@@ -73,7 +75,7 @@ public class EssentialsEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityCombust(EntityCombustEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
|
||||
@@ -82,7 +84,7 @@ public class EssentialsEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityDeath(final EntityDeathEvent event)
|
||||
{
|
||||
if (event instanceof PlayerDeathEvent)
|
||||
@@ -101,7 +103,7 @@ public class EssentialsEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
|
||||
@@ -110,7 +112,7 @@ public class EssentialsEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEntityRegainHealth(EntityRegainHealthEvent event)
|
||||
{
|
||||
if (event.getRegainReason() == RegainReason.SATIATED && event.getEntity() instanceof Player
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.craftbukkit.SetBed;
|
||||
import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.TextInput;
|
||||
@@ -17,15 +16,17 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class EssentialsPlayerListener extends PlayerListener
|
||||
public class EssentialsPlayerListener implements Listener
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private final transient Server server;
|
||||
@@ -37,7 +38,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
this.server = parent.getServer();
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -48,7 +49,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -74,7 +75,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerMove(final PlayerMoveEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
@@ -108,7 +109,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerQuit(final PlayerQuitEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -125,7 +126,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
user.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
ess.getBackup().onPlayerJoin();
|
||||
@@ -178,12 +179,11 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@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)
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Disconnecting user " + event.getPlayer().toString() + " due to " + event.getResult().toString());
|
||||
return;
|
||||
}
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
@@ -225,8 +225,8 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerTeleport(PlayerTeleportEvent event)
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerTeleport(final PlayerTeleportEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
@@ -247,19 +247,19 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
updateCompass(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerEggThrow(final PlayerEggThrowEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final ItemStack is = new ItemStack(Material.EGG, 1);
|
||||
if (user.hasUnlimited(is))
|
||||
final ItemStack stack = new ItemStack(Material.EGG, 1);
|
||||
if (user.hasUnlimited(stack))
|
||||
{
|
||||
user.getInventory().addItem(is);
|
||||
user.getInventory().addItem(stack);
|
||||
user.updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerBucketEmpty(final PlayerBucketEmptyEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -277,27 +277,27 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerAnimation(final PlayerAnimationEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
user.updateActivity(true);
|
||||
usePowertools(event);
|
||||
if (event.getAnimationType() == PlayerAnimationType.ARM_SWING
|
||||
&& user.hasPowerTools() && user.arePowerToolsEnabled())
|
||||
{
|
||||
usePowertools(user);
|
||||
}
|
||||
}
|
||||
|
||||
private void usePowertools(final PlayerAnimationEvent event)
|
||||
private void usePowertools(final User user)
|
||||
{
|
||||
if (event.getAnimationType() != PlayerAnimationType.ARM_SWING)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final ItemStack is = user.getItemInHand();
|
||||
if (is == null || is.getType() == Material.AIR || !user.arePowerToolsEnabled())
|
||||
int id;
|
||||
if (is == null || (id = is.getTypeId()) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final List<String> commandList = user.getPowertool(is);
|
||||
final List<String> commandList = user.getPowertool(id);
|
||||
if (commandList == null || commandList.isEmpty())
|
||||
{
|
||||
return;
|
||||
@@ -317,12 +317,12 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
else
|
||||
{
|
||||
user.getServer().dispatchCommand(event.getPlayer(), command);
|
||||
user.getServer().dispatchCommand(user.getBase(), command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
@@ -349,7 +349,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerChangedWorld(final PlayerChangedWorldEvent event)
|
||||
{
|
||||
if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName()))
|
||||
@@ -362,7 +362,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
@@ -376,11 +376,11 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
|
||||
if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK)
|
||||
{
|
||||
SetBed.setBed(event.getPlayer(), event.getClickedBlock());
|
||||
event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerPickupItem(PlayerPickupItemEvent event)
|
||||
{
|
||||
if (event.isCancelled() || !ess.getSettings().getDisableItemPickupWhileAfk())
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
|
||||
|
||||
public class EssentialsPluginListener extends ServerListener implements IConf
|
||||
public class EssentialsPluginListener implements Listener, IConf
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
|
||||
|
||||
public EssentialsPluginListener(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPluginEnable(final PluginEnableEvent event)
|
||||
{
|
||||
ess.getPermissionsHandler().checkPermissions();
|
||||
ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
|
||||
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager()))
|
||||
{
|
||||
LOGGER.log(Level.INFO, "[Essentials] Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
|
||||
ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPluginDisable(final PluginDisableEvent event)
|
||||
{
|
||||
ess.getPermissionsHandler().checkPermissions();
|
||||
@@ -37,7 +37,7 @@ public class EssentialsPluginListener extends ServerListener implements IConf
|
||||
if (ess.getPaymentMethod() != null && ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().checkDisabled(event.getPlugin()))
|
||||
{
|
||||
ess.getPaymentMethod().reset();
|
||||
LOGGER.log(Level.INFO, "[Essentials] Payment method was disabled. No longer accepting payments.");
|
||||
ess.getLogger().log(Level.INFO, "Payment method was disabled. No longer accepting payments.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.earth2me.essentials;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
@@ -22,10 +23,17 @@ public class EssentialsTimer implements Runnable
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
for (Player player : ess.getServer().getOnlinePlayers())
|
||||
{
|
||||
final User user = ess.getUser(player);
|
||||
onlineUsers.add(user);
|
||||
user.setLastOnlineActivity(currentTime);
|
||||
user.checkActivity();
|
||||
try
|
||||
{
|
||||
final User user = ess.getUser(player);
|
||||
onlineUsers.add(user);
|
||||
user.setLastOnlineActivity(currentTime);
|
||||
user.checkActivity();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ess.getLogger().log(Level.WARNING, "EssentialsTimer Error:", e);
|
||||
}
|
||||
}
|
||||
|
||||
final Iterator<User> iterator = onlineUsers.iterator();
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import com.earth2me.essentials.signs.EssentialsSign;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
|
||||
public interface ISettings extends IConf
|
||||
@@ -22,7 +24,7 @@ public interface ISettings extends IConf
|
||||
|
||||
long getBackupInterval();
|
||||
|
||||
String getChatFormat(String group);
|
||||
MessageFormat getChatFormat(String group);
|
||||
|
||||
int getChatRadius();
|
||||
|
||||
@@ -99,6 +101,8 @@ public interface ISettings extends IConf
|
||||
boolean isTradeInStacks(int id);
|
||||
|
||||
List<Integer> itemSpawnBlacklist();
|
||||
|
||||
List<EssentialsSign> enabledSigns();
|
||||
|
||||
boolean permissionBasedItemSpawn();
|
||||
|
||||
@@ -148,9 +152,9 @@ public interface ISettings extends IConf
|
||||
|
||||
boolean registerBackInListener();
|
||||
|
||||
public boolean getDisableItemPickupWhileAfk();
|
||||
boolean getDisableItemPickupWhileAfk();
|
||||
|
||||
public Priority getRespawnPriority();
|
||||
EventPriority getRespawnPriority();
|
||||
|
||||
long getTpaAcceptCancellation();
|
||||
}
|
||||
@@ -1,18 +1,24 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IJails;
|
||||
import com.earth2me.essentials.storage.AsyncStorageObjectHolder;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.block.*;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
@@ -33,13 +39,8 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
final PluginManager pluginManager = ess.getServer().getPluginManager();
|
||||
final JailBlockListener blockListener = new JailBlockListener();
|
||||
final JailPlayerListener playerListener = new JailPlayerListener();
|
||||
pluginManager.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Low, ess);
|
||||
pluginManager.registerEvent(Type.BLOCK_DAMAGE, blockListener, Priority.Low, ess);
|
||||
pluginManager.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Low, ess);
|
||||
pluginManager.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.Low, ess);
|
||||
pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, Priority.High, ess);
|
||||
pluginManager.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, ess);
|
||||
pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.High, ess);
|
||||
pluginManager.registerEvents(blockListener, ess);
|
||||
pluginManager.registerEvents(playerListener, ess);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,9 +147,9 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
|
||||
|
||||
private class JailBlockListener extends BlockListener
|
||||
private class JailBlockListener implements Listener
|
||||
{
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockBreak(final BlockBreakEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -158,7 +159,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockPlace(final BlockPlaceEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -168,7 +169,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockDamage(final BlockDamageEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -180,9 +181,9 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
|
||||
|
||||
private class JailPlayerListener extends PlayerListener
|
||||
private class JailPlayerListener implements Listener
|
||||
{
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -192,7 +193,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -207,11 +208,18 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("returnPlayerToJailError"), ex);
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerTeleport(final PlayerTeleportEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -226,12 +234,19 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("returnPlayerToJailError"), ex);
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("jailMessage"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
@@ -246,7 +261,14 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("returnPlayerToJailError"), ex);
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("jailMessage"));
|
||||
}
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.earth2me.essentials;
|
||||
import com.earth2me.essentials.craftbukkit.OfflineBedLocation;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
import lombok.Delegate;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
@@ -26,11 +23,11 @@ import org.bukkit.util.Vector;
|
||||
public class OfflinePlayer implements Player
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
private Location location = new Location(null, 0, 0, 0, 0, 0);
|
||||
private World world;
|
||||
private UUID uniqueId = UUID.randomUUID();
|
||||
private transient Location location = new Location(null, 0, 0, 0, 0, 0);
|
||||
private transient World world;
|
||||
private final transient UUID uniqueId = UUID.randomUUID();
|
||||
@Delegate(types = org.bukkit.OfflinePlayer.class)
|
||||
private final org.bukkit.OfflinePlayer base;
|
||||
private transient org.bukkit.OfflinePlayer base;
|
||||
|
||||
public OfflinePlayer(final String name, final IEssentials ess)
|
||||
{
|
||||
@@ -739,12 +736,6 @@ public class OfflinePlayer implements Player
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBedSpawnLocation()
|
||||
{
|
||||
return OfflineBedLocation.getBedLocation(base.getName(), ess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSprinting()
|
||||
{
|
||||
@@ -822,4 +813,48 @@ public class OfflinePlayer implements Player
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
void setName(final String name)
|
||||
{
|
||||
if (!this.base.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
this.base = ess.getServer().getOfflinePlayer(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPluginMessage(Plugin plugin, String string, byte[] bytes)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getListeningPluginChannels()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllowFlight(boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAllowFlight()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBedSpawnLocation(Location lctn)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(EntityEffect ee)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,15 @@ package com.earth2me.essentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import com.earth2me.essentials.signs.EssentialsSign;
|
||||
import com.earth2me.essentials.signs.Signs;
|
||||
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.event.Event.Priority;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
@@ -277,7 +280,7 @@ public class Settings implements ISettings
|
||||
@Override
|
||||
public boolean areSignsDisabled()
|
||||
{
|
||||
return config.getBoolean("signs-disabled", false);
|
||||
return enabledSigns.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -291,12 +294,27 @@ public class Settings implements ISettings
|
||||
{
|
||||
return config.getString("backup.command", null);
|
||||
}
|
||||
private Map<String, MessageFormat> chatFormats = new HashMap<String, MessageFormat>();
|
||||
|
||||
@Override
|
||||
public String getChatFormat(String group)
|
||||
public MessageFormat getChatFormat(String group)
|
||||
{
|
||||
return config.getString("chat.group-formats." + (group == null ? "Default" : group),
|
||||
config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}"));
|
||||
MessageFormat mFormat = chatFormats.get(group);
|
||||
if (mFormat == null)
|
||||
{
|
||||
String format = config.getString("chat.group-formats." + (group == null ? "Default" : group),
|
||||
config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}"));
|
||||
format = Util.replaceColor(format);
|
||||
format = format.replace("{DISPLAYNAME}", "%1$s");
|
||||
format = format.replace("{GROUP}", "{0}");
|
||||
format = format.replace("{MESSAGE}", "%2$s");
|
||||
format = format.replace("{WORLDNAME}", "{1}");
|
||||
format = format.replace("{SHORTWORLDNAME}", "{2}");
|
||||
format = format.replaceAll("\\{(\\D*)\\}", "\\[$1\\]");
|
||||
mFormat = new MessageFormat(format);
|
||||
chatFormats.put(group, mFormat);
|
||||
}
|
||||
return mFormat;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -340,24 +358,37 @@ public class Settings implements ISettings
|
||||
{
|
||||
config.load();
|
||||
noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds", Collections.<String>emptyList()));
|
||||
enabledSigns = getEnabledSigns();
|
||||
itemSpawnBl = getItemSpawnBlacklist();
|
||||
chatFormats.clear();
|
||||
}
|
||||
|
||||
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
|
||||
|
||||
@Override
|
||||
public List<Integer> itemSpawnBlacklist()
|
||||
{
|
||||
return itemSpawnBl;
|
||||
}
|
||||
|
||||
private List<Integer> getItemSpawnBlacklist()
|
||||
{
|
||||
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
||||
if (ess.getItemDb() == null) {
|
||||
logger.log(Level.FINE, "Aborting ItemSpawnBL read, itemDB not yet loaded.");
|
||||
return epItemSpwn;
|
||||
}
|
||||
for (String itemName : config.getString("item-spawn-blacklist", "").split(","))
|
||||
{
|
||||
itemName = itemName.trim();
|
||||
if (itemName.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ItemStack is;
|
||||
}
|
||||
try
|
||||
{
|
||||
is = ess.getItemDb().get(itemName);
|
||||
epItemSpwn.add(is.getTypeId());
|
||||
final ItemStack iStack = ess.getItemDb().get(itemName);
|
||||
epItemSpwn.add(iStack.getTypeId());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -366,6 +397,37 @@ public class Settings implements ISettings
|
||||
}
|
||||
return epItemSpwn;
|
||||
}
|
||||
|
||||
private List<EssentialsSign> enabledSigns = new ArrayList<EssentialsSign>();
|
||||
|
||||
@Override
|
||||
public List<EssentialsSign> enabledSigns()
|
||||
{
|
||||
return enabledSigns;
|
||||
}
|
||||
|
||||
private List<EssentialsSign> getEnabledSigns()
|
||||
{
|
||||
List<EssentialsSign> newSigns = new ArrayList<EssentialsSign>();
|
||||
|
||||
for (String signName : config.getStringList("enabledSigns", null))
|
||||
{
|
||||
signName = signName.trim().toUpperCase(Locale.ENGLISH);
|
||||
if (signName.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
newSigns.add(Signs.valueOf(signName).getSign());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns"));
|
||||
}
|
||||
}
|
||||
return newSigns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean spawnIfNoHome()
|
||||
@@ -542,7 +604,8 @@ public class Settings implements ISettings
|
||||
{
|
||||
return config.getBoolean("death-messages", true);
|
||||
}
|
||||
Set<String> noGodWorlds = new HashSet<String>();
|
||||
|
||||
private Set<String> noGodWorlds = new HashSet<String>();
|
||||
|
||||
@Override
|
||||
public Set<String> getNoGodWorlds()
|
||||
@@ -581,35 +644,35 @@ public class Settings implements ISettings
|
||||
}
|
||||
|
||||
@Override
|
||||
public Priority getRespawnPriority()
|
||||
public EventPriority getRespawnPriority()
|
||||
{
|
||||
String priority = config.getString("respawn-listener-priority", "normal").toLowerCase(Locale.ENGLISH);
|
||||
if ("lowest".equals(priority))
|
||||
{
|
||||
return Priority.Lowest;
|
||||
return EventPriority.LOWEST;
|
||||
}
|
||||
if ("low".equals(priority))
|
||||
{
|
||||
return Priority.Low;
|
||||
return EventPriority.LOW;
|
||||
}
|
||||
if ("normal".equals(priority))
|
||||
{
|
||||
return Priority.Normal;
|
||||
return EventPriority.NORMAL;
|
||||
}
|
||||
if ("high".equals(priority))
|
||||
{
|
||||
return Priority.High;
|
||||
return EventPriority.HIGH;
|
||||
}
|
||||
if ("highest".equals(priority))
|
||||
{
|
||||
return Priority.Highest;
|
||||
return EventPriority.HIGHEST;
|
||||
}
|
||||
return Priority.Normal;
|
||||
return EventPriority.NORMAL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getTpaAcceptCancellation()
|
||||
{
|
||||
return config.getLong("tpa-accept-cancellation", 0);
|
||||
return config.getLong("tpa-accept-cancellation", 0);
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.craftbukkit.FakeExplosion;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityListener;
|
||||
|
||||
|
||||
public class TNTExplodeListener extends EntityListener implements Runnable
|
||||
public class TNTExplodeListener implements Listener, Runnable
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
private transient boolean enabled = false;
|
||||
@@ -33,7 +35,7 @@ public class TNTExplodeListener extends EntityListener implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onEntityExplode(final EntityExplodeEvent event)
|
||||
{
|
||||
if (!enabled)
|
||||
|
||||
@@ -23,34 +23,37 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
private transient long lastOnlineActivity;
|
||||
private transient long lastActivity = System.currentTimeMillis();
|
||||
private boolean hidden = false;
|
||||
private transient Location afkPosition;
|
||||
private transient Location afkPosition = null;
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
|
||||
|
||||
User(final Player base, final IEssentials ess)
|
||||
{
|
||||
super(base, ess);
|
||||
teleport = new Teleport(this, ess);
|
||||
afkPosition = getLocation();
|
||||
if (isAfk())
|
||||
{
|
||||
afkPosition = getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
User update(final Player base)
|
||||
{
|
||||
setBase(base);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAuthorized(final IEssentialsCommand cmd)
|
||||
{
|
||||
return isAuthorized(cmd, "essentials.");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAuthorized(final IEssentialsCommand cmd, final String permissionPrefix)
|
||||
{
|
||||
return isAuthorized(permissionPrefix + (cmd.getName().equals("r") ? "msg" : cmd.getName()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAuthorized(final String node)
|
||||
{
|
||||
@@ -58,20 +61,20 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (isOp())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (isJailed())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return ess.getPermissionsHandler().hasPermission(base, node);
|
||||
}
|
||||
|
||||
|
||||
public void healCooldown() throws Exception
|
||||
{
|
||||
final Calendar now = new GregorianCalendar();
|
||||
@@ -89,13 +92,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
setLastHealTimestamp(now.getTimeInMillis());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void giveMoney(final double value)
|
||||
{
|
||||
giveMoney(value, null);
|
||||
}
|
||||
|
||||
|
||||
public void giveMoney(final double value, final CommandSender initiator)
|
||||
{
|
||||
if (value == 0)
|
||||
@@ -109,7 +112,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void payUser(final User reciever, final double value) throws Exception
|
||||
{
|
||||
if (value == 0)
|
||||
@@ -128,13 +131,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
throw new Exception(_("notEnoughMoney"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void takeMoney(final double value)
|
||||
{
|
||||
takeMoney(value, null);
|
||||
}
|
||||
|
||||
|
||||
public void takeMoney(final double value, final CommandSender initiator)
|
||||
{
|
||||
if (value == 0)
|
||||
@@ -148,36 +151,36 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean canAfford(final double cost)
|
||||
{
|
||||
final double mon = getMoney();
|
||||
return mon >= cost || isAuthorized("essentials.eco.loan");
|
||||
}
|
||||
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
this.base = new OfflinePlayer(getName(), ess);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setReplyTo(final CommandSender user)
|
||||
{
|
||||
replyTo = user;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CommandSender getReplyTo()
|
||||
{
|
||||
return replyTo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int compareTo(final User other)
|
||||
{
|
||||
return Util.stripColor(this.getDisplayName()).compareToIgnoreCase(Util.stripColor(other.getDisplayName()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object)
|
||||
{
|
||||
@@ -186,58 +189,58 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
return false;
|
||||
}
|
||||
return this.getName().equalsIgnoreCase(((User)object).getName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.getName().hashCode();
|
||||
}
|
||||
|
||||
|
||||
public Boolean canSpawnItem(final int itemId)
|
||||
{
|
||||
return !ess.getSettings().itemSpawnBlacklist().contains(itemId);
|
||||
}
|
||||
|
||||
|
||||
public Location getHome() throws Exception
|
||||
{
|
||||
return getHome(getHomes().get(0));
|
||||
}
|
||||
|
||||
|
||||
public void setHome()
|
||||
{
|
||||
setHome("home", getLocation());
|
||||
}
|
||||
|
||||
|
||||
public void setHome(final String name)
|
||||
{
|
||||
setHome(name, getLocation());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setLastLocation()
|
||||
{
|
||||
setLastLocation(getLocation());
|
||||
}
|
||||
|
||||
|
||||
public void requestTeleport(final User player, final boolean here)
|
||||
{
|
||||
teleportRequestTime = System.currentTimeMillis();
|
||||
teleportRequester = player;
|
||||
teleportRequestHere = here;
|
||||
}
|
||||
|
||||
|
||||
public User getTeleportRequest()
|
||||
{
|
||||
return teleportRequester;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTeleportRequestHere()
|
||||
{
|
||||
return teleportRequestHere;
|
||||
}
|
||||
|
||||
|
||||
public String getNick(boolean addprefixsuffix)
|
||||
{
|
||||
final StringBuilder nickname = new StringBuilder();
|
||||
@@ -261,7 +264,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (addprefixsuffix && ess.getSettings().addPrefixSuffix())
|
||||
{
|
||||
if (!ess.getSettings().disablePrefix())
|
||||
@@ -283,10 +286,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
nickname.append("§f");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return nickname.toString();
|
||||
}
|
||||
|
||||
|
||||
public void setDisplayNick()
|
||||
{
|
||||
String name = getNick(true);
|
||||
@@ -308,7 +311,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Use a shorter displayname prefix.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDisplayName()
|
||||
{
|
||||
@@ -318,22 +321,22 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
return super.getDisplayName() == null ? super.getName() : super.getDisplayName();
|
||||
}
|
||||
|
||||
|
||||
public Teleport getTeleport()
|
||||
{
|
||||
return teleport;
|
||||
}
|
||||
|
||||
|
||||
public long getLastOnlineActivity()
|
||||
{
|
||||
return lastOnlineActivity;
|
||||
}
|
||||
|
||||
|
||||
public void setLastOnlineActivity(final long timestamp)
|
||||
{
|
||||
lastOnlineActivity = timestamp;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getMoney()
|
||||
{
|
||||
@@ -355,7 +358,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
return super.getMoney();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setMoney(final double value)
|
||||
{
|
||||
@@ -377,7 +380,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
super.setMoney(value);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setAfk(final boolean set)
|
||||
{
|
||||
@@ -386,9 +389,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
afkPosition = getLocation();
|
||||
}
|
||||
else if (!set && isAfk())
|
||||
{
|
||||
afkPosition = null;
|
||||
}
|
||||
super.setAfk(set);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean toggleAfk()
|
||||
{
|
||||
@@ -396,13 +403,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : now);
|
||||
return now;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isHidden()
|
||||
{
|
||||
return hidden;
|
||||
}
|
||||
|
||||
|
||||
public void setHidden(final boolean hidden)
|
||||
{
|
||||
this.hidden = hidden;
|
||||
@@ -453,7 +460,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void updateActivity(final boolean broadcast)
|
||||
{
|
||||
if (isAfk())
|
||||
@@ -466,7 +473,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
lastActivity = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
||||
public void checkActivity()
|
||||
{
|
||||
final long autoafkkick = ess.getSettings().getAutoAfkKick();
|
||||
@@ -476,8 +483,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
final String kickReason = _("autoAfkKickReason", autoafkkick / 60.0);
|
||||
lastActivity = 0;
|
||||
kickPlayer(kickReason);
|
||||
|
||||
|
||||
|
||||
|
||||
for (Player player : ess.getServer().getOnlinePlayers())
|
||||
{
|
||||
final User user = ess.getUser(player);
|
||||
@@ -497,12 +504,12 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Location getAfkPosition()
|
||||
{
|
||||
return afkPosition;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean toggleGodModeEnabled()
|
||||
{
|
||||
@@ -512,36 +519,40 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
}
|
||||
return super.toggleGodModeEnabled();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isGodModeEnabled()
|
||||
{
|
||||
return (super.isGodModeEnabled() && !ess.getSettings().getNoGodWorlds().contains(getLocation().getWorld().getName()))
|
||||
|| (isAfk() && ess.getSettings().getFreezeAfkPlayers());
|
||||
}
|
||||
|
||||
|
||||
public boolean isGodModeEnabledRaw()
|
||||
{
|
||||
return super.isGodModeEnabled();
|
||||
}
|
||||
|
||||
|
||||
public String getGroup()
|
||||
{
|
||||
return ess.getPermissionsHandler().getGroup(base);
|
||||
}
|
||||
|
||||
|
||||
public boolean inGroup(final String group)
|
||||
{
|
||||
return ess.getPermissionsHandler().inGroup(base, group);
|
||||
}
|
||||
|
||||
|
||||
public boolean canBuild()
|
||||
{
|
||||
if (isOp())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return ess.getPermissionsHandler().canBuild(base, getGroup());
|
||||
}
|
||||
|
||||
|
||||
public long getTeleportRequestTime()
|
||||
{
|
||||
return teleportRequestTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
lastLogout = _getLastLogout();
|
||||
lastLoginAddress = _getLastLoginAddress();
|
||||
afk = getAfk();
|
||||
newplayer = getNew();
|
||||
geolocation = _getGeoLocation();
|
||||
isSocialSpyEnabled = _isSocialSpyEnabled();
|
||||
isNPC = _isNPC();
|
||||
@@ -265,6 +264,11 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
{
|
||||
return (List<String>)powertools.get(stack.getTypeId());
|
||||
}
|
||||
|
||||
public List<String> getPowertool(int id)
|
||||
{
|
||||
return (List<String>)powertools.get(id);
|
||||
}
|
||||
|
||||
public void setPowertool(ItemStack stack, List<String> commandList)
|
||||
{
|
||||
@@ -736,22 +740,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
}
|
||||
private boolean newplayer;
|
||||
|
||||
private boolean getNew()
|
||||
{
|
||||
return config.getBoolean("newplayer", true);
|
||||
}
|
||||
|
||||
public boolean isNew()
|
||||
{
|
||||
return newplayer;
|
||||
}
|
||||
|
||||
public void setNew(boolean set)
|
||||
{
|
||||
newplayer = set;
|
||||
config.setProperty("newplayer", set);
|
||||
config.save();
|
||||
}
|
||||
private String geolocation;
|
||||
|
||||
private String _getGeoLocation()
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.util.concurrent.UncheckedExecutionException;
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -47,7 +46,7 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
continue;
|
||||
}
|
||||
final String name = string.substring(0, string.length() - 4);
|
||||
keys.add(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.add(Util.sanitizeFileName(name));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -55,14 +54,14 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
|
||||
public boolean userExists(final String name)
|
||||
{
|
||||
return keys.contains(name.toLowerCase(Locale.ENGLISH));
|
||||
return keys.contains(Util.sanitizeFileName(name));
|
||||
}
|
||||
|
||||
public User getUser(final String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return users.get(name.toLowerCase(Locale.ENGLISH));
|
||||
return users.get(Util.sanitizeFileName(name));
|
||||
}
|
||||
catch (ExecutionException ex)
|
||||
{
|
||||
@@ -81,14 +80,14 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
{
|
||||
if (player.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
keys.add(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.add(Util.sanitizeFileName(name));
|
||||
return new User(player, ess);
|
||||
}
|
||||
}
|
||||
final File userFile = getUserFile(name);
|
||||
if (userFile.exists())
|
||||
{
|
||||
keys.add(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.add(Util.sanitizeFileName(name));
|
||||
return new User(new OfflinePlayer(name, ess), ess);
|
||||
}
|
||||
throw new Exception("User not found!");
|
||||
@@ -102,8 +101,8 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
|
||||
public void removeUser(final String name)
|
||||
{
|
||||
keys.remove(name.toLowerCase(Locale.ENGLISH));
|
||||
users.invalidate(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.remove(Util.sanitizeFileName(name));
|
||||
users.invalidate(Util.sanitizeFileName(name));
|
||||
}
|
||||
|
||||
public Set<String> getAllUniqueUsers()
|
||||
|
||||
@@ -21,10 +21,17 @@ public class Util
|
||||
{
|
||||
}
|
||||
private final static Logger logger = Logger.getLogger("Minecraft");
|
||||
private final static Pattern INVALIDFILECHARS = Pattern.compile("[^a-z0-9]");
|
||||
private final static Pattern INVALIDCHARS = Pattern.compile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");;
|
||||
|
||||
public static String sanitizeFileName(String name)
|
||||
public static String sanitizeFileName(final String name)
|
||||
{
|
||||
return name.toLowerCase(Locale.ENGLISH).replaceAll("[^a-z0-9]", "_");
|
||||
return INVALIDFILECHARS.matcher(name.toLowerCase(Locale.ENGLISH)).replaceAll("_");
|
||||
}
|
||||
|
||||
public static String sanitizeString(final String string)
|
||||
{
|
||||
return INVALIDCHARS.matcher(string).replaceAll("");
|
||||
}
|
||||
|
||||
public static String formatDateDiff(long date)
|
||||
@@ -477,7 +484,8 @@ public class Util
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
private static transient final Pattern COLOR_PATTERN = Pattern.compile("(?i)\u00A7[0-9A-F]");
|
||||
private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-FKa-fk]");
|
||||
private static transient final Pattern EASY_COLOR_PATTERN = Pattern.compile("&([0-9a-fk])");
|
||||
|
||||
public static String stripColor(final String input)
|
||||
{
|
||||
@@ -486,6 +494,16 @@ public class Util
|
||||
return null;
|
||||
}
|
||||
|
||||
return COLOR_PATTERN.matcher(input).replaceAll("");
|
||||
return VANILLA_COLOR_PATTERN.matcher(input).replaceAll("");
|
||||
}
|
||||
|
||||
public static String replaceColor(final String input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return EASY_COLOR_PATTERN.matcher(input).replaceAll("\u00a7$1");
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
final User user = ess.getUserMap().getUser(u);
|
||||
if (user != null)
|
||||
{
|
||||
balances.put(u, user.getMoney());
|
||||
balances.put(user.getDisplayName(), user.getMoney());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Commanddelhome extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -24,7 +24,18 @@ public class Commanddelhome extends EssentialsCommand
|
||||
|
||||
User user = ess.getUser(sender);
|
||||
String name;
|
||||
final String[] expandedArg = args[0].split(":");
|
||||
String[] expandedArg;
|
||||
|
||||
//Allowing both formats /sethome khobbits house | /sethome khobbits:house
|
||||
final String[] nameParts = args[0].split(":");
|
||||
if (nameParts[0].length() != args[0].length())
|
||||
{
|
||||
expandedArg = nameParts;
|
||||
}
|
||||
else
|
||||
{
|
||||
expandedArg = args;
|
||||
}
|
||||
|
||||
if (expandedArg.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
|
||||
{
|
||||
@@ -41,9 +52,7 @@ public class Commanddelhome extends EssentialsCommand
|
||||
}
|
||||
//TODO: Think up a nice error message
|
||||
/*
|
||||
* if (name.equalsIgnoreCase("bed")) {
|
||||
* throw new Exception("You cannot remove the vanilla home point");
|
||||
* }
|
||||
* if (name.equalsIgnoreCase("bed")) { throw new Exception("You cannot remove the vanilla home point"); }
|
||||
*/
|
||||
user.delHome(name.toLowerCase(Locale.ENGLISH));
|
||||
sender.sendMessage(_("deleteHome", name));
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Commandhelp extends EssentialsCommand
|
||||
output = new KeywordReplacer(input, user, ess);
|
||||
}
|
||||
final TextPager pager = new TextPager(output);
|
||||
pager.showPage(pageStr, chapterPageStr, "help", user);
|
||||
pager.showPage(pageStr, chapterPageStr, commandLabel, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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.logging.Level;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -22,7 +23,7 @@ public class Commandhelpop extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final String message = _("helpOp", user.getDisplayName(), getFinalArg(args, 0));
|
||||
final String message = _("helpOp", user.getDisplayName(), Util.stripColor(getFinalArg(args, 0)));
|
||||
logger.log(Level.INFO, message);
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.earth2me.essentials.Util;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
@@ -47,27 +48,31 @@ public class Commandhome extends EssentialsCommand
|
||||
if ("bed".equalsIgnoreCase(homeName))
|
||||
{
|
||||
final Location bed = player.getBedSpawnLocation();
|
||||
if (bed != null)
|
||||
if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
|
||||
{
|
||||
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
|
||||
return;
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge);
|
||||
}
|
||||
catch (NotEnoughArgumentsException e)
|
||||
{
|
||||
Location bed = player.getBedSpawnLocation();
|
||||
if (bed != null && bed.getBlock().getType() != Material.BED_BLOCK)
|
||||
{
|
||||
bed = null;
|
||||
}
|
||||
final List<String> homes = player.getHomes();
|
||||
if (homes.isEmpty() && player.equals(user))
|
||||
{
|
||||
final Location bed = player.getBedSpawnLocation();
|
||||
if (bed != null)
|
||||
{
|
||||
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
|
||||
return;
|
||||
throw new NoChargeException();
|
||||
}
|
||||
user.getTeleport().respawn(charge, TeleportCause.COMMAND);
|
||||
return;
|
||||
|
||||
}
|
||||
else if (homes.isEmpty())
|
||||
{
|
||||
@@ -76,11 +81,13 @@ public class Commandhome extends EssentialsCommand
|
||||
else if (homes.size() == 1 && player.equals(user))
|
||||
{
|
||||
user.getTeleport().home(player, homes.get(0), charge);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
homes.add("bed");
|
||||
if (bed != null)
|
||||
{
|
||||
homes.add("bed");
|
||||
}
|
||||
user.sendMessage(_("homes", Util.joinList(homes)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ public class Commandinfo extends EssentialsCommand
|
||||
final IText input = new TextInput(sender, "info", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, "info", sender);
|
||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ public class Commanditemdb extends EssentialsCommand
|
||||
{
|
||||
public Commanditemdb()
|
||||
{
|
||||
super("find");
|
||||
super("itemdb");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,7 @@ public class Commandkill extends EssentialsCommand
|
||||
continue;
|
||||
}
|
||||
|
||||
matchPlayer.damage(1000);
|
||||
matchPlayer.setHealth(0);
|
||||
sender.sendMessage(_("kill", matchPlayer.getDisplayName()));
|
||||
}
|
||||
|
||||
@@ -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.List;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Server;
|
||||
@@ -39,7 +40,7 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
if (!user.isAuthorized("essentials.mail.send"))
|
||||
{
|
||||
throw new Exception(_("noPerm","essentials.mail.send"));
|
||||
throw new Exception(_("noPerm", "essentials.mail.send"));
|
||||
}
|
||||
|
||||
Player player = server.getPlayer(args[1]);
|
||||
@@ -58,7 +59,8 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
if (!u.isIgnoredPlayer(user.getName()))
|
||||
{
|
||||
u.addMail(user.getName() + ": " + getFinalArg(args, 2));
|
||||
final String mail = Util.sanitizeString(Util.stripColor(getFinalArg(args, 2)));
|
||||
u.addMail(user.getName() + ": " + mail);
|
||||
}
|
||||
user.sendMessage(_("mailSent"));
|
||||
return;
|
||||
@@ -67,9 +69,9 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
if (!user.isAuthorized("essentials.mail.sendall"))
|
||||
{
|
||||
throw new Exception(_("noPerm","essentials.mail.sendall"));
|
||||
throw new Exception(_("noPerm", "essentials.mail.sendall"));
|
||||
}
|
||||
ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + getFinalArg(args, 1)));
|
||||
ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + Util.stripColor(getFinalArg(args, 1))));
|
||||
user.sendMessage(_("mailSent"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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 org.bukkit.Server;
|
||||
|
||||
|
||||
@@ -28,8 +29,12 @@ public class Commandme extends EssentialsCommand
|
||||
String message = getFinalArg(args, 0);
|
||||
if (user.isAuthorized("essentials.chat.color"))
|
||||
{
|
||||
message = message.replaceAll("&([0-9a-f])", "§$1");
|
||||
message = Util.replaceColor(message);
|
||||
}
|
||||
else {
|
||||
message = Util.stripColor(message);
|
||||
}
|
||||
|
||||
|
||||
ess.broadcastMessage(user, _("action", user.getDisplayName(), message));
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ public class Commandmotd extends EssentialsCommand
|
||||
final IText input = new TextInput(sender, "motd", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
final TextPager pager = new TextPager(output);
|
||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, "motd", sender);
|
||||
pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IReplyTo;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -25,6 +26,7 @@ public class Commandmsg extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
String message = getFinalArg(args, 1);
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
User user = ess.getUser(sender);
|
||||
@@ -32,13 +34,24 @@ public class Commandmsg extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("voiceSilenced"));
|
||||
}
|
||||
if (user.isAuthorized("essentials.msg.color"))
|
||||
{
|
||||
message = Util.replaceColor(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
message = Util.stripColor(message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = Util.replaceColor(message);
|
||||
}
|
||||
|
||||
String message = getFinalArg(args, 1);
|
||||
String translatedMe = _("me");
|
||||
final String translatedMe = _("me");
|
||||
|
||||
IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo();
|
||||
String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
|
||||
final IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo();
|
||||
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
|
||||
|
||||
if (args[0].equalsIgnoreCase(Console.NAME))
|
||||
{
|
||||
@@ -50,38 +63,38 @@ public class Commandmsg extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
List<Player> matches = server.matchPlayer(args[0]);
|
||||
final List<Player> matchedPlayers = server.matchPlayer(args[0]);
|
||||
|
||||
if (matches.isEmpty())
|
||||
if (matchedPlayers.isEmpty())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (Player p : matches)
|
||||
for (Player matchedPlayer : matchedPlayers)
|
||||
{
|
||||
final User u = ess.getUser(p);
|
||||
final User u = ess.getUser(matchedPlayer);
|
||||
if (u.isHidden())
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i == matches.size())
|
||||
if (i == matchedPlayers.size())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
}
|
||||
|
||||
for (Player p : matches)
|
||||
for (Player matchedPlayer : matchedPlayers)
|
||||
{
|
||||
sender.sendMessage(_("msgFormat", translatedMe, p.getDisplayName(), message));
|
||||
final User u = ess.getUser(p);
|
||||
if (sender instanceof Player && (u.isIgnoredPlayer(((Player)sender).getName()) || u.isHidden()))
|
||||
sender.sendMessage(_("msgFormat", translatedMe, matchedPlayer.getDisplayName(), message));
|
||||
final User matchedUser = ess.getUser(matchedPlayer);
|
||||
if (sender instanceof Player && (matchedUser.isIgnoredPlayer(((Player)sender).getName()) || matchedUser.isHidden()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
p.sendMessage(_("msgFormat", senderName, translatedMe, message));
|
||||
replyTo.setReplyTo(ess.getUser(p));
|
||||
ess.getUser(p).setReplyTo(sender);
|
||||
matchedPlayer.sendMessage(_("msgFormat", senderName, translatedMe, message));
|
||||
replyTo.setReplyTo(ess.getUser(matchedPlayer));
|
||||
ess.getUser(matchedPlayer).setReplyTo(sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,40 +15,40 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
super("near");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
long radius = 200;
|
||||
User otherUser = null;
|
||||
|
||||
|
||||
if (args.length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
radius = Long.parseLong(args[0]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
try
|
||||
{
|
||||
radius = Long.parseLong(args[0]);
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (args.length > 1 && otherUser != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
radius = Long.parseLong(args[1]);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (args.length > 1 && otherUser != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
radius = Long.parseLong(args[1]);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
||||
{
|
||||
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
|
||||
@@ -58,20 +58,15 @@ public class Commandnear extends EssentialsCommand
|
||||
user.sendMessage(_("noAccessCommand"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
User otherUser = null;
|
||||
if (args.length > 0)
|
||||
{
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
}
|
||||
else
|
||||
if (args.length == 0)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final User otherUser = getPlayer(server, args, 0);
|
||||
long radius = 200;
|
||||
if (args.length > 1)
|
||||
{
|
||||
@@ -85,14 +80,14 @@ public class Commandnear extends EssentialsCommand
|
||||
}
|
||||
sender.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius)));
|
||||
}
|
||||
|
||||
|
||||
private String getLocal(final Server server, final User user, final long radius)
|
||||
{
|
||||
final Location loc = user.getLocation();
|
||||
final World world = loc.getWorld();
|
||||
final StringBuilder output = new StringBuilder();
|
||||
final long radiusSquared = radius * radius;
|
||||
|
||||
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final User player = ess.getUser(onlinePlayer);
|
||||
@@ -103,7 +98,7 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
final long delta = (long)playerLoc.distanceSquared(loc);
|
||||
if (delta < radiusSquared)
|
||||
{
|
||||
|
||||
@@ -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.Locale;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -65,9 +66,10 @@ public class Commandnick extends EssentialsCommand
|
||||
{
|
||||
if (user == null || user.isAuthorized("essentials.nick.color"))
|
||||
{
|
||||
return nick.replace('&', '\u00a7').replace("\u00a7\u00a7", "&");
|
||||
return nick.replace('&', '\u00a7').replaceAll("\u00a7+k", "");
|
||||
} else {
|
||||
return Util.stripColor(nick);
|
||||
}
|
||||
return nick;
|
||||
}
|
||||
|
||||
private void resetAllNicknames(final Server server)
|
||||
@@ -86,7 +88,7 @@ public class Commandnick extends EssentialsCommand
|
||||
|
||||
private void setNickname(final Server server, final User target, final String nick) throws Exception
|
||||
{
|
||||
if (nick.matches("[^a-zA-Z_0-9]"))
|
||||
if (!nick.matches("^[a-zA-Z_0-9\u00a7]+$"))
|
||||
{
|
||||
throw new Exception(_("nickNamesAlpha"));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -43,7 +44,7 @@ public class Commandnuke extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
player.sendMessage("May death rain upon them");
|
||||
player.sendMessage(_("nuke"));
|
||||
final Location loc = player.getLocation();
|
||||
final World world = loc.getWorld();
|
||||
for (int x = -10; x <= 10; x += 5)
|
||||
|
||||
@@ -21,6 +21,11 @@ public class Commandpay extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
if (args[0] == "")
|
||||
{
|
||||
throw new NotEnoughArgumentsException("You need to specify a player to pay.");
|
||||
}
|
||||
|
||||
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IReplyTo;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -24,13 +25,35 @@ public class Commandr extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final String message = getFinalArg(args, 0);
|
||||
final IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo();
|
||||
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
|
||||
String message = getFinalArg(args, 0);
|
||||
IReplyTo replyTo;
|
||||
String senderName;
|
||||
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
User user = ess.getUser(sender);
|
||||
if (user.isAuthorized("essentials.msg.color"))
|
||||
{
|
||||
message = Util.replaceColor(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
message = Util.stripColor(message);
|
||||
}
|
||||
replyTo = user;
|
||||
senderName = user.getDisplayName();
|
||||
}
|
||||
else
|
||||
{
|
||||
message = Util.replaceColor(message);
|
||||
replyTo = Console.getConsoleReplyTo();
|
||||
senderName = Console.NAME;
|
||||
}
|
||||
|
||||
final CommandSender target = replyTo.getReplyTo();
|
||||
final String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME;
|
||||
|
||||
if (target == null)
|
||||
if (target == null || ((target instanceof Player) && !((Player)target).isOnline()))
|
||||
{
|
||||
throw new Exception(_("foreverAlone"));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class Commandrepair extends EssentialsCommand
|
||||
private void repairItem(final ItemStack item) throws Exception
|
||||
{
|
||||
final Material material = Material.getMaterial(item.getTypeId());
|
||||
if (material.isBlock() || material.getMaxDurability() < 0)
|
||||
if (material.isBlock() || material.getMaxDurability() < 1)
|
||||
{
|
||||
throw new Exception(_("repairInvalidType"));
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ public class Commandsethome extends EssentialsCommand
|
||||
{
|
||||
if (user.isAuthorized("essentials.sethome.multiple"))
|
||||
{
|
||||
if ("bed".equals(args[0].toLowerCase(Locale.ENGLISH))) {
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getHomeLimit(user))
|
||||
|| (user.getHomes().contains(args[0].toLowerCase(Locale.ENGLISH))))
|
||||
{
|
||||
@@ -63,6 +66,9 @@ public class Commandsethome extends EssentialsCommand
|
||||
{
|
||||
name = "home";
|
||||
}
|
||||
if ("bed".equals(name.toLowerCase(Locale.ENGLISH))) {
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
usersHome.setHome(name, user.getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
||||
|
||||
public class Commandsuicide extends EssentialsCommand
|
||||
@@ -15,9 +16,11 @@ 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);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
user.damage(1000);
|
||||
user.setHealth(0);
|
||||
user.sendMessage(_("suicideMessage"));
|
||||
ess.broadcastMessage(user,
|
||||
_("suicideSuccess", user.getDisplayName()));
|
||||
ess.broadcastMessage(user,_("suicideSuccess", user.getDisplayName()));
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,11 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
if (args.length > 0 && !target.getName().contains(args[0]))
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
long timeout = ess.getSettings().getTpaAcceptCancellation();
|
||||
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.earth2me.essentials.craftbukkit;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Biome;
|
||||
@@ -10,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.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
|
||||
@@ -521,4 +524,34 @@ public class FakeWorld implements World
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Collection<T> getEntitiesByClass(Class<T>... types)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldType getWorldType()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPluginMessage(Plugin plugin, String string, byte[] bytes)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getListeningPluginChannels()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGenerateStructures()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.earth2me.essentials.craftbukkit;
|
||||
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
|
||||
public class ItemDupeFix extends PlayerListener
|
||||
{
|
||||
@Override
|
||||
public void onPlayerTeleport(final PlayerTeleportEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
final CraftPlayer player = (CraftPlayer)event.getPlayer();
|
||||
final EntityPlayer entity = player.getHandle();
|
||||
if (entity.activeContainer != entity.defaultContainer)
|
||||
{
|
||||
entity.closeInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.earth2me.essentials.craftbukkit;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.ChunkCoordinates;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class SetBed
|
||||
{
|
||||
public static void setBed(final Player player, final Block block)
|
||||
{
|
||||
try
|
||||
{
|
||||
final CraftPlayer cplayer = (CraftPlayer)player;
|
||||
cplayer.getHandle().a(new ChunkCoordinates(block.getX(), block.getY(), block.getZ()));
|
||||
}
|
||||
catch (Throwable ex)
|
||||
{
|
||||
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,23 +7,23 @@ import org.bukkit.plugin.PluginManager;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>Methods</code> initializes Methods that utilize the Method interface
|
||||
* based on a "first come, first served" basis.
|
||||
* The
|
||||
* <code>Methods</code> initializes Methods that utilize the Method interface based on a "first come, first served"
|
||||
* basis.
|
||||
*
|
||||
* Allowing you to check whether a payment method exists or not.
|
||||
*
|
||||
* Methods also allows you to set a preferred method of payment before it captures
|
||||
* payment plugins in the initialization process.
|
||||
* Methods also allows you to set a preferred method of payment before it captures payment plugins in the initialization
|
||||
* process.
|
||||
*
|
||||
* in <code>bukkit.yml</code>:
|
||||
* <blockquote><pre>
|
||||
* in
|
||||
* <code>bukkit.yml</code>: <blockquote><pre>
|
||||
* economy:
|
||||
* preferred: "iConomy"
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @author: Nijikokun <nijikokun@shortmail.com> (@nijikokun)
|
||||
* @copyright: Copyright (C) 2011
|
||||
* @license: AOL license <http://aol.nexua.org>
|
||||
* @author: Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright: Copyright (C) 2011 @license: AOL license
|
||||
* <http://aol.nexua.org>
|
||||
*/
|
||||
public class Methods
|
||||
{
|
||||
@@ -52,6 +52,7 @@ public class Methods
|
||||
addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE7());
|
||||
addMethod("Currency", new com.earth2me.essentials.register.payment.methods.MCUR());
|
||||
Dependencies.add("MultiCurrency");
|
||||
addMethod("Vault", new com.earth2me.essentials.register.payment.methods.VaultEco());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,6 +79,7 @@ public class Methods
|
||||
|
||||
/**
|
||||
* Use to get version of Register plugin
|
||||
*
|
||||
* @return version
|
||||
*/
|
||||
public static String getVersion()
|
||||
@@ -86,10 +88,11 @@ public class Methods
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of payment method names that have been loaded
|
||||
* through the <code>_init</code> method.
|
||||
* Returns an array of payment method names that have been loaded through the
|
||||
* <code>_init</code> method.
|
||||
*
|
||||
* @return <code>Set<String></code> - Array of payment methods that are loaded.
|
||||
* @return
|
||||
* <code>Set<String></code> - Array of payment methods that are loaded.
|
||||
* @see #setMethod(org.bukkit.plugin.Plugin)
|
||||
*/
|
||||
public static Set<String> getDependencies()
|
||||
@@ -98,8 +101,8 @@ public class Methods
|
||||
}
|
||||
|
||||
/**
|
||||
* Interprets Plugin class data to verify whether it is compatible with an existing payment
|
||||
* method to use for payments and other various economic activity.
|
||||
* Interprets Plugin class data to verify whether it is compatible with an existing payment method to use for
|
||||
* payments and other various economic activity.
|
||||
*
|
||||
* @param plugin Plugin data from bukkit, Internal Class file.
|
||||
* @return Method <em>or</em> Null
|
||||
@@ -127,7 +130,8 @@ public class Methods
|
||||
/**
|
||||
* Verifies if Register has set a payment method for usage yet.
|
||||
*
|
||||
* @return <code>boolean</code>
|
||||
* @return
|
||||
* <code>boolean</code>
|
||||
* @see #setMethod(org.bukkit.plugin.Plugin)
|
||||
* @see #checkDisabled(org.bukkit.plugin.Plugin)
|
||||
*/
|
||||
@@ -137,11 +141,11 @@ public class Methods
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks Plugin Class against a multitude of checks to verify it's usability
|
||||
* as a payment method.
|
||||
* Checks Plugin Class against a multitude of checks to verify it's usability as a payment method.
|
||||
*
|
||||
* @param <code>PluginManager</code> the plugin manager for the server
|
||||
* @return <code>boolean</code> True on success, False on failure.
|
||||
* @return
|
||||
* <code>boolean</code> True on success, False on failure.
|
||||
*/
|
||||
public static boolean setMethod(PluginManager manager)
|
||||
{
|
||||
@@ -242,7 +246,8 @@ public class Methods
|
||||
/**
|
||||
* Sets the preferred economy
|
||||
*
|
||||
* @return <code>boolean</code>
|
||||
* @return
|
||||
* <code>boolean</code>
|
||||
*/
|
||||
public static boolean setPreferred(String check)
|
||||
{
|
||||
@@ -258,7 +263,9 @@ public class Methods
|
||||
/**
|
||||
* Grab the existing and initialized (hopefully) Method Class.
|
||||
*
|
||||
* @return <code>Method</code> <em>or</em> <code>Null</code>
|
||||
* @return
|
||||
* <code>Method</code> <em>or</em>
|
||||
* <code>Null</code>
|
||||
*/
|
||||
public static Method getMethod()
|
||||
{
|
||||
@@ -266,11 +273,11 @@ public class Methods
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify is a plugin is disabled, only does this if we there is an existing payment
|
||||
* method initialized in Register.
|
||||
* Verify is a plugin is disabled, only does this if we there is an existing payment method initialized in Register.
|
||||
*
|
||||
* @param method Plugin data from bukkit, Internal Class file.
|
||||
* @return <code>boolean</code>
|
||||
* @return
|
||||
* <code>boolean</code>
|
||||
*/
|
||||
public static boolean checkDisabled(Plugin method)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import net.milkbowl.vault.Vault;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
|
||||
|
||||
public class VaultEco implements Method
|
||||
{
|
||||
private Vault vault;
|
||||
private Economy economy;
|
||||
|
||||
@Override
|
||||
public Vault getPlugin()
|
||||
{
|
||||
return this.vault;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name, Double amount)
|
||||
{
|
||||
if (hasAccount(name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
|
||||
return this.vault.getDescription().getName().concat(" - Economy: ").concat(economy == null ? "NoEco" : economy.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion()
|
||||
{
|
||||
return this.vault.getDescription().getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(double amount)
|
||||
{
|
||||
return this.economy.format(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBanks()
|
||||
{
|
||||
return this.economy.hasBankSupport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return this.economy.getBanks().contains(bank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return this.economy.hasAccount(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return this.economy.isBankOwner(bank, name).transactionSuccess()
|
||||
|| this.economy.isBankMember(bank, name).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name)
|
||||
{
|
||||
return this.economy.createBank(name, "").transactionSuccess();
|
||||
}
|
||||
|
||||
public boolean createAccount(String name, double balance)
|
||||
{
|
||||
if (!this.economy.createBank(name, "").transactionSuccess())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this.economy.bankDeposit(name, balance).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
if (!hasAccount(name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new VaultAccount(name, this.economy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
if (!hasBankAccount(bank, name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new VaultBankAccount(bank, economy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegisteredServiceProvider<Economy> ecoPlugin = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
return plugin instanceof Vault && ecoPlugin != null && !ecoPlugin.getProvider().getName().equals("Essentials Economy");
|
||||
}
|
||||
catch (LinkageError e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlugin(Plugin plugin)
|
||||
{
|
||||
this.vault = (Vault)plugin;
|
||||
RegisteredServiceProvider<Economy> economyProvider = this.vault.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
if (economyProvider != null)
|
||||
{
|
||||
this.economy = economyProvider.getProvider();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class VaultAccount implements MethodAccount
|
||||
{
|
||||
private final String name;
|
||||
private final Economy economy;
|
||||
|
||||
public VaultAccount(String name, Economy economy)
|
||||
{
|
||||
this.name = name;
|
||||
this.economy = economy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance()
|
||||
{
|
||||
return this.economy.getBalance(this.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount)
|
||||
{
|
||||
if (!this.economy.withdrawPlayer(this.name, this.balance()).transactionSuccess())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (amount == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return this.economy.depositPlayer(this.name, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount)
|
||||
{
|
||||
return this.economy.depositPlayer(this.name, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
return this.economy.withdrawPlayer(this.name, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.set(balance * amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.set(balance / amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative()
|
||||
{
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove()
|
||||
{
|
||||
return this.set(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class VaultBankAccount implements MethodBankAccount
|
||||
{
|
||||
private final String bank;
|
||||
private final Economy economy;
|
||||
|
||||
public VaultBankAccount(String bank, Economy economy)
|
||||
{
|
||||
this.bank = bank;
|
||||
this.economy = economy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBankName()
|
||||
{
|
||||
return this.bank;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBankId()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance()
|
||||
{
|
||||
return this.economy.bankBalance(this.bank).balance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount)
|
||||
{
|
||||
if (!this.economy.bankWithdraw(this.bank, this.balance()).transactionSuccess())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (amount == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return this.economy.bankDeposit(this.bank, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount)
|
||||
{
|
||||
return this.economy.bankDeposit(this.bank, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
return this.economy.bankWithdraw(this.bank, amount).transactionSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.set(balance * amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.set(balance / amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative()
|
||||
{
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove()
|
||||
{
|
||||
return this.set(0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,13 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.*;
|
||||
|
||||
|
||||
public class SignBlockListener extends BlockListener
|
||||
public class SignBlockListener implements Listener
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
private final static Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
@@ -21,7 +24,7 @@ public class SignBlockListener extends BlockListener
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onBlockBreak(final BlockBreakEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
@@ -41,9 +44,9 @@ public class SignBlockListener extends BlockListener
|
||||
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
|
||||
{
|
||||
final Sign csign = (Sign)block.getState();
|
||||
for (Signs signs : Signs.values())
|
||||
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName())
|
||||
&& !sign.onSignBreak(block, player, ess))
|
||||
{
|
||||
@@ -59,9 +62,8 @@ public class SignBlockListener extends BlockListener
|
||||
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
||||
return true;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockBreak(block, player, ess))
|
||||
{
|
||||
@@ -73,7 +75,7 @@ public class SignBlockListener extends BlockListener
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onSignChange(final SignChangeEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
@@ -105,7 +107,7 @@ public class SignBlockListener extends BlockListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockPlace(final BlockPlaceEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
@@ -139,7 +141,7 @@ public class SignBlockListener extends BlockListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockBurn(final BlockBurnEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
@@ -156,9 +158,8 @@ public class SignBlockListener extends BlockListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockBurn(block, ess))
|
||||
{
|
||||
@@ -168,7 +169,7 @@ public class SignBlockListener extends BlockListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockIgnite(final BlockIgniteEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
@@ -185,9 +186,8 @@ public class SignBlockListener extends BlockListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockIgnite(block, ess))
|
||||
{
|
||||
@@ -197,7 +197,7 @@ public class SignBlockListener extends BlockListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockPistonExtend(final BlockPistonExtendEvent event)
|
||||
{
|
||||
for (Block block : event.getBlocks())
|
||||
@@ -210,9 +210,8 @@ public class SignBlockListener extends BlockListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockPush(block, ess))
|
||||
{
|
||||
@@ -223,7 +222,7 @@ public class SignBlockListener extends BlockListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onBlockPistonRetract(final BlockPistonRetractEvent event)
|
||||
{
|
||||
if (event.isSticky())
|
||||
@@ -237,9 +236,8 @@ public class SignBlockListener extends BlockListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockPush(block, ess))
|
||||
{
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.earth2me.essentials.signs;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EndermanPickupEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityListener;
|
||||
|
||||
|
||||
public class SignEntityListener extends EntityListener
|
||||
public class SignEntityListener implements Listener
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
|
||||
@@ -17,7 +19,7 @@ public class SignEntityListener extends EntityListener
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onEntityExplode(final EntityExplodeEvent event)
|
||||
{
|
||||
for (Block block : event.blockList())
|
||||
@@ -30,9 +32,8 @@ public class SignEntityListener extends EntityListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType()))
|
||||
{
|
||||
event.setCancelled(!sign.onBlockExplode(block, ess));
|
||||
@@ -42,8 +43,8 @@ public class SignEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndermanPickup(EndermanPickupEvent event)
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onEndermanPickup(final EndermanPickupEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
@@ -59,9 +60,8 @@ public class SignEntityListener extends EntityListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockBreak(block, ess))
|
||||
{
|
||||
|
||||
@@ -4,22 +4,24 @@ import com.earth2me.essentials.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
|
||||
|
||||
public class SignPlayerListener extends PlayerListener
|
||||
public class SignPlayerListener implements Listener
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public SignPlayerListener(IEssentials ess)
|
||||
public SignPlayerListener(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerInteract(PlayerInteractEvent event)
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerInteract(final PlayerInteractEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
@@ -39,9 +41,8 @@ public class SignPlayerListener extends PlayerListener
|
||||
return;
|
||||
}
|
||||
final Sign csign = (Sign)block.getState();
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName()))
|
||||
{
|
||||
sign.onSignInteract(block, event.getPlayer(), ess);
|
||||
@@ -52,9 +53,8 @@ public class SignPlayerListener extends PlayerListener
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Signs signs : Signs.values())
|
||||
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockInteract(block, event.getPlayer(), ess))
|
||||
{
|
||||
|
||||
@@ -129,7 +129,7 @@ public class SignProtection extends EssentialsSign
|
||||
if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
|
||||
{
|
||||
final BlockSign sign = new BlockSign(block);
|
||||
if (sign.getLine(0).equalsIgnoreCase(this.getSuccessName()))
|
||||
if (sign.getLine(0).equals(this.getSuccessName()))
|
||||
{
|
||||
return checkProtectionSign(sign, user, username);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.earth2me.essentials.DescParseTickFormat;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -16,15 +17,17 @@ import org.bukkit.plugin.Plugin;
|
||||
public class KeywordReplacer implements IText
|
||||
{
|
||||
private final transient IText input;
|
||||
private final transient List<String> replaced;
|
||||
private final transient IEssentials ess;
|
||||
|
||||
|
||||
public KeywordReplacer(final IText input, final CommandSender sender, final IEssentials ess)
|
||||
{
|
||||
this.input = input;
|
||||
this.replaced = new ArrayList<String>(this.input.getLines().size());
|
||||
this.ess = ess;
|
||||
replaceKeywords(sender);
|
||||
}
|
||||
|
||||
|
||||
private void replaceKeywords(final CommandSender sender)
|
||||
{
|
||||
String displayName, ipAddress, balance, mails, world;
|
||||
@@ -41,7 +44,7 @@ public class KeywordReplacer implements IText
|
||||
world = user.getLocation().getWorld().getName();
|
||||
worldTime12 = DescParseTickFormat.format12(user.getWorld().getTime());
|
||||
worldTime24 = DescParseTickFormat.format24(user.getWorld().getTime());
|
||||
worldDate = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(DescParseTickFormat.ticksToDate(user.getWorld().getTime()));
|
||||
worldDate = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(DescParseTickFormat.ticksToDate(user.getWorld().getFullTime()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -98,7 +101,7 @@ public class KeywordReplacer implements IText
|
||||
|
||||
date = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(new Date());
|
||||
time = DateFormat.getTimeInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(new Date());
|
||||
|
||||
|
||||
version = ess.getServer().getVersion();
|
||||
|
||||
for (int i = 0; i < input.getLines().size(); i++)
|
||||
@@ -120,14 +123,14 @@ public class KeywordReplacer implements IText
|
||||
line = line.replace("{WORLDDATE}", worldDate);
|
||||
line = line.replace("{PLUGINS}", plugins);
|
||||
line = line.replace("{VERSION}", version);
|
||||
input.getLines().set(i, line);
|
||||
replaced.add(line);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLines()
|
||||
{
|
||||
return input.getLines();
|
||||
return replaced;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.io.*;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.*;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -11,9 +12,11 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class TextInput implements IText
|
||||
{
|
||||
private final transient List<String> lines = new ArrayList<String>();
|
||||
private final transient List<String> chapters = new ArrayList<String>();
|
||||
private final transient Map<String, Integer> bookmarks = new HashMap<String, Integer>();
|
||||
private final transient List<String> lines;
|
||||
private final transient List<String> chapters;
|
||||
private final transient Map<String, Integer> bookmarks;
|
||||
private final transient long lastChange;
|
||||
private final static HashMap<String, SoftReference<TextInput>> cache = new HashMap<String, SoftReference<TextInput>>();
|
||||
|
||||
public TextInput(final CommandSender sender, final String filename, final boolean createFile, final IEssentials ess) throws IOException
|
||||
{
|
||||
@@ -34,33 +37,62 @@ public class TextInput implements IText
|
||||
}
|
||||
if (file.exists())
|
||||
{
|
||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
|
||||
try
|
||||
lastChange = file.lastModified();
|
||||
boolean readFromfile;
|
||||
synchronized (cache)
|
||||
{
|
||||
int lineNumber = 0;
|
||||
while (bufferedReader.ready())
|
||||
final SoftReference<TextInput> inputRef = cache.get(file.getName());
|
||||
TextInput input;
|
||||
if (inputRef == null || (input = inputRef.get()) == null || input.lastChange < lastChange)
|
||||
{
|
||||
final String line = bufferedReader.readLine();
|
||||
if (line == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (line.length() > 0 && line.charAt(0) == '#')
|
||||
{
|
||||
bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-f]", ""), lineNumber);
|
||||
chapters.add(line.substring(1).replace('&', '§').replace("§§", "&"));
|
||||
}
|
||||
lines.add(line.replace('&', '§').replace("§§", "&"));
|
||||
lineNumber++;
|
||||
lines = new ArrayList<String>();
|
||||
chapters = new ArrayList<String>();
|
||||
bookmarks = new HashMap<String, Integer>();
|
||||
cache.put(file.getName(), new SoftReference<TextInput>(this));
|
||||
readFromfile = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lines = Collections.unmodifiableList(input.getLines());
|
||||
chapters = Collections.unmodifiableList(input.getChapters());
|
||||
bookmarks = Collections.unmodifiableMap(input.getBookmarks());
|
||||
readFromfile = false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
if (readFromfile)
|
||||
{
|
||||
bufferedReader.close();
|
||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
|
||||
try
|
||||
{
|
||||
int lineNumber = 0;
|
||||
while (bufferedReader.ready())
|
||||
{
|
||||
final String line = bufferedReader.readLine();
|
||||
if (line == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (line.length() > 0 && line.charAt(0) == '#')
|
||||
{
|
||||
bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-f]", ""), lineNumber);
|
||||
chapters.add(line.substring(1).replace('&', '§').replace("§§", "&"));
|
||||
}
|
||||
lines.add(line.replace('&', '§').replace("§§", "&"));
|
||||
lineNumber++;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
bufferedReader.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lastChange = 0;
|
||||
lines = Collections.emptyList();
|
||||
chapters = Collections.emptyList();
|
||||
bookmarks = Collections.emptyMap();
|
||||
if (createFile)
|
||||
{
|
||||
final InputStream input = ess.getResource(filename + ".txt");
|
||||
@@ -68,8 +100,7 @@ public class TextInput implements IText
|
||||
try
|
||||
{
|
||||
final byte[] buffer = new byte[1024];
|
||||
int length = 0;
|
||||
length = input.read(buffer);
|
||||
int length = input.read(buffer);
|
||||
while (length > 0)
|
||||
{
|
||||
output.write(buffer, 0, length);
|
||||
|
||||
@@ -157,6 +157,7 @@ player-commands:
|
||||
- xmpp
|
||||
|
||||
# Note: All items MUST be followed by a quantity!
|
||||
# All kit names should be lower case, and will be treated as lower in permissions/costs.
|
||||
# Times are measured in seconds.
|
||||
kits:
|
||||
tools:
|
||||
@@ -166,8 +167,28 @@ kits:
|
||||
- 278 1
|
||||
- 279 1
|
||||
|
||||
# Disable all signs
|
||||
signs-disabled: false
|
||||
# Essentials Sign Control
|
||||
# See http://ess.khhq.net/wiki/Sign_Tutorial for instructions on how to use these.
|
||||
# To enable signs, remove # symbol. To disable all signs, comment/remove each sign.
|
||||
# We recommend not enabling chest protection signs if you don't intend to use them, (or are using LWC/Lockette).
|
||||
|
||||
enabledSigns:
|
||||
#- balance
|
||||
#- buy
|
||||
#- sell
|
||||
#- trade
|
||||
#- free
|
||||
#- disposal
|
||||
#- warp
|
||||
#- kit
|
||||
#- mail
|
||||
#- enchant
|
||||
#- gamemode
|
||||
#- heal
|
||||
#- spawnmob
|
||||
#- time
|
||||
#- weather
|
||||
#- protection
|
||||
|
||||
# Backup runs a command while saving is disabled
|
||||
backup:
|
||||
@@ -253,10 +274,7 @@ register-back-in-listener: false
|
||||
# +------------------------------------------------------+ #
|
||||
############################################################
|
||||
|
||||
# When users die, should they respawn at their first home, instead of the spawnpoint or bed?
|
||||
respawn-at-home: false
|
||||
|
||||
# If no home is set send you to bed or spawn when /home is used
|
||||
# If no home is set, send players to spawn when /home is used
|
||||
spawn-if-no-home: true
|
||||
|
||||
# Allows people to set their bed at daytime
|
||||
@@ -532,8 +550,11 @@ newbies:
|
||||
spawnpoint: newbies
|
||||
|
||||
# Set this to lowest, if you want Multiverse to handle the respawning
|
||||
# Set this to normal, if you want EssentialsSpawn to handle the respawning
|
||||
# Set this to high, if you want EssentialsSpawn to handle the respawning
|
||||
# Set this to highest, if you want to force EssentialsSpawn to handle the respawning
|
||||
respawn-listener-priority: normal
|
||||
respawn-listener-priority: high
|
||||
|
||||
# When users die, should they respawn at their first home or bed, instead of the spawnpoint?
|
||||
respawn-at-home: false
|
||||
|
||||
# End of File <-- No seriously, you're done with configuration.
|
||||
@@ -2429,6 +2429,30 @@ glisteringmelon,382,0
|
||||
shiningmelon,382,0
|
||||
gmelon,382,0
|
||||
smelon,382,0
|
||||
creeperegg,383,50
|
||||
skeletonegg,383,51
|
||||
spideregg,383,52
|
||||
giantegg,383,53
|
||||
zombieegg,383,54
|
||||
slimeegg,383,55
|
||||
ghastegg,383,56
|
||||
zombiepigmanegg,383,57
|
||||
pigmanegg,383,57
|
||||
endermanegg,383,58
|
||||
cavespideregg,383,59
|
||||
silverfishegg,383,60
|
||||
blazeegg,383,61
|
||||
lavaslimeegg,383,62
|
||||
magmacubeegg,383,63
|
||||
pigegg,383,90
|
||||
sheepegg,383,91
|
||||
cowegg,383,92
|
||||
chickenegg,383,93
|
||||
squidegg,383,94
|
||||
wolfegg,383,95
|
||||
mooshroomegg,383,96
|
||||
mushroomcowegg,383,96
|
||||
villageregg,383,120
|
||||
goldmusicrecord,2256,0
|
||||
goldmusicdisk,2256,0
|
||||
goldmusiccd,2256,0
|
||||
|
||||
|
@@ -33,6 +33,8 @@ canTalkAgain=\u00a77You can talk again
|
||||
cantFindGeoIpDB=Can''t find GeoIP database!
|
||||
cantReadGeoIpDB=Failed to read GeoIP database!
|
||||
cantSpawnItem=\u00a7cYou are not allowed to spawn the item {0}
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=Command {0} failed:
|
||||
commandHelpFailedForPlugin=Error getting help for: {0}
|
||||
commandNotLoaded=\u00a7cCommand {0} is improperly loaded.
|
||||
@@ -169,7 +171,6 @@ listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Failed to load warp {0}
|
||||
loadinfo=Loaded {0} build {1} by: {2}
|
||||
localFormat=Local: <{0}> {1}
|
||||
mailClear=\u00a7cTo mark your mail as read, type /mail clear
|
||||
mailCleared=\u00a77Mail Cleared!
|
||||
@@ -237,6 +238,7 @@ notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Esse
|
||||
notSupportedYet=Not supported yet.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=now
|
||||
nuke=May death rain upon them
|
||||
numberRequired=A number goes there, silly.
|
||||
onlyDayNight=/time only supports day/night.
|
||||
onlyPlayers=Only in-game players can use {0}.
|
||||
@@ -291,8 +293,9 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request.
|
||||
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.
|
||||
returnPlayerToJailError=Error occurred when trying to return player to jail.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=second
|
||||
seconds=seconds
|
||||
seenOffline=Player {0} is offline since {1}
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} has teleportation disabled.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them.
|
||||
teleportNewPlayerError=Failed to teleport new player
|
||||
teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you.
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
teleportTop=\u00a77Teleporting to top.
|
||||
teleportationCommencing=\u00a77Teleportation commencing...
|
||||
teleportationDisabled=\u00a77Teleportation disabled.
|
||||
@@ -402,5 +406,3 @@ year=year
|
||||
years=years
|
||||
youAreHealed=\u00a77You have been healed.
|
||||
youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -33,6 +33,8 @@ canTalkAgain=\u00a77Du kan nu snakke igen.
|
||||
cantFindGeoIpDB=Kan ikke finde GeoIP database!
|
||||
cantReadGeoIpDB=Fejl ved afl\u00e6sning af GeoIP database!
|
||||
cantSpawnItem=\u00a7cDu har ikke tilladelse til at skabe tingen.{0}
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=Kommandoen {0} fejlede:
|
||||
commandHelpFailedForPlugin=Fejl ved hentning af hj\u00e6lp til: {0}
|
||||
commandNotLoaded=\u00a7cKommando {0} er ikke indl\u00e6st korrekt.
|
||||
@@ -169,7 +171,6 @@ listAmount = \u00a79Der er \u00a7c{0}\u00a79 ud af maksimum\u00a7c{1}\u00a79 spi
|
||||
listAmountHidden = \u00a79Der er \u00a7c{0}\u00a77/{1}\u00a79 ud af maksimum \u00a7c{2}\u00a79 spillere online.
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Kunne ikke l\u00c3\u00a6se warp {0}
|
||||
loadinfo=Loadede {0} build {1} af {2}
|
||||
localFormat=Local: <{0}> {1}
|
||||
mailClear=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear
|
||||
mailCleared=\u00a77Flaskepot ryddet!
|
||||
@@ -237,6 +238,7 @@ notRecommendedBukkit=* ! * Bukkit version er ikke den anbefalede build til Essen
|
||||
notSupportedYet=Ikke underst\u00f8ttet endnu.
|
||||
nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd.
|
||||
now=nu
|
||||
nuke=May death rain upon them
|
||||
numberRequired=Et nummer skal v\u00e6re, din tardo.
|
||||
onlyDayNight=/time underst\u00f8tter kun day/night.
|
||||
onlyPlayers=Kun in-game spillere kan bruge {0}.
|
||||
@@ -291,8 +293,9 @@ requestAcceptedFrom=\u00a77{0} accepterede din anmodning om teleport.
|
||||
requestDenied=\u00a77Anmodning om teleport afvist.
|
||||
requestDeniedFrom=\u00a77{0} afviste din anmodning om teleport.
|
||||
requestSent=\u00a77Anmodning sendt til {0}\u00a77.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=En fejl opstod ved fors\u00f8g p\u00e5 at returnere spilleren til f\u00e6ngsel.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=sekund
|
||||
seconds=sekunder
|
||||
seenOffline=Spilleren {0} har v\u00c3\u00a6ret offline i {1}
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} har ikke teleportation aktiveret.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c har anmodet om, at du teleporterer dig til ham/hende.
|
||||
teleportNewPlayerError=Fejlede ved teleportering af ny spiller
|
||||
teleportRequest=\u00a7c{0}\u00a7c har anmodet om at teleportere til dig.
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
teleportTop=\u00a77Teleporterer til toppen.
|
||||
teleportationCommencing=\u00a77Teleport begynder...
|
||||
teleportationDisabled=\u00a77Teleport deaktiveret.
|
||||
@@ -402,5 +406,3 @@ year=\u00e5r
|
||||
years=\u00e5r
|
||||
youAreHealed=\u00a77Du er blevet healed. Halleluja!
|
||||
youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -33,6 +33,8 @@ canTalkAgain=\u00a77Du kannst wieder sprechen.
|
||||
cantFindGeoIpDB=Kann GeoIP-Datenbank nicht finden!
|
||||
cantReadGeoIpDB=Fehler beim Einlesen der GeoIP-Datenbank!
|
||||
cantSpawnItem=\u00a7cDu darfst {0} nicht erzeugen.
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=Befehl {0} scheiterte:
|
||||
commandHelpFailedForPlugin=Fehler beim Abrufen der Hilfe f\u00fcr: {0}
|
||||
commandNotLoaded=\u00a7cBefehl {0} ist nicht richtig geladen.
|
||||
@@ -169,7 +171,6 @@ listAmount = \u00a79Es sind \u00a7c{0}\u00a79 von maximal \u00a7c{1}\u00a79 Spie
|
||||
listAmountHidden = \u00a79Es sind \u00a7c{0}\u00a77/{1}\u00a79 von maximal \u00a7c{2}\u00a79 Spielern online.
|
||||
listHiddenTag = \u00a77[Versteckt]\u00a7f
|
||||
loadWarpError=Fehler beim Laden von Warp-Punkt {0}
|
||||
loadinfo=Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo
|
||||
localFormat=Lokal: <{0}> {1}
|
||||
mailClear=\u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
|
||||
mailCleared=\u00a77Nachrichten gel\u00f6scht!
|
||||
@@ -237,6 +238,7 @@ notRecommendedBukkit=* ! * Die verwendete Bukkit-Version ist nicht f\u00fcr Esse
|
||||
notSupportedYet=Noch nicht verf\u00fcgbar.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=jetzt
|
||||
nuke=May death rain upon them
|
||||
numberRequired=Ein Zahl wird ben\u00f6tigt.
|
||||
onlyDayNight=/time unterst\u00fctzt nur day und night.
|
||||
onlyPlayers=Nur Spieler k\u00f6nnen {0} benutzen.
|
||||
@@ -291,8 +293,9 @@ requestAcceptedFrom=\u00a77{0} hat deine Teleportierungsanfrage angenommen.
|
||||
requestDenied=\u00a77Teleportierungsanfrage verweigert.
|
||||
requestDeniedFrom=\u00a77{0} hat deine Teleportierungsanfrage abgelehnt.
|
||||
requestSent=\u00a77Anfrage gesendet an {0}\u00a77.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=Sekunde
|
||||
seconds=Sekunden
|
||||
seenOffline=Spieler {0} ist offline seit {1}
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} verweigert die Teleportierung.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c fragt, ob du dich zu ihm teleportierst.
|
||||
teleportNewPlayerError=Fehler beim Teleportieren eines neuen Spielers
|
||||
teleportRequest=\u00a7c{0}\u00a7c fragt, ob er sich zu dir teleportieren darf.
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
teleportTop=\u00a77Teleportiere nach oben.
|
||||
teleportationCommencing=\u00a77Teleportierung gestartet...
|
||||
teleportationDisabled=\u00a77Teleportierung deaktiviert.
|
||||
@@ -402,5 +406,3 @@ year=Jahr
|
||||
years=Jahre
|
||||
youAreHealed=\u00a77Du wurdest geheilt.
|
||||
youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -33,6 +33,8 @@ canTalkAgain=\u00a77You can talk again
|
||||
cantFindGeoIpDB=Can''t find GeoIP database!
|
||||
cantReadGeoIpDB=Failed to read GeoIP database!
|
||||
cantSpawnItem=\u00a7cYou are not allowed to spawn the item {0}
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=Command {0} failed:
|
||||
commandHelpFailedForPlugin=Error getting help for: {0}
|
||||
commandNotLoaded=\u00a7cCommand {0} is improperly loaded.
|
||||
@@ -169,7 +171,6 @@ listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Failed to load warp {0}
|
||||
loadinfo=Loaded {0} build {1} by: {2}
|
||||
localFormat=Local: <{0}> {1}
|
||||
mailClear=\u00a7cTo mark your mail as read, type /mail clear
|
||||
mailCleared=\u00a77Mail Cleared!
|
||||
@@ -237,6 +238,7 @@ notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essen
|
||||
notSupportedYet=Not supported yet.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=now
|
||||
nuke=May death rain upon them
|
||||
numberRequired=A number goes there, silly.
|
||||
onlyDayNight=/time only supports day/night.
|
||||
onlyPlayers=Only in-game players can use {0}.
|
||||
@@ -291,8 +293,9 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request.
|
||||
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.
|
||||
returnPlayerToJailError=Error occurred when trying to return player to jail.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=second
|
||||
seconds=seconds
|
||||
seenOffline=Player {0} is offline since {1}
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} has teleportation disabled.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them.
|
||||
teleportNewPlayerError=Failed to teleport new player
|
||||
teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you.
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
teleportTop=\u00a77Teleporting to top.
|
||||
teleportationCommencing=\u00a77Teleportation commencing...
|
||||
teleportationDisabled=\u00a77Teleportation disabled.
|
||||
@@ -402,5 +406,3 @@ year=year
|
||||
years=years
|
||||
youAreHealed=\u00a77You have been healed.
|
||||
youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -33,6 +33,8 @@ canTalkAgain=\u00a77Ya puedes hablar de nuevo
|
||||
cantFindGeoIpDB=No se puede encontrar la bases de datos del Geo IP
|
||||
cantReadGeoIpDB=Error al intentar leer la base de datos del Geo IP
|
||||
cantSpawnItem=\u00a7cNo tienes acceso para producir este objeto {0}
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=Command {0} fallado:
|
||||
commandHelpFailedForPlugin=Error obteniendo ayuda para: {0}
|
||||
commandNotLoaded=\u00a7cCommand {0} esta cargado incorrectamente.
|
||||
@@ -169,7 +171,6 @@ listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Error al cargar el tenetransporte {0}
|
||||
loadinfo=Cargado {0}, construido {1} por: {2}
|
||||
localFormat=Local: <{0}> {1}
|
||||
mailClear=\u00a7cPara marcar tu email como leido, escribe /mail clear
|
||||
mailCleared=\u00a77Email limpiado!
|
||||
@@ -237,6 +238,7 @@ notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta v
|
||||
notSupportedYet=No esta soportado aun.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=ahora
|
||||
nuke=May death rain upon them
|
||||
numberRequired=Un numero es necesario, amigo.
|
||||
onlyDayNight=/time solo soporta day/night. (dia/noche)
|
||||
onlyPlayers=Solo los jugadores conectados pueden usar {0}.
|
||||
@@ -291,8 +293,9 @@ requestAcceptedFrom=\u00a77{0} acepto tu peticion de teletransporte.
|
||||
requestDenied=\u00a77Peticion de teletransporte denegada.
|
||||
requestDeniedFrom=\u00a77{0} ha denegado tu peticion de teletransporte.
|
||||
requestSent=\u00a77Peticion enviada a {0}\u00a77.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Error al intentar quitar al jugador de la carcel.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=segundo
|
||||
seconds=segundos
|
||||
seenOffline=El jugador {0} esta desconectado desde {1}
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} tiene desactivado los teletransportes.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c ha pedido que te teletransportes con el.
|
||||
teleportNewPlayerError=Error al teletransportar al nuevo jugador
|
||||
teleportRequest=\u00a7c{0}\u00a7c te ha pedido teletransportarse contigo.
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
teleportTop=\u00a77Teletransportandote a la cima.
|
||||
teleportationCommencing=\u00a77Comenzando teletransporte...
|
||||
teleportationDisabled=\u00a77Teletransporte desactivado.
|
||||
@@ -402,5 +406,3 @@ year=año
|
||||
years=años
|
||||
youAreHealed=\u00a77Has sido curado.
|
||||
youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -1,7 +1,7 @@
|
||||
#version: TeamCity
|
||||
# Single quotes have to be doubled: ''
|
||||
# Translations start here
|
||||
# by:
|
||||
# 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.
|
||||
@@ -13,34 +13,36 @@ autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e
|
||||
backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
|
||||
backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent.
|
||||
backupFinished=Sauvegarde termin\u00e9
|
||||
backupStarted=D\u00e9but de la sauvegarde
|
||||
backupStarted=D\u00e9but de la sauvegarde...
|
||||
balance=\u00a77Solde : {0}
|
||||
balanceTop=\u00a77 Meilleurs soldes ({0})
|
||||
balanceTop=\u00a77 Meilleurs soldes au ({0})
|
||||
banExempt=\u00a77Vous ne pouvez pas bannir ce joueur.
|
||||
banIpAddress=\u00a77Adresse IP bannie
|
||||
banIpAddress=\u00a77Adresse IP bannie.
|
||||
bannedIpsFileError=Erreur de lecture de banned-ips.txt
|
||||
bannedIpsFileNotFound=Fichier banned-ips.txt introuvable
|
||||
bannedPlayersFileError=Erreur lors de la lecture de banned-players.txt
|
||||
bannedPlayersFileNotFound=banned-players.txt introuvable.
|
||||
bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l''herbe.
|
||||
bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l'herbe.
|
||||
bigTreeSuccess=\u00a77Gros arbre cr\u00e9e.
|
||||
blockList=Essentials relayed the following commands to another plugin:
|
||||
broadcast=[\u00a7cMessage\u00a7f]\u00a7a {0}
|
||||
buildAlert=\u00a7cVous n''avez pas la permission de construire.
|
||||
buildAlert=\u00a7cVous n'avez pas la permission de construire.
|
||||
bukkitFormatChanged=Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
|
||||
burnMsg=\u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
|
||||
canTalkAgain=\u00a77Vous pouvez de nouveau parler.
|
||||
cantFindGeoIpDB=N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
|
||||
cantFindGeoIpDB=N'arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
|
||||
cantReadGeoIpDB=Echec de la lecture de la base de donn\u00e9es GeoIP!
|
||||
cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00c3\u00aetre {0}
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=\u00c9chec de la commande {0} :
|
||||
commandHelpFailedForPlugin=Erreur d''obtention d''aide pour : {0}
|
||||
commandNotLoaded=\u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e.
|
||||
compassBearing=\u00a77Orientation : {0} ({1} degr\u00e9s).
|
||||
configFileMoveError=\u00c9chec du d\u00e9placement de config.yml vers l''emplacement de sauvegarde.
|
||||
configFileMoveError=\u00c9chec du d\u00e9placement de config.yml vers l'emplacement de sauvegarde.
|
||||
configFileRenameError=\u00c9chec du changement de nom du fichier temporaire de config.yml
|
||||
connectedPlayers=Joueurs connect\u00e9s :
|
||||
connectionFailed=\u00c9chec de l''ouverture de la connexion.
|
||||
connectionFailed=\u00c9chec de l'ouverture de la connexion.
|
||||
cooldownWithMessage=\u00a7cR\u00e9utilisation : {0}
|
||||
corruptNodeInConfig=\u00a74Annonce : Votre fichier de configuration a un {0} n\u0153ud corrompu.
|
||||
couldNotFindTemplate=Le mod\u00c3\u00a8le {0} est introuvable
|
||||
@@ -57,7 +59,7 @@ deleteWarp=\u00a77Warp {0} supprim\u00e9.
|
||||
deniedAccessCommand=L''acc\u00c3\u00a8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
|
||||
dependancyDownloaded=[Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9.
|
||||
dependancyException=[Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement.
|
||||
dependancyNotFound=[Essentials] Une d\u00e9pendance requise n''a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
|
||||
dependancyNotFound=[Essentials] Une d\u00e9pendance requise n'a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
|
||||
depth=\u00a77Vous \u00eates au niveau de la mer.
|
||||
depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer.
|
||||
depthBelowSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer.
|
||||
@@ -66,7 +68,7 @@ disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pou
|
||||
disabled=d\u00e9sactiv\u00e9
|
||||
disabledToSpawnMob=Spawning this mob was disabled in the config file.
|
||||
dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas.
|
||||
downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (campagne : 0.6 Mo, ville : 20Mo)
|
||||
downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (Pays : 0.6 Mo, villes : 20Mo)
|
||||
duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1}
|
||||
enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}.
|
||||
enabled=activ\u00e9
|
||||
@@ -77,17 +79,17 @@ enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item
|
||||
enchantments = \u00a77Enchantments : {0}
|
||||
errorCallingCommand=Erreur en appelant la commande /{0}
|
||||
errorWithMessage=\u00a7cErreur : {0}
|
||||
essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
|
||||
essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
|
||||
essentialsReload=\u00a77Essentials Recharg\u00e9 {0}
|
||||
essentialsHelp1=Le fichier est corrompuet Essentials ne peut l'ouvrir. Essentials est maintenant d\u00e9sactiv\u00e9. Si vous ne pouvez corriger vous-m\u00eame, aller \u00e0 http://tiny.cc/EssentialsChat
|
||||
essentialsHelp2=Le fichier est corrompuet Essentials ne peut l'ouvrir. Essentials est maintenant d\u00e9sactiv\u00e9. Si vous ne pouvez corriger vous-m\u00eame, tapez /essentialshelp ou aller \u00e0 http://tiny.cc/EssentialsChat
|
||||
essentialsReload=\u00a77Essentials {0} a \u00e9t\u00e9 recharg\u00e9.
|
||||
extinguish=\u00a77Vous cessez de br\u00fbler.
|
||||
extinguishOthers=\u00a77Vous avez \u00e9teint la combustion de {0}.
|
||||
failedToCloseConfig=Echec de la fermeture de la configuration {0}
|
||||
failedToCreateConfig=Echec de la cr\u00e9ation de la configuration {0}
|
||||
failedToWriteConfig=\u00c9chec de l''\u00e9criture de la configuration {0}
|
||||
false=faux
|
||||
feed=\u00a77Your appetite was sated.
|
||||
feedOther=\u00a77Satisfied {0}.
|
||||
false=non
|
||||
feed=\u00a77Vous avez \u00e9t\u00e9 rassasi\u00e9.
|
||||
feedOther=\u00a77 est rassasi\u00e9 {0}.
|
||||
fileRenameError=Echec du changement de nom de {0}
|
||||
foreverAlone=\u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre
|
||||
freedMemory=A lib\u00e9r\u00e9 {0} Mo.
|
||||
@@ -107,7 +109,7 @@ haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9.
|
||||
heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
|
||||
healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9.
|
||||
helpConsole=Pour voir l''aide tapez ?
|
||||
helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0}:\u00a7f {1}
|
||||
helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1}
|
||||
helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f.
|
||||
holeInFloor=Trou dans le Sol.
|
||||
homeSet=\u00a77R\u00e9sidence d\u00e9finie.
|
||||
@@ -119,15 +121,15 @@ ignorePlayer=Vous ignorez d\u00e9sormais {0}.
|
||||
illegalDate=Format de date ill\u00e9gal.
|
||||
infoChapter=S\u00e9lectionnez le chapitre :
|
||||
infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f:
|
||||
infoFileDoesNotExist=Le fichier info.txt n''existe pas. Le fichier est en cours de cr\u00e9ation pour vous.
|
||||
infoFileDoesNotExist=Le fichier info.txt n'existe pas. Le fichier est en cours de cr\u00e9ation pour vous.
|
||||
infoPages=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f.
|
||||
infoUnknownChapter=Chapitre inconnu.
|
||||
invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre.
|
||||
invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu.
|
||||
invSee=Vous voyez l''inventaire de {0}.
|
||||
invSeeHelp=Utilisez /invsee pour voir l''inventaire de quelqu''un.
|
||||
invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire.
|
||||
invalidCharge=\u00a7cCharge invalide.
|
||||
invalidMob=Mauvias type de monstre.
|
||||
invalidMob=Mauvias type de cr\u00e9ature.
|
||||
invalidServer=Serveur non valide.
|
||||
invalidSignLine=La ligne {0} du panneau est invalide.
|
||||
invalidWorld=\u00a7cMonde invalide.
|
||||
@@ -136,47 +138,46 @@ inventoryClearedOthers=\u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9
|
||||
is=est
|
||||
itemCannotBeSold=Cet objet ne peut \u00eatre vendu au serveur.
|
||||
itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64.
|
||||
itemNotEnough1=\u00a7cVous n''avez pas assez de cet objet pour le vendre.
|
||||
itemNotEnough2=\u00a77Si vous voulez vendre l''int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet
|
||||
itemNotEnough1=\u00a7cVous n'avez pas assez de cet objet pour le vendre.
|
||||
itemNotEnough2=\u00a77Si vous voulez vendre l'int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet
|
||||
itemNotEnough3=\u00a77/sell nomObjet -1 vendra tout sauf un objet, etc.
|
||||
itemSellAir=Vouliez-vous vraiment vendre de l''air ? Mettez un objet dans votre main.
|
||||
itemSellAir=Vouliez-vous vraiment vendre de l'air ? Mettez un objet dans votre main.
|
||||
itemSold=\u00a77Vendu pour \u00a7c{0} \u00a77({1} {2} \u00e0 {3} chacun)
|
||||
itemSoldConsole={0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun)
|
||||
itemSpawn=\u00a77Donne {0} de {1}
|
||||
itemsCsvNotLoaded=N''a pas pu charger items.csv.
|
||||
itemsCsvNotLoaded=N'a pas pu charger items.csv.
|
||||
jailAlreadyIncarcerated=\u00a7cJoueur d\u00e9j\u00e0 emprisonn\u00e9 : {0}
|
||||
jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix.
|
||||
jailNotExist=Cette prison n''existe pas.
|
||||
jailNotExist=Cette prison n'existe pas.
|
||||
jailReleased=\u00a77Joueur \u00a7e{0}\u00a77 lib\u00e9r\u00e9.
|
||||
jailReleasedPlayerNotify=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9 !
|
||||
jailSentenceExtended=Dur\u00e9e d''emprisonnement rallong\u00e9e de : {0)
|
||||
jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
|
||||
jumpError=\u00c7a aurait pu faire mal au cerveau de votre ordinateur.
|
||||
kickDefault=Kick\u00e9 du serveur
|
||||
kickExempt=\u00a77Vous ne pouvez pas lancer ce joueur.
|
||||
kickDefault=\u00c9ject\u00e9 du serveur
|
||||
kickExempt=\u00a77Vous ne pouvez pas \u00e9jecter ce joueur.
|
||||
kill=\u00a77Tu\u00e9 {0}.
|
||||
kitError2=\u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
|
||||
kitError=\u00a7cIl n''y a pas de kits valides.
|
||||
kitErrorHelp=\u00a7cPeut-\u00eatre qu''un objet manque d''une quantit\u00e9 dans la configuration ?
|
||||
kitError2=\u00a7cCe kit n'existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
|
||||
kitError=\u00a7cIl n'y a pas de kits valides.
|
||||
kitErrorHelp=\u00a7cPeut-\u00eatre qu'un objet manque d'une quantit\u00e9 dans la configuration ?
|
||||
kitGive=\u00a77Donner le kit {0}.
|
||||
kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est parre-terre.
|
||||
kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}.
|
||||
kits=\u00a77Kits :{0}
|
||||
lightningSmited=\u00a77Vous venez d''\u00eatre foudroy\u00e9.
|
||||
lightningSmited=\u00a77Vous venez d'\u00eatre foudroy\u00e9.
|
||||
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.
|
||||
listHiddenTag = \u00a77[MASQU\u00c9]\u00a7f
|
||||
loadWarpError=\u00c9chec du chargement du raccourci {0}
|
||||
loadinfo={0} version {1} par {2} a \u00e9t\u00e9 charg\u00e9
|
||||
localFormat=Locale :<{0}> {1}
|
||||
loadWarpError=\u00c9chec du chargement du point de t\u00e9l\u00e9portation {0}.
|
||||
localFormat=Locale : <{0}> {1}
|
||||
mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
|
||||
mailCleared=\u00a77Courrier supprim\u00e9 !
|
||||
mailSent=\u00a77Courrier envoy\u00e9 !
|
||||
markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
|
||||
markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK.
|
||||
markedAsNotAway=\u00a77Vous n''\u00eates d\u00e9sormais plus AFK.
|
||||
markedAsNotAway=\u00a77Vous n'\u00eates d\u00e9sormais plus AFK.
|
||||
maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences.
|
||||
mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne.
|
||||
me=moi
|
||||
@@ -184,68 +185,69 @@ minute=minute
|
||||
minutes=minutes
|
||||
missingItems=Vous n''avez pas {0} x {1}.
|
||||
missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0}
|
||||
mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de monstres.
|
||||
mobSpawnLimit=Quantit\u00e9 de monstres limit\u00e9 \u00e0 au maximum du serveur.
|
||||
mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de monstres.
|
||||
mobsAvailable=\u00a77Monstres : {0}
|
||||
mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de cr\u00e9atures.
|
||||
mobSpawnLimit=Quantit\u00e9 de cr\u00e9atures limit\u00e9 \u00e0 au maximum du serveur.
|
||||
mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de cr\u00e9atures.
|
||||
mobsAvailable=\u00a77cr\u00e9atures : {0}
|
||||
moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
|
||||
moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1}
|
||||
moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte bancaire.
|
||||
moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte.
|
||||
month=mois
|
||||
months=mois
|
||||
moreThanZero=Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
|
||||
moreThanZero=Les quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
|
||||
msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence.
|
||||
mutedPlayer=Le joueur {0} est d\u00e9sormais muet.
|
||||
mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}.
|
||||
mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet.
|
||||
nearbyPlayers=Players nearby: {0}
|
||||
needTpohere=Vous avez besoin de l''acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d''autres joueurs.
|
||||
negativeBalanceError=L''utilisateur n''est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
|
||||
nearbyPlayers=Joueurs dans les environs : {0}
|
||||
needTpohere=Vous avez besoin de l'acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d'autres joueurs.
|
||||
negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
|
||||
nickChanged=surnom modifi\u00e9.
|
||||
nickDisplayName=\u00a77Vous devez activer change-displayname dans la configuration Essentials.
|
||||
nickInUse=\u00a7cCe nom est d\u00e9j\u00e0 utilis\u00e9.
|
||||
nickNamesAlpha=\u00a7cLes surnoms doivent \u00eatre alphanum\u00e9riques.
|
||||
nickNoMore=\u00a7Vous n''avez plus de surnom.
|
||||
nickOthersPermission=\u00a7cVous n''avez pas la permission de changer le surnom des autres.
|
||||
nickNoMore=\u00a7 Vous n'avez plus de surnom.
|
||||
nickOthersPermission=\u00a7cVous n'avez pas la permission de changer le surnom des autres.
|
||||
nickSet=\u00a77Votre surnom est maintenant \u00a7c{0}
|
||||
noAccessCommand=\u00a7cVous n''avez pas acc\u00c3\u00a8s \u00e0 cette commande.
|
||||
noAccessCommand=\u00a7cVous n'avez pas acc\u00c3\u00a8s \u00e0 cette commande.
|
||||
noAccessPermission=\u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
|
||||
noDestroyPermission=\u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
|
||||
noGodWorldWarning=\u00a7cWarning! Le mode Dieu est d\u00e9sactiv\u00e9 dans ce monde.
|
||||
noHelpFound=\u00a7cAucune commande correspondante.
|
||||
noHomeSet=Vous n''avez pas d\u00e9fini de r\u00e9sidence.
|
||||
noHomeSetPlayer=Le joueur n''a pas d\u00e9fini sa r\u00e9sidence.
|
||||
noHomeSet=Vous n'avez pas d\u00e9fini de r\u00e9sidence.
|
||||
noHomeSetPlayer=Le joueur n'a pas d\u00e9fini sa r\u00e9sidence.
|
||||
noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
|
||||
noKits=\u00a77Il n''y a pas encore de kits disponibles.
|
||||
noMail=Vous n''avez pas de courrier
|
||||
noMotd=\u00a7cIl n''y a pas de message su jour.
|
||||
noNewMail=\u00a77Vous n''avez pas de courrier.
|
||||
noPendingRequest=Vous n''avez pas de requ\u00eate non lue.
|
||||
noKits=\u00a77Il n'y a pas encore de kits disponibles.
|
||||
noMail=Vous n'avez pas de courrier
|
||||
noMotd=\u00a7cIl n'y a pas de message su jour.
|
||||
noNewMail=\u00a77Vous n'avez pas de courrier.
|
||||
noPendingRequest=Vous n'avez pas de requ\u00eate non lue.
|
||||
noPerm=\u00a7cVous n''avez pas la permission \u00a7f{0}\u00a7c.
|
||||
noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
|
||||
noPlacePermission=\u00a7cVous n''avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte.
|
||||
noPowerTools=Vous n''avez pas d''outil automatique associ\u00e9.
|
||||
noRules=\u00a7cIl n''y a pas encore de r\u00c3\u00a8gles d\u00e9finies.
|
||||
noWarpsDefined=Aucun raccourci d\u00e9fini.
|
||||
noPermToSpawnMob=\u00a7cVous n'avez pas la permission d'invoquer cette cr\u00e9ature.
|
||||
noPlacePermission=\u00a7cVous n'avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte.
|
||||
noPowerTools=Vous n'avez pas d'outil macro associ\u00e9.
|
||||
noRules=\u00a7cIl n'y a pas encore de r\u00e8gles d\u00e9finies.
|
||||
noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini.
|
||||
none=aucun
|
||||
notAllowedToQuestion=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des questions.
|
||||
notAllowedToShout=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier.
|
||||
notEnoughExperience=You do not have enough experience.
|
||||
notEnoughMoney=Vous n''avez pas les fonds n\u00e9cessaires.
|
||||
notRecommendedBukkit=* ! * La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
|
||||
notAllowedToQuestion=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 poser des questions.
|
||||
notAllowedToShout=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 crier.
|
||||
notEnoughExperience=Vous n'avez pas assez d'exp\u00e9rience.
|
||||
notEnoughMoney=Vous n'avez pas les fonds n\u00e9cessaires.
|
||||
notRecommendedBukkit=* ! * La version de Bukkit n'est pas celle qui est recommand\u00e9 pour cette version de Essentials.
|
||||
notSupportedYet=Pas encore pris en charge.
|
||||
nothingInHand = \u00a7cVous n''avez rien en main.
|
||||
nothingInHand = \u00a7cVous n'avez rien en main.
|
||||
now=maintenant
|
||||
nuke=Que la mort s'abatte sur eux !
|
||||
numberRequired=Il faut fournir un nombre ici.
|
||||
onlyDayNight=/time ne supporte que (jour) day/night (nuit).
|
||||
onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}.
|
||||
onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate).
|
||||
orderBalances=Ordering balances of {0} users, please wait ...
|
||||
pTimeCurrent=\u00a7e{0}''s\u00a7f l''heure est {1}.
|
||||
pTimeCurrentFixed=\u00a7e{0}''s\u00a7f l''heure est fix\u00e9e \u00e0 {1}.
|
||||
pTimeNormal=\u00a7e{0}''s\u00a7f l''heure est normale et correspond au server.
|
||||
pTimeOthersPermission=\u00a7cVous n''etes pas autoris\u00e9 \u00e0 changer l''heure des autres joueurs.
|
||||
orderBalances=Classement des balance de {0} utilisateurs, patientez ...
|
||||
pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}.
|
||||
pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}.
|
||||
pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server.
|
||||
pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs.
|
||||
pTimePlayers=Ces joueurs ont leur propre horraire :
|
||||
pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0}
|
||||
pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1}
|
||||
@@ -257,7 +259,7 @@ playerBanned=\u00a7cJoueur {0} banni {1} pour {2}
|
||||
playerInJail=\u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
|
||||
playerJailed=\u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
|
||||
playerJailedFor=\u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
|
||||
playerKicked=\u00a7cPlayer {0} kicked {1} for {2}
|
||||
playerKicked=\u00a7c{0} a \u00e9t\u00e9 \u00e9ject\u00e9 {1} pour {2}.
|
||||
playerMuted=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence.
|
||||
playerMutedFor=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence pour {0}
|
||||
playerNeverOnServer=\u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
|
||||
@@ -265,34 +267,35 @@ playerNotFound=\u00a7cLe joueur est introuvable.
|
||||
playerUnmuted=\u00a77Vous avez de nouveau la parole.
|
||||
pong=Pong !
|
||||
possibleWorlds=\u00a77Les mondes possibles sont les nombres de 0 \u00e0 {0}.
|
||||
powerToolAir=La commande ne peut pas \u00eatre assign\u00e9e \u00e0 l''air.
|
||||
powerToolAir=La commande ne peut pas \u00eatre assign\u00e9e \u00e0 l'air.
|
||||
powerToolAlreadySet=La commande \u00a7c{0}\u00a7f est d\u00e9j\u00e0 assign\u00e9e \u00e0 {1}.
|
||||
powerToolAttach=Commande \u00a7c{0}\u00a7f assign\u00e9e \u00e0 {1}.
|
||||
powerToolClearAll=Toutes les commandes assign\u00e9es ont \u00e9et\u00e9e retir\u00e9ees.
|
||||
powerToolList={1} assign\u00e9s aux commandes : \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty={0} n''a pas de commande assign\u00e9e.
|
||||
powerToolListEmpty={0} n'a pas de commande assign\u00e9e.
|
||||
powerToolNoSuchCommandAssigned=La commande \u00a7c{0}\u00a7f n''a pas \u00e9t\u00e9 assign\u00e9e \u00e0 {1}.
|
||||
powerToolRemove=Command \u00a7c{0}\u00a7f retir\u00e9e de {1}.
|
||||
powerToolRemove=Commande \u00a7c{0}\u00a7f retir\u00e9e de {1}.
|
||||
powerToolRemoveAll=Toutes les commandes retir\u00e9es de {0}.
|
||||
powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es.
|
||||
powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es.
|
||||
protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
|
||||
questionFormat=\u00a77[Question]\u00a7f {0}
|
||||
readNextPage=Type /{0} {1} to read the next page
|
||||
readNextPage=Utilisez /{0} {1} pour lire la page suivante.
|
||||
reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es.
|
||||
removed=\u00a77Removed {0} entities.
|
||||
removed=\u00a77{0} entit\u00e9s supprim\u00e9es.
|
||||
repair=Vous avez r\u00e9par\u00e9 votre : \u00a7e{0}.
|
||||
repairAlreadyFixed=\u00a77Cet objet n''a pas besoin de r\u00e9paration.
|
||||
repairEnchanted=\u00a77You are not allowed to repair enchanted items.
|
||||
repairAlreadyFixed=\u00a77Cet objet n'a pas besoin de r\u00e9paration.
|
||||
repairEnchanted=\u00a77Vous n'\u00eates pas autoris\u00e9 \u00e0 r\u00e9parer les objets enchant\u00e9s.
|
||||
repairInvalidType=\u00a7cCet objet ne peut \u00eatre r\u00e9par\u00e9.
|
||||
repairNone=Aucun objet n''a besoin d''\u00eatre r\u00e9par\u00e9.
|
||||
repairNone=Aucun objet n'a besoin d'u00eatre r\u00e9par\u00e9.
|
||||
requestAccepted=\u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e.
|
||||
requestAcceptedFrom=\u00a77{0} a accept\u00e9 votre demande de t\u00e9l\u00e9portation.
|
||||
requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
|
||||
requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation.
|
||||
requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur.
|
||||
requestTimedOut=\u00a7cLa de mande de t\u00e9l\u00e9portation a expir\u00e9.
|
||||
requiredBukkit=* ! * Vous avez besoin au moins de la version {0} de CraftBukkit. T\u00e9l\u00e9chargez-la ici http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=seconde
|
||||
seconds=secondes
|
||||
seenOffline=Le joueur {0} est hors ligne depuis {1}
|
||||
@@ -304,14 +307,14 @@ shoutFormat=\u00a77[Crie]\u00a7f {0}
|
||||
signFormatFail=\u00a74[{0}]
|
||||
signFormatSuccess=\u00a71[{0}]
|
||||
signFormatTemplate=[{0}]
|
||||
signProtectInvalidLocation=\u00a74Vous n''avez pas l''autorisation de cr\u00e9er une pancarte ici.
|
||||
similarWarpExist=Un raccourci avec un nom similaire existe d\u00e9j\u00e0.
|
||||
signProtectInvalidLocation=\u00a74Vous n'avez pas l'autorisation de cr\u00e9er une pancarte ici.
|
||||
similarWarpExist=Un point de t\u00e9l\u00e9portation avec un nom similaire existe d\u00e9j\u00e0.
|
||||
slimeMalformedSize=Taille mal form\u00e9e.
|
||||
soloMob=Ce monstre aime \u00eatre seul.
|
||||
spawnSet=\u00a77Le point de spawn a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
|
||||
soloMob=Ce cr\u00e9ature aime \u00eatre seul.
|
||||
spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
|
||||
spawned=invoqu\u00e9(s)
|
||||
suicideMessage=\u00a77Au revoir monde cruel...
|
||||
suicideSuccess=\u00a77{0} s''est suiscid\u00e9.
|
||||
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}.
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
|
||||
teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur.
|
||||
teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous.
|
||||
teleportRequestTimeoutInfo=\u00a77Cette demande de t\u00e9l\u00e9portation expirera dans {0} secondes.
|
||||
teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut.
|
||||
teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation...
|
||||
teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9.
|
||||
@@ -337,19 +341,19 @@ timeBeforeTeleport=Temps avant prochaine t\u00e9l\u00e9portation {0}
|
||||
timeFormat=\u00a73{0}\u00a7f ou \u00a73{1}\u00a7f ou \u00a73{2}\u00a7f
|
||||
timePattern=(?:([0-9]+)\\\\s*[ya][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*mo[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:sem|w)[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*[dj][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*h[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*m[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:s[a-z]*)?)?
|
||||
timeSet=Heure r\u00e9gl\u00e9e dans tous les mondes.
|
||||
timeSetPermission=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l''heure.
|
||||
timeSetPermission=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l'heure.
|
||||
timeWorldCurrent=Il est \u00a73{1}\u00a77 dans \u00a7c{0}.
|
||||
timeWorldSet=L''heure a \u00e9t\u00e9 r\u00e9gl\u00e9e \u00e0 {0} dans : \u00a7c{1}
|
||||
tradeCompleted=\u00a77\u00c9change termin\u00e9.
|
||||
tradeSignEmpty=Le panneau de vente n''as pas encore assez de stock.
|
||||
tradeSignEmptyOwner=Il n''y a rien \u00e0 collecter de cette pancarte d''\u00e9change commercial.
|
||||
treeFailure=\u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre.
|
||||
tradeSignEmpty=Le panneau de vente n'as pas encore assez de stock.
|
||||
tradeSignEmptyOwner=Il n'y a rien \u00e0 collecter de cette pancarte d'\u00e9change commercial.
|
||||
treeFailure=\u00a7cEchec de la g\u00e9n\u00e9ration de l'arbre. Essayez de nouveau sur de l'herbe ou de la terre.
|
||||
treeSpawned=\u00a77Arbre cr\u00e9\u00e9.
|
||||
true=vrai
|
||||
typeTpaccept=\u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
|
||||
typeTpdeny=\u00a77Pour d\u00e9cliner cette demande, entrez \u00a7c/tpdeny\u00a77.
|
||||
typeWorldName=\u00a77Vous pouvez aussi taper le nom d''un monde sp\u00e9cifique.
|
||||
unableToSpawnMob=Incapable d''invoquer un monstre.
|
||||
true=oui
|
||||
typeTpaccept=\u00a77Pour le t\u00e9l\u00e9porter, utilisez \u00a7c/tpaccept\u00a77.
|
||||
typeTpdeny=\u00a77Pour d\u00e9cliner cette demande, utilisez \u00a7c/tpdeny\u00a77.
|
||||
typeWorldName=\u00a77Vous pouvez aussi taper le nom d'un monde sp\u00e9cifique.
|
||||
unableToSpawnMob=Incapable d'invoquer un cr\u00e9ature.
|
||||
unbannedIP=Adresse IP d\u00e9bannie.
|
||||
unbannedPlayer=Joueur d\u00e9banni.
|
||||
unignorePlayer=Vous n''ignorez plus {0}.
|
||||
@@ -361,33 +365,33 @@ unlimitedItems=Objets illimit\u00e9s:
|
||||
unmutedPlayer=Le joueur {0} n''est plus muet.
|
||||
upgradingFilesError=Erreur durant la mise \u00e0 jour des fichiers.
|
||||
userDoesNotExist=L''utilisateur {0} n''existe pas.
|
||||
userIsAway={0} s''est mis en AFK
|
||||
userIsNotAway={0} n''est plus inactif
|
||||
userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9
|
||||
userIsAway={0} s'est mis en AFK
|
||||
userIsNotAway={0} n'est plus AFK
|
||||
userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9.
|
||||
userUsedPortal={0} a utilis\u00e9 un portail existant.
|
||||
userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1}
|
||||
userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp
|
||||
usingTempFolderForTesting=Utilise un fichier temporaire pour un test.
|
||||
versionMismatch=Versions diff\u00e9rentes ! Mettez s''il vous plait {0} \u00e0 la m\u00eame version.
|
||||
versionMismatchAll=Mauvaise version ! S''il vous plait mettez des jars Essentials de version identique.
|
||||
versionMismatchAll=Mauvaise version ! S'il vous plait mettez des jars Essentials de version identique.
|
||||
voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence.
|
||||
warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp.
|
||||
warpListPermission=\u00a7cVous n''avez pas la permission d''afficher la liste des warps.
|
||||
warpNotExist=Ce raccourci n''existe pas.
|
||||
warpSet=\u00a77Le raccourci {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
|
||||
warpUsePermission=\u00a7cVous n''avez pas la permission d''utiliser ce warp.
|
||||
warpingTo=\u00a77T\u00e9l\u00e9portation au warp {0}.
|
||||
warps=Raccourcis : {0}
|
||||
warpsCount=\u00a77Il y a {0} raccourcis. Page {1} sur {2}.
|
||||
warpListPermission=\u00a7cVous n'avez pas la permission d'afficher la liste des points de t\u00e9l\u00e9portation.
|
||||
warpNotExist=Ce point de t\u00e9l\u00e9portation n'existe pas.
|
||||
warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
|
||||
warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation.
|
||||
warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}.
|
||||
warps=point de t\u00e9l\u00e9portations : {0}
|
||||
warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}.
|
||||
weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0}
|
||||
weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes.
|
||||
weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0}
|
||||
weatherSunFor=\u00a77Vous avez programm\u00e9 le beau temps dans {0} pour {1} secondes.
|
||||
whoisBanned=\u00a79 - Banned: {0}
|
||||
whoisBanned=\u00a79 - Banni : {0}
|
||||
whoisGamemode=\u00a79 - Mode de jeu : {0}
|
||||
whoisGeoLocation=\u00a79 - Emplacement : {0}
|
||||
whoisGod=\u00a79 - Mode Dieu : {0}
|
||||
whoisHealth=\u00a79 - Vie : {0} / 20
|
||||
whoisHealth=\u00a79 - Sant\u00e9 : {0} / 20
|
||||
whoisIPAddress=\u00a79 - Adresse IP : {0}
|
||||
whoisIs={0} est {1}
|
||||
whoisLocation=\u00a79 - Emplacement : ({0}, {1}, {2}, {3})
|
||||
@@ -402,5 +406,3 @@ year=ann\u00e9e
|
||||
years=ann\u00e9es
|
||||
youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
|
||||
youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -33,6 +33,8 @@ canTalkAgain=\u00a77Je kan weer praten.
|
||||
cantFindGeoIpDB=De GeoIP database kon niet gevonden worden!
|
||||
cantReadGeoIpDB=Fout bij het lezen van de GeoIP database!
|
||||
cantSpawnItem=\u00a7cJe bent niet bevoegd om {0} te spawnen.
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
commandFailed=Opdracht {0} mislukt:
|
||||
commandHelpFailedForPlugin=Fout bij het \u200b\u200bkrijgen van hulp voor: {0}
|
||||
commandNotLoaded=\u00a7cOpdracht {0} is fout geladen.
|
||||
@@ -169,7 +171,6 @@ listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79
|
||||
listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
|
||||
listHiddenTag = \u00a77[HIDDEN]\u00a7f
|
||||
loadWarpError=Fout bij het laden van warp {0}
|
||||
loadinfo=Build {1} geladen {0} van {2}
|
||||
localFormat=Local: <{0}> {1}
|
||||
mailClear=\u00a7cType /mail clear, om ej berichten als gelezen te markeren.
|
||||
mailCleared=\u00a77Bericht geklaard!
|
||||
@@ -237,6 +238,7 @@ notRecommendedBukkit=* ! * De Bukkit versie is niet de aangeraden build voor Ess
|
||||
notSupportedYet=Nog niet ondersteund.
|
||||
nothingInHand = \u00a7cYou have nothing in your hand.
|
||||
now=nu
|
||||
nuke=May death rain upon them
|
||||
numberRequired=Er moet daar een nummer, grapjas.
|
||||
onlyDayNight=/time ondersteund alleen day/night.
|
||||
onlyPlayers=Alleen in-game spelers kunnen {0} gebruiken.
|
||||
@@ -291,8 +293,9 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request.
|
||||
requestDenied=\u00a77Teleporteer aanvraag geweigerd.
|
||||
requestDeniedFrom=\u00a77{0} denied your teleport request.
|
||||
requestSent=\u00a77Aanvraag verstuurd naar {0}\u00a77.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
|
||||
returnPlayerToJailError=Fout opgetreden bij terugzetten van speler in gevangenis.
|
||||
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
|
||||
second=seconde
|
||||
seconds=seconde
|
||||
seenOffline=Speler {0} is offline vanaf {1}
|
||||
@@ -322,6 +325,7 @@ teleportDisabled={0} heeft teleporteren uit gezet.
|
||||
teleportHereRequest=\u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren.
|
||||
teleportNewPlayerError=Fout bij het teleporteren van nieuwe speler.
|
||||
teleportRequest=\u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren.
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
teleportTop=\u00a77Bezig met teleporteren naar de top.
|
||||
teleportationCommencing=\u00a77Aan het beginnen met teleporteren...
|
||||
teleportationDisabled=\u00a77Teleportatie uitgeschakeld.
|
||||
@@ -402,5 +406,3 @@ year=jaar
|
||||
years=jaren
|
||||
youAreHealed=\u00a77Je bent genezen.
|
||||
youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
|
||||
requestTimedOut=\u00a7cTeleport request has timed out
|
||||
teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
|
||||
@@ -3,7 +3,7 @@ name: Essentials
|
||||
main: com.earth2me.essentials.Essentials
|
||||
# Note to developers: This next line cannot change, or the automatic versioning system will break.
|
||||
version: TeamCity
|
||||
website: http://ci.earth2me.net/
|
||||
website: http://tiny.cc/EssentialsCommands
|
||||
description: Provides an essential, core set of commands for Bukkit.
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
|
||||
commands:
|
||||
@@ -348,7 +348,7 @@ commands:
|
||||
aliases: [etpaall]
|
||||
tpaccept:
|
||||
description: Accepts a teleport request.
|
||||
usage: /<command>
|
||||
usage: /<command> [otherplayer]
|
||||
aliases: [tpyes,etpaccept,etpyes]
|
||||
tpahere:
|
||||
description: Request that the specified player teleport to you.
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.bukkit.map.MapView;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.ServicesManager;
|
||||
import org.bukkit.plugin.messaging.Messenger;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.bukkit.scheduler.BukkitWorker;
|
||||
@@ -549,6 +550,12 @@ public class FakeServer implements Server
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBedSpawnLocation()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -623,4 +630,28 @@ public class FakeServer implements Server
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Messenger getMessenger()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPluginMessage(Plugin plugin, String string, byte[] bytes)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getListeningPluginChannels()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useExactLoginLocation()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
||||
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=7c7f517b
|
||||
nbproject/build-impl.xml.script.CRC32=4e36cf00
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=52184b61
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.earth2me.essentials.chat;
|
||||
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
|
||||
|
||||
public class ChatStore
|
||||
{
|
||||
private final User user;
|
||||
private final String type;
|
||||
private final Trade charge;
|
||||
private long radius;
|
||||
|
||||
ChatStore(final IEssentials ess, final User user, final String type)
|
||||
{
|
||||
this.user = user;
|
||||
this.type = type;
|
||||
this.charge = new Trade(getLongType(), ess);
|
||||
}
|
||||
|
||||
public User getUser()
|
||||
{
|
||||
return user;
|
||||
}
|
||||
|
||||
public Trade getCharge()
|
||||
{
|
||||
return charge;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getLongType()
|
||||
{
|
||||
return type.length() > 0 ? "chat" : "chat-" + type;
|
||||
}
|
||||
|
||||
public long getRadius()
|
||||
{
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void setRadius(long radius)
|
||||
{
|
||||
this.radius = radius;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ public class EssentialsChat extends JavaPlugin
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient Map<String, IEssentialsChatListener> chatListener;
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
@@ -36,17 +35,16 @@ public class EssentialsChat extends JavaPlugin
|
||||
}
|
||||
|
||||
chatListener = new ConcurrentSkipListMap<String, IEssentialsChatListener>();
|
||||
final Map<PlayerChatEvent, String> charges = new HashMap<PlayerChatEvent, String>();
|
||||
|
||||
final Map<PlayerChatEvent, ChatStore> chatStore = new HashMap<PlayerChatEvent, ChatStore>();
|
||||
|
||||
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatListener);
|
||||
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatListener, charges);
|
||||
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatListener, charges);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerLowest, Priority.Lowest, this);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerNormal, Priority.Normal, this);
|
||||
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this);
|
||||
|
||||
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
|
||||
final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatListener, chatStore);
|
||||
final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatListener, chatStore);
|
||||
final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatListener, chatStore);
|
||||
pluginManager.registerEvents(playerListenerLowest, this);
|
||||
pluginManager.registerEvents(playerListenerNormal, this);
|
||||
pluginManager.registerEvents(playerListenerHighest, this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,24 +10,28 @@ import java.util.logging.Logger;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
|
||||
//TODO: Translate the local/spy tags
|
||||
public abstract class EssentialsChatPlayer extends PlayerListener
|
||||
public abstract class EssentialsChatPlayer implements Listener
|
||||
{
|
||||
protected transient IEssentials ess;
|
||||
protected final static Logger logger = Logger.getLogger("Minecraft");
|
||||
protected final transient Map<String, IEssentialsChatListener> listeners;
|
||||
protected final transient Server server;
|
||||
protected final transient Map<PlayerChatEvent, ChatStore> chatStorage;
|
||||
|
||||
public EssentialsChatPlayer(Server server, IEssentials ess, Map<String, IEssentialsChatListener> listeners)
|
||||
public EssentialsChatPlayer(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners,
|
||||
final Map<PlayerChatEvent, ChatStore> chatStorage)
|
||||
{
|
||||
this.ess = ess;
|
||||
this.listeners = listeners;
|
||||
this.server = server;
|
||||
this.chatStorage = chatStorage;
|
||||
}
|
||||
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
@@ -35,11 +39,6 @@ public abstract class EssentialsChatPlayer extends PlayerListener
|
||||
}
|
||||
|
||||
public boolean isAborted(final PlayerChatEvent event)
|
||||
{
|
||||
return isAborted(event, "chat");
|
||||
}
|
||||
|
||||
public boolean isAborted(final PlayerChatEvent event, final String command)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
@@ -52,13 +51,6 @@ public abstract class EssentialsChatPlayer extends PlayerListener
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
if (!isAffordableFor(user, command))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -75,64 +67,77 @@ public abstract class EssentialsChatPlayer extends PlayerListener
|
||||
}
|
||||
}
|
||||
|
||||
protected void charge(final CommandSender sender, final String command) throws ChargeException
|
||||
public ChatStore getChatStore(final PlayerChatEvent event)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
final Trade charge = new Trade(command, ess);
|
||||
charge.charge(ess.getUser((Player)sender));
|
||||
}
|
||||
return chatStorage.get(event);
|
||||
}
|
||||
|
||||
protected boolean isAffordableFor(final CommandSender sender, final String command)
|
||||
public void setChatStore(final PlayerChatEvent event, final ChatStore chatStore)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
chatStorage.put(event, chatStore);
|
||||
}
|
||||
|
||||
public ChatStore delChatStore(final PlayerChatEvent event)
|
||||
{
|
||||
return chatStorage.remove(event);
|
||||
}
|
||||
|
||||
protected void charge(final User user, final Trade charge) throws ChargeException
|
||||
{
|
||||
charge.charge(user);
|
||||
}
|
||||
|
||||
protected boolean charge(final PlayerChatEvent event, final ChatStore chatStore)
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
final Trade charge = new Trade(command, ess);
|
||||
charge.isAffordableFor(ess.getUser((Player)sender));
|
||||
}
|
||||
catch (ChargeException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
charge(chatStore.getUser(), chatStore.getCharge());
|
||||
}
|
||||
else
|
||||
catch (ChargeException e)
|
||||
{
|
||||
ess.showError(chatStore.getUser(), e, chatStore.getLongType());
|
||||
event.setCancelled(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void sendLocalChat(final User sender, final long radius, final PlayerChatEvent event)
|
||||
protected void sendLocalChat(final PlayerChatEvent event, final ChatStore chatStore)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
final User sender = chatStore.getUser();
|
||||
logger.info(_("localFormat", sender.getName(), event.getMessage()));
|
||||
final Location loc = sender.getLocation();
|
||||
final World world = loc.getWorld();
|
||||
|
||||
|
||||
if (charge(event, chatStore) == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
String type = "[L]";
|
||||
final User user = ess.getUser(onlinePlayer);
|
||||
String type = _("chatTypeLocal");
|
||||
final User onlineUser = ess.getUser(onlinePlayer);
|
||||
//TODO: remove reference to op
|
||||
if (user.isIgnoredPlayer(sender.getName()) && !sender.isOp())
|
||||
if (onlineUser.isIgnoredPlayer(sender.getName()) && !sender.isOp())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!user.equals(sender))
|
||||
{
|
||||
final Location playerLoc = user.getLocation();
|
||||
if (playerLoc.getWorld() != world) { continue; }
|
||||
final double delta = playerLoc.distanceSquared(loc);
|
||||
|
||||
if (delta > radius)
|
||||
if (!onlineUser.equals(sender))
|
||||
{
|
||||
final Location playerLoc = onlineUser.getLocation();
|
||||
if (playerLoc.getWorld() != world)
|
||||
{
|
||||
if (user.isAuthorized("essentials.chat.spy"))
|
||||
continue;
|
||||
}
|
||||
final double delta = playerLoc.distanceSquared(loc);
|
||||
|
||||
if (delta > chatStore.getRadius())
|
||||
{
|
||||
if (onlineUser.isAuthorized("essentials.chat.spy"))
|
||||
{
|
||||
type = type.concat("[Spy]");
|
||||
type = type.concat(_("chatTypeSpy"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -146,7 +151,7 @@ public abstract class EssentialsChatPlayer extends PlayerListener
|
||||
{
|
||||
message = listener.modifyMessage(event, onlinePlayer, message);
|
||||
}
|
||||
user.sendMessage(message);
|
||||
onlineUser.sendMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-24
@@ -1,34 +1,28 @@
|
||||
package com.earth2me.essentials.chat;
|
||||
|
||||
import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
|
||||
|
||||
public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
|
||||
{
|
||||
private final transient Map<PlayerChatEvent, String> charges;
|
||||
|
||||
public EssentialsChatPlayerListenerHighest(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners,
|
||||
final Map<PlayerChatEvent, String> charges)
|
||||
final Map<PlayerChatEvent, ChatStore> chatStorage)
|
||||
{
|
||||
super(server, ess, listeners);
|
||||
this.charges = charges;
|
||||
super(server, ess, listeners, chatStorage);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@Override
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
{
|
||||
String charge = charges.remove(event);
|
||||
if (charge == null)
|
||||
{
|
||||
charge = "chat";
|
||||
}
|
||||
final ChatStore chatStore = delChatStore(event);
|
||||
if (isAborted(event))
|
||||
{
|
||||
return;
|
||||
@@ -37,17 +31,6 @@ public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
|
||||
/**
|
||||
* This file should handle charging the user for the action before returning control back
|
||||
*/
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
try
|
||||
{
|
||||
charge(user, charge);
|
||||
}
|
||||
catch (ChargeException e)
|
||||
{
|
||||
ess.showError(user, e, charge);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
charge(event, chatStore);
|
||||
}
|
||||
}
|
||||
+19
-5
@@ -2,9 +2,12 @@ package com.earth2me.essentials.chat;
|
||||
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
|
||||
|
||||
@@ -12,11 +15,13 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
|
||||
{
|
||||
public EssentialsChatPlayerListenerLowest(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners)
|
||||
final Map<String, IEssentialsChatListener> listeners,
|
||||
final Map<PlayerChatEvent, ChatStore> chatStorage)
|
||||
{
|
||||
super(server, ess, listeners);
|
||||
super(server, ess, listeners, chatStorage);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@Override
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
{
|
||||
@@ -25,14 +30,23 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
|
||||
return;
|
||||
}
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final ChatStore chatStore = new ChatStore(ess, user, getChatType(event.getMessage()));
|
||||
setChatStore(event, chatStore);
|
||||
|
||||
/**
|
||||
* This listener should apply the general chat formatting only...then return control back the event handler
|
||||
*/
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
if (user.isAuthorized("essentials.chat.color"))
|
||||
{
|
||||
event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "\u00a7$1"));
|
||||
event.setMessage(Util.replaceColor(event.getMessage()));
|
||||
}
|
||||
event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase(Locale.ENGLISH)));
|
||||
else
|
||||
{
|
||||
event.setMessage(Util.stripColor(event.getMessage()));
|
||||
}
|
||||
String group = user.getGroup();
|
||||
String world = user.getWorld().getName();
|
||||
event.setFormat(ess.getSettings().getChatFormat(group).format(new Object[] {group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH)}));
|
||||
}
|
||||
}
|
||||
+24
-31
@@ -6,22 +6,22 @@ import com.earth2me.essentials.User;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
|
||||
|
||||
public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
|
||||
{
|
||||
private final transient Map<PlayerChatEvent, String> charges;
|
||||
|
||||
public EssentialsChatPlayerListenerNormal(final Server server,
|
||||
final IEssentials ess,
|
||||
final Map<String, IEssentialsChatListener> listeners,
|
||||
final Map<PlayerChatEvent, String> charges)
|
||||
final Map<PlayerChatEvent, ChatStore> chatStorage)
|
||||
{
|
||||
super(server, ess, listeners);
|
||||
this.charges = charges;
|
||||
super(server, ess, listeners, chatStorage);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
@Override
|
||||
public void onPlayerChat(final PlayerChatEvent event)
|
||||
{
|
||||
@@ -33,47 +33,40 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
|
||||
/**
|
||||
* This file should handle detection of the local chat features... if local chat is enabled, we need to handle
|
||||
* it here
|
||||
*/
|
||||
final String chatType = getChatType(event.getMessage());
|
||||
final StringBuilder command = new StringBuilder();
|
||||
command.append("chat");
|
||||
|
||||
if (chatType.length() > 0)
|
||||
{
|
||||
command.append("-").append(chatType);
|
||||
}
|
||||
*/
|
||||
long radius = ess.getSettings().getChatRadius();
|
||||
if (radius < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
radius *= radius;
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (event.getMessage().length() > 0 && chatType.length() > 0)
|
||||
|
||||
final ChatStore chatStore = getChatStore(event);
|
||||
final User user = chatStore.getUser();
|
||||
chatStore.setRadius(radius);
|
||||
|
||||
if (event.getMessage().length() > 1 && chatStore.getType().length() > 0)
|
||||
{
|
||||
final StringBuilder permission = new StringBuilder();
|
||||
permission.append("essentials.chat.").append(chatType);
|
||||
|
||||
final StringBuilder format = new StringBuilder();
|
||||
format.append(chatType).append("Format");
|
||||
|
||||
final StringBuilder errorMsg = new StringBuilder();
|
||||
errorMsg.append("notAllowedTo").append(chatType.substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatType.substring(1));
|
||||
|
||||
permission.append("essentials.chat.").append(chatStore.getType());
|
||||
|
||||
if (user.isAuthorized(permission.toString()))
|
||||
{
|
||||
final StringBuilder format = new StringBuilder();
|
||||
format.append(chatStore.getType()).append("Format");
|
||||
event.setMessage(event.getMessage().substring(1));
|
||||
event.setFormat(_(format.toString(), event.getFormat()));
|
||||
charges.put(event, command.toString());
|
||||
event.setFormat(_(format.toString(), event.getFormat()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
final StringBuilder errorMsg = new StringBuilder();
|
||||
errorMsg.append("notAllowedTo").append(chatStore.getType().substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatStore.getType().substring(1));
|
||||
|
||||
user.sendMessage(_(errorMsg.toString()));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
sendLocalChat(user, radius, event);
|
||||
|
||||
sendLocalChat(event, chatStore);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ name: EssentialsChat
|
||||
main: com.earth2me.essentials.chat.EssentialsChat
|
||||
# Note to developers: This next line cannot change, or the automatic versioning system will break.
|
||||
version: TeamCity
|
||||
website: http://www.earth2me.net:8001/
|
||||
website: http://tiny.cc/EssentialsCommands
|
||||
description: Provides chat control features for Essentials. Requires Permissions.
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, Okamosy]
|
||||
depend: [Essentials]
|
||||
|
||||
@@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
||||
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=cbf94f59
|
||||
nbproject/build-impl.xml.script.CRC32=ae9285d7
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=db2bb7a7
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
@@ -3,17 +3,12 @@ package com.earth2me.essentials.geoip;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
|
||||
public class EssentialsGeoIP extends JavaPlugin
|
||||
{
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
|
||||
public EssentialsGeoIP()
|
||||
{
|
||||
}
|
||||
@@ -30,17 +25,16 @@ public class EssentialsGeoIP extends JavaPlugin
|
||||
final IEssentials ess = (IEssentials)pm.getPlugin("Essentials");
|
||||
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
|
||||
{
|
||||
logger.log(Level.WARNING, _("versionMismatchAll"));
|
||||
getLogger().log(Level.WARNING, _("versionMismatchAll"));
|
||||
}
|
||||
if (!ess.isEnabled()) {
|
||||
this.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder(), ess);
|
||||
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
|
||||
pm.registerEvents(playerListener, this);
|
||||
|
||||
logger.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
|
||||
|
||||
logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
|
||||
getLogger().log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -17,11 +17,13 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
|
||||
|
||||
public class EssentialsGeoIPPlayerListener extends PlayerListener implements IConf
|
||||
public class EssentialsGeoIPPlayerListener implements Listener, IConf
|
||||
{
|
||||
LookupService ls = null;
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
@@ -39,7 +41,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
|
||||
reloadConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
User u = ess.getUser(event.getPlayer());
|
||||
|
||||
@@ -3,7 +3,7 @@ name: EssentialsGeoIP
|
||||
main: com.earth2me.essentials.geoip.EssentialsGeoIP
|
||||
# Note to developers: This next line cannot change, or the automatic versioning system will break.
|
||||
version: TeamCity
|
||||
website: http://www.earth2me.net:8001/
|
||||
website: http://tiny.cc/EssentialsCommands
|
||||
description: Shows the country or city of a user on login and /whois.
|
||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
|
||||
depend: [Essentials]
|
||||
@@ -2,8 +2,8 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="../lib/bukkit-0.0.1-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="../lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="../lib/bukkit.jar"/>
|
||||
<classpathentry kind="lib" path="../lib/craftbukkit.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/EssentialsGroupManager"/>
|
||||
<classpathentry kind="lib" path="../lib/Permissions3.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
|
||||
@@ -848,6 +848,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@@ -859,6 +867,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
||||
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=475c8f4d
|
||||
nbproject/build-impl.xml.script.CRC32=aa68bcd9
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=c7581402
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.nijikokun.bukkit.Permissions;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
|
||||
|
||||
public class OverrideListener implements Listener {
|
||||
|
||||
Permissions permClass;
|
||||
|
||||
OverrideListener(Permissions instance) {
|
||||
this.permClass = instance;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPluginEnable(PluginEnableEvent event) {
|
||||
if (event.getPlugin().getDescription().getName().equals("GroupManager")) {
|
||||
permClass.setGM(event.getPlugin());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,10 +4,6 @@ import com.nijiko.permissions.PermissionHandler;
|
||||
import java.util.logging.Logger;
|
||||
//import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -41,15 +37,7 @@ public class Permissions extends JavaPlugin {
|
||||
setGM(p);
|
||||
} else {
|
||||
if (this.getServer() != null) {
|
||||
this.getServer().getPluginManager().registerEvent(Type.PLUGIN_ENABLE, new ServerListener() {
|
||||
|
||||
@Override
|
||||
public void onPluginEnable(PluginEnableEvent event) {
|
||||
if (event.getPlugin().getDescription().getName().equals("GroupManager")) {
|
||||
Permissions.this.setGM(event.getPlugin());
|
||||
}
|
||||
}
|
||||
}, Priority.Normal, this);
|
||||
this.getServer().getPluginManager().registerEvents(new OverrideListener(this), this);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -62,7 +50,7 @@ public class Permissions extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
private void setGM(final Plugin p) {
|
||||
public void setGM(final Plugin p) {
|
||||
//GroupManager groupManager = (GroupManager) p;
|
||||
((NijikoPermissionsProxy) Security).setGM(p);
|
||||
}
|
||||
@@ -79,4 +67,9 @@ public class Permissions extends JavaPlugin {
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,16 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>LaunchConfigHandle</key>
|
||||
<value><project>/.externalToolBuilders/GroupManager.launch</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
|
||||
@@ -841,6 +841,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@@ -852,6 +860,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
||||
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=a6709b83
|
||||
nbproject/build-impl.xml.script.CRC32=142d30c4
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=fe0fea25
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
@@ -85,4 +85,44 @@ v 1.7:
|
||||
- Offline player checks now support partial name matches.
|
||||
- Added custom events so plugins can now be notified of changes within GroupManager.
|
||||
- GM now registers with Bukkits ServicesManager.
|
||||
- deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException.
|
||||
- deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException.
|
||||
- Removed op permissions from admins in the default GloblaGroups.yml.
|
||||
v 1.8:
|
||||
- Changed ServicesManager registration to lowest from normal.
|
||||
- Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup.
|
||||
- 'manpromote' and 'mandemote' now correctly send the notification to the console if the command was issued there.
|
||||
- Expanded GlobalGroups.yml and Groups.yml to include Towny permissions.
|
||||
- Delayed GroupManager events so Superperms will be fully updated before plugins receive the events.
|
||||
- Changed the way events are raised to prevent variable corruption.
|
||||
- Reload GlobalGroups when you perform a world load.
|
||||
- Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading
|
||||
- Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit.
|
||||
- Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
|
||||
- Major, MAJOR changes to support partial/full world mirroring.
|
||||
You can now mirror groups.yml, users.yml or both files between different worlds.
|
||||
- Catch NullPointerErrors generated by blank permission nodes.
|
||||
- Removed '- bukkit.command' form the globalgroups permission nodes.
|
||||
v 1.9:
|
||||
- Optimize populating Bukkit perms so we no longer calculate the child nodes (Bukkit already does this).
|
||||
- Added a tidy error message for invalid permission entries in GlobalGroups.
|
||||
- Better optimize assembling of a players permissions and allow the * node to populate all registered superperms.
|
||||
- Fixed text when adding a subgroup to not say the player was moved.
|
||||
- Update to new Bukkit Event system.
|
||||
- Update GroupManagerBridge for new event system.
|
||||
- Fixed a random null error upon a player portaling.
|
||||
- Fixed infinite loop error on player join.
|
||||
- Optimized code to only update the player logging in instead of all players online.
|
||||
- Added recursive loop detection for World mirroring (you may not set the main world as a mirror of another).
|
||||
- Fixed fetching world data so it no longer returns the mirrored world for groups. Each world data holder now points to the correct data set, so can be returned as an object.
|
||||
- Changed addSubGroup() to only add the group if it doesn't already exist (no need to update an already existing group).
|
||||
- addSubGroup now returns a boolean for success/failure.
|
||||
- '/manuaddsub' now correctly reports if it was able to add the sub group.
|
||||
- Allow negation to the * permission node when populating superperms.
|
||||
- Fix trying to modify an unmodifiable collection breaking superperms.
|
||||
- Fixed subgroups (I broke earlier).
|
||||
- Check for a null player object in the PlayerTeleportEvent.
|
||||
- Trap errors in fetching the mirrors map.
|
||||
- Fixed an infinite loop error when using '/manudel' on a logged in player. It caused setDefaultGroup to trigger a bukkit update when no GM User existed yet.
|
||||
- do not allow inherited permissions to negate higher perms.
|
||||
- Fixed a bug when pushing superperms in the wrong order.
|
||||
- Fix players retaining permissions when demoted.
|
||||
@@ -4,9 +4,9 @@ settings:
|
||||
# The user will be able to promote players to the same group or even above.
|
||||
opOverrides: true
|
||||
|
||||
# If enabled any plugins bukkit permissions which default to true will be left enabled.
|
||||
# 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: false
|
||||
bukkit_perms_override: true
|
||||
|
||||
# Default setting for 'mantoglevalidate'
|
||||
# true will cause GroupManager to attempt name matching by default.
|
||||
@@ -25,14 +25,22 @@ settings:
|
||||
level: INFO
|
||||
|
||||
mirrors:
|
||||
# Worlds listed here have their permissions mirrored in their children.
|
||||
# the first element 'world' is the main worlds name
|
||||
# subsequent elements '- world_nether' are worlds which will use the same
|
||||
# user/groups permissions as the parent.
|
||||
# Worlds listed here have their settings mirrored in their children.
|
||||
# The first element 'world' is the main worlds name
|
||||
# subsequent elements 'world_nether' and 'world_the_end' are worlds which will use
|
||||
# the same user/groups files as the parent.
|
||||
# Each child world can be configured to mirror the 'groups', 'users' or both files from it's parent.
|
||||
world:
|
||||
- world_nether
|
||||
- world_the_end
|
||||
- world2
|
||||
- world3
|
||||
# world4:
|
||||
# - world5
|
||||
world_nether:
|
||||
- users
|
||||
- groups
|
||||
world_the_end:
|
||||
- users
|
||||
- groups
|
||||
# world2: (World2 would have it's own set of user and groups files)
|
||||
# world3:
|
||||
# - users (World3 would use the users.yml from world2, but it's own groups.yml)
|
||||
# world4:
|
||||
# - groups (World4 would use the groups.yml from world2, but it's own users.yml)
|
||||
# world5:
|
||||
# - world6 (this would cause world6 to mirror both files from world5)
|
||||
@@ -1,9 +1,5 @@
|
||||
groups:
|
||||
|
||||
g:bukkit_default:
|
||||
permissions:
|
||||
- bukkit.broadcast.user
|
||||
|
||||
g:essentials_default:
|
||||
permissions:
|
||||
- essentials.help
|
||||
@@ -129,6 +125,11 @@ groups:
|
||||
- groupmanager.manucheckp
|
||||
- groupmanager.manulistp
|
||||
|
||||
g:bukkit_default:
|
||||
permissions:
|
||||
- bukkit.broadcast.user
|
||||
- -bukkit.command.plugins
|
||||
|
||||
g:bukkit_moderator:
|
||||
permissions:
|
||||
- bukkit.command.ban
|
||||
@@ -144,15 +145,14 @@ groups:
|
||||
permissions:
|
||||
- bukkit.broadcast
|
||||
- bukkit.broadcast.admin
|
||||
- bukkit.command
|
||||
- bukkit.command.give
|
||||
- bukkit.command.help
|
||||
- bukkit.command.kill
|
||||
- bukkit.command.list
|
||||
- bukkit.command.me
|
||||
- bukkit.command.op
|
||||
- bukkit.command.op.give
|
||||
- bukkit.command.op.take
|
||||
- -bukkit.command.op
|
||||
- -bukkit.command.op.give
|
||||
- -bukkit.command.op.take
|
||||
- bukkit.command.plugins
|
||||
- bukkit.command.reload
|
||||
- bukkit.command.save
|
||||
@@ -174,3 +174,52 @@ groups:
|
||||
- bukkit.command.whitelist.list
|
||||
- bukkit.command.whitelist.reload
|
||||
- bukkit.command.whitelist.remove
|
||||
|
||||
g:towny_builder:
|
||||
permissions:
|
||||
- towny.town.*
|
||||
- towny.nation.*
|
||||
- towny.chat.tc
|
||||
- towny.chat.nc
|
||||
- towny.wild.block.6.*
|
||||
- towny.wild.block.14.destroy
|
||||
- towny.wild.block.15.destroy
|
||||
- towny.wild.block.16.destroy
|
||||
- towny.wild.block.17.*
|
||||
- towny.wild.block.18.destroy
|
||||
- towny.wild.block.21.destroy
|
||||
- towny.wild.block.31.destroy
|
||||
- towny.wild.block.37.destroy
|
||||
- towny.wild.block.38.destroy
|
||||
- towny.wild.block.39.destroy
|
||||
- towny.wild.block.40.destroy
|
||||
- towny.wild.block.50.destroy
|
||||
- towny.wild.block.56.destroy
|
||||
- towny.wild.block.73.destroy
|
||||
- towny.wild.block.74.destroy
|
||||
- towny.wild.block.78.destroy
|
||||
- towny.wild.block.81.destroy
|
||||
- towny.wild.block.82.destroy
|
||||
- towny.wild.block.83.destroy
|
||||
- towny.wild.block.86.destroy
|
||||
- towny.wild.block.103.destroy
|
||||
- towny.wild.block.106.destroy
|
||||
- towny.wild.block.111.destroy
|
||||
- towny.wild.block.115.destroy
|
||||
|
||||
g:towny_moderator:
|
||||
permissions:
|
||||
- towny.chat.mod
|
||||
- towny.wild.block.64.switch
|
||||
- towny.wild.block.83.build
|
||||
- towny.wild.block.86.build
|
||||
- towny.wild.block.103.build
|
||||
- towny.wild.block.111.build
|
||||
- towny.wild.block.115.build
|
||||
|
||||
g:towny_admin:
|
||||
permissions:
|
||||
- towny.admin
|
||||
- -towny.wild.block.119.destroy
|
||||
- -towny.wild.block.120.destroy
|
||||
- towny.chat.admin
|
||||
@@ -24,6 +24,7 @@ groups:
|
||||
inheritance:
|
||||
- default
|
||||
- g:essentials_builder
|
||||
- g:towny_moderator
|
||||
info:
|
||||
prefix: '&2'
|
||||
build: true
|
||||
@@ -35,6 +36,7 @@ groups:
|
||||
- builder
|
||||
- g:essentials_moderator
|
||||
- g:bukkit_moderator
|
||||
- g:towny_moderator
|
||||
info:
|
||||
prefix: '&5'
|
||||
build: true
|
||||
@@ -46,6 +48,7 @@ groups:
|
||||
- moderator
|
||||
- g:essentials_admin
|
||||
- g:bukkit_admin
|
||||
- g:towny_admin
|
||||
info:
|
||||
prefix: '&c'
|
||||
build: true
|
||||
|
||||
@@ -66,10 +66,12 @@ public class GMConfiguration {
|
||||
|
||||
public Map<String, Object> getMirrorsMap() {
|
||||
// Try to fetch the old mirror path first
|
||||
if (GMconfig.isConfigurationSection("settings.permission.world.mirror"))
|
||||
if (GMconfig.isConfigurationSection("settings.permission.world.mirror")) {
|
||||
return (Map<String, Object>) GMconfig.getConfigurationSection("settings.permission.world.mirror").getValues(false);
|
||||
else
|
||||
} else if (GMconfig.isConfigurationSection("settings.mirrors")){
|
||||
return (Map<String, Object>) GMconfig.getConfigurationSection("settings.mirrors").getValues(false);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,12 @@ public class GlobalGroups {
|
||||
|
||||
if (element != null)
|
||||
if (element instanceof List) {
|
||||
for (String node : (List<String>) element) {
|
||||
newGroup.addPermission(node);
|
||||
try {
|
||||
for (String node : (List<String>) element) {
|
||||
newGroup.addPermission(node);
|
||||
}
|
||||
} catch (ClassCastException e) {
|
||||
throw new IllegalArgumentException("Invalid permission node for global group: " + groupName);
|
||||
}
|
||||
} else if (element instanceof String) {
|
||||
newGroup.addPermission((String) element);
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder;
|
||||
import org.anjocaido.groupmanager.events.GMWorldListener;
|
||||
import org.anjocaido.groupmanager.events.GroupManagerEvent;
|
||||
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
|
||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
import org.anjocaido.groupmanager.utils.Tasks;
|
||||
@@ -38,8 +37,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.world.WorldListener;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.ServicePriority;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -82,7 +79,7 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
private GMLoggerHandler ch;
|
||||
public static BukkitPermissions BukkitPermissions;
|
||||
private static WorldListener WorldEvents;
|
||||
private static GMWorldListener WorldEvents;
|
||||
public static final Logger logger = Logger.getLogger(GroupManager.class.getName());
|
||||
|
||||
// PERMISSIONS FOR COMMAND BEING LOADED
|
||||
@@ -161,7 +158,7 @@ public class GroupManager extends JavaPlugin {
|
||||
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
|
||||
// Register as a service
|
||||
this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Normal);
|
||||
this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Lowest);
|
||||
}
|
||||
|
||||
public static boolean isLoaded() {
|
||||
@@ -415,12 +412,12 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
// PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
if (!sender.hasPermission("groupmanager.notify.other"))
|
||||
if (!sender.hasPermission("groupmanager.notify.other") || (isConsole))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "'.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null)
|
||||
BukkitPermissions.updatePermissions(targetPlayer);
|
||||
//targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
//if (targetPlayer != null)
|
||||
// BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
// break;
|
||||
@@ -453,6 +450,7 @@ public class GroupManager extends JavaPlugin {
|
||||
dataHolder.removeUser(auxUser.getName());
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' to default settings.");
|
||||
|
||||
// If the player is online, this will create new data for the user.
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null)
|
||||
BukkitPermissions.updatePermissions(targetPlayer);
|
||||
@@ -492,12 +490,14 @@ public class GroupManager extends JavaPlugin {
|
||||
return false;
|
||||
}
|
||||
// PARECE OK
|
||||
auxUser.addSubGroup(auxGroup);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "'.");
|
||||
if (auxUser.addSubGroup(auxGroup))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You added subgroup '" + auxGroup.getName() + "' to player '" + auxUser.getName() + "'.");
|
||||
else
|
||||
sender.sendMessage(ChatColor.RED + "The subgroup '" + auxGroup.getName() + "' is already available to '" + auxUser.getName() + "'.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null)
|
||||
BukkitPermissions.updatePermissions(targetPlayer);
|
||||
//targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
//if (targetPlayer != null)
|
||||
// BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
case manudelsub:
|
||||
@@ -535,9 +535,9 @@ public class GroupManager extends JavaPlugin {
|
||||
auxUser.removeSubGroup(auxGroup);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You removed subgroup '" + auxGroup.getName() + "' from player '" + auxUser.getName() + "' list.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null)
|
||||
BukkitPermissions.updatePermissions(targetPlayer);
|
||||
//targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
//if (targetPlayer != null)
|
||||
// BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
case mangadd:
|
||||
@@ -787,29 +787,29 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
// VALIDANDO PERMISSAO
|
||||
permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]);
|
||||
permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false);
|
||||
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||
//No permissions found in GM so fall through and check Bukkit.
|
||||
sender.sendMessage(ChatColor.RED + "The player doesn't have access to that permission");
|
||||
sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]));
|
||||
return false;
|
||||
}
|
||||
// PARECE OK
|
||||
// auxString =
|
||||
// permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
||||
if (permissionResult.owner instanceof User) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
|
||||
|
||||
} else {
|
||||
// This permission was found in groupmanager.
|
||||
if (permissionResult.owner instanceof User) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
} else if (permissionResult.owner instanceof Group) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName());
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
} else if (permissionResult.owner instanceof Group) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user inherits the a negation permission from group: " + permissionResult.owner.getName());
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
}
|
||||
|
||||
// superperms
|
||||
@@ -948,7 +948,7 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The grpup '" + auxGroup.getName() + "' has no specific permissions.");
|
||||
sender.sendMessage(ChatColor.YELLOW + "The group '" + auxGroup.getName() + "' has no specific permissions.");
|
||||
auxString = "";
|
||||
for (String grp : auxGroup.getInherits()) {
|
||||
auxString += grp + ", ";
|
||||
@@ -1504,7 +1504,9 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
isLoaded = false; // Disable Bukkit Perms update
|
||||
|
||||
globalGroups.load();
|
||||
worldsHolder.loadWorld(auxString);
|
||||
|
||||
sender.sendMessage("The request to world '" + auxString + "' was sent.");
|
||||
|
||||
isLoaded = true;
|
||||
@@ -1520,7 +1522,8 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
// WORKING
|
||||
config.load();
|
||||
|
||||
worldsHolder.mirrorSetUp();
|
||||
|
||||
isLoaded = false;
|
||||
|
||||
if (args.length > 0) {
|
||||
@@ -1537,7 +1540,6 @@ public class GroupManager extends JavaPlugin {
|
||||
worldsHolder.reloadAll();
|
||||
sender.sendMessage(ChatColor.YELLOW + " The current world was reloaded.");
|
||||
}
|
||||
worldsHolder.mirrorSetUp();
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
@@ -1610,12 +1612,12 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
// PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
if (!sender.hasPermission("groupmanager.notify.other"))
|
||||
if (!sender.hasPermission("groupmanager.notify.other") || (isConsole))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + ".");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null)
|
||||
BukkitPermissions.updatePermissions(targetPlayer);
|
||||
//targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
//if (targetPlayer != null)
|
||||
// BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
// break;
|
||||
@@ -1666,12 +1668,12 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
// PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
if (!sender.hasPermission("groupmanager.notify.other"))
|
||||
if (!sender.hasPermission("groupmanager.notify.other") || (isConsole))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + ".");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null)
|
||||
BukkitPermissions.updatePermissions(targetPlayer);
|
||||
//targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
//if (targetPlayer != null)
|
||||
// BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
// break;
|
||||
@@ -1837,15 +1839,6 @@ public class GroupManager extends JavaPlugin {
|
||||
return match;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers all GroupManager events for other plugins to see.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public static void callEvent(GroupManagerEvent event) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the config
|
||||
|
||||
@@ -113,8 +113,8 @@ public class User extends DataUnit implements Cloneable {
|
||||
this.group = group;
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,6 +122,15 @@ public class User extends DataUnit implements Cloneable {
|
||||
* the group to set
|
||||
*/
|
||||
public void setGroup(Group group) {
|
||||
setGroup(group, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param group the group to set
|
||||
* @param updatePerms if we are to trigger a superperms update.
|
||||
*
|
||||
*/
|
||||
public void setGroup(Group group, Boolean updatePerms) {
|
||||
if (!this.getDataSource().groupExists(group.getName())) {
|
||||
getDataSource().addGroup(group);
|
||||
}
|
||||
@@ -129,9 +138,9 @@ public class User extends DataUnit implements Cloneable {
|
||||
String oldGroup = this.group;
|
||||
this.group = group.getName();
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
if (GroupManager.isLoaded() && (updatePerms)) {
|
||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
|
||||
|
||||
// Do we notify of the group change?
|
||||
String defaultGroupName = getDataSource().getDefaultGroup().getName();
|
||||
@@ -147,22 +156,32 @@ public class User extends DataUnit implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
public void addSubGroup(Group subGroup) {
|
||||
public boolean addSubGroup(Group subGroup) {
|
||||
// Don't allow adding a subgroup if it's already set as the primary.
|
||||
if (this.group.equalsIgnoreCase(subGroup.getName())) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
// User already has this subgroup
|
||||
if (containsSubGroup(subGroup))
|
||||
return false;
|
||||
|
||||
// If the group doesn't exists add it
|
||||
if (!this.getDataSource().groupExists(subGroup.getName())) {
|
||||
getDataSource().addGroup(subGroup);
|
||||
}
|
||||
subGroup = getDataSource().getGroup(subGroup.getName());
|
||||
removeSubGroup(subGroup);
|
||||
|
||||
subGroups.add(subGroup.getName());
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
|
||||
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
|
||||
}
|
||||
return true;
|
||||
|
||||
//subGroup = getDataSource().getGroup(subGroup.getName());
|
||||
//removeSubGroup(subGroup);
|
||||
//subGroups.add(subGroup.getName());
|
||||
}
|
||||
|
||||
public int subGroupsSize() {
|
||||
@@ -182,8 +201,8 @@ public class User extends DataUnit implements Cloneable {
|
||||
if (subGroups.remove(subGroup.getName())) {
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer());
|
||||
GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED);
|
||||
return true;
|
||||
}
|
||||
@@ -229,8 +248,8 @@ public class User extends DataUnit implements Cloneable {
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded()) {
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
//if (!GroupManager.BukkitPermissions.isPlayer_join())
|
||||
// GroupManager.BukkitPermissions.updatePlayer(this.getName());
|
||||
GroupManagerEventHandler.callEvent(this, Action.USER_INFO_CHANGED);
|
||||
}
|
||||
}
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package org.anjocaido.groupmanager.dataholder;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.anjocaido.groupmanager.data.Group;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author ElgarL
|
||||
*
|
||||
*/
|
||||
public class GroupsDataHolder {
|
||||
|
||||
/**
|
||||
* Root World name this set of groups is associated with.
|
||||
*/
|
||||
private String name;
|
||||
private Group defaultGroup = null;
|
||||
private File groupsFile;
|
||||
private boolean haveGroupsChanged = false;
|
||||
private long timeStampGroups = 0;
|
||||
|
||||
/**
|
||||
* The actual groups holder
|
||||
*/
|
||||
private Map<String, Group> groups = new HashMap<String, Group>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
protected GroupsDataHolder() {
|
||||
}
|
||||
|
||||
protected void setWorldName(String worldName) {
|
||||
name = worldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
public String getWorldName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultGroup
|
||||
*/
|
||||
public Group getDefaultGroup() {
|
||||
return defaultGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param defaultGroup the defaultGroup to set
|
||||
*/
|
||||
public void setDefaultGroup(Group defaultGroup) {
|
||||
this.defaultGroup = defaultGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the groups
|
||||
*/
|
||||
public Map<String, Group> getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param groups the groups to set
|
||||
*/
|
||||
public void setGroups(Map<String, Group> groups) {
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the groupsFile
|
||||
*/
|
||||
public File getGroupsFile() {
|
||||
return groupsFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param groupsFile the groupsFile to set
|
||||
*/
|
||||
public void setGroupsFile(File groupsFile) {
|
||||
this.groupsFile = groupsFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the haveGroupsChanged
|
||||
*/
|
||||
public boolean HaveGroupsChanged() {
|
||||
return haveGroupsChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param haveGroupsChanged the haveGroupsChanged to set
|
||||
*/
|
||||
public void setGroupsChanged(boolean haveGroupsChanged) {
|
||||
this.haveGroupsChanged = haveGroupsChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the timeStampGroups
|
||||
*/
|
||||
public long getTimeStampGroups() {
|
||||
return timeStampGroups;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeStampGroups the timeStampGroups to set
|
||||
*/
|
||||
public void setTimeStampGroups(long timeStampGroups) {
|
||||
this.timeStampGroups = timeStampGroups;
|
||||
}
|
||||
|
||||
}
|
||||
+24
-26
@@ -25,13 +25,11 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
*
|
||||
* @param ph
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public OverloadedWorldHolder(WorldDataHolder ph) {
|
||||
super(ph.getName());
|
||||
this.f = ph.f;
|
||||
this.groupsFile = ph.groupsFile;
|
||||
this.usersFile = ph.usersFile;
|
||||
this.defaultGroup = ph.defaultGroup;
|
||||
this.setGroupsFile(ph.getGroupsFile());
|
||||
this.setUsersFile(ph.getUsersFile());
|
||||
//this.setDefaultGroup(ph.getDefaultGroup());
|
||||
this.groups = ph.groups;
|
||||
this.users = ph.users;
|
||||
}
|
||||
@@ -49,11 +47,11 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
return overloadedUsers.get(userNameLowered);
|
||||
}
|
||||
//END CODE
|
||||
if (users.containsKey(userNameLowered)) {
|
||||
return users.get(userNameLowered);
|
||||
if (getUsers().containsKey(userNameLowered)) {
|
||||
return getUsers().get(userNameLowered);
|
||||
}
|
||||
User newUser = createUser(userName);
|
||||
haveUsersChanged = true;
|
||||
setUsersChanged(true);
|
||||
return newUser;
|
||||
}
|
||||
|
||||
@@ -69,8 +67,8 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
if (theUser == null) {
|
||||
return;
|
||||
}
|
||||
if ((theUser.getGroup() == null) || (!groups.containsKey(theUser.getGroupName().toLowerCase()))) {
|
||||
theUser.setGroup(defaultGroup);
|
||||
if ((theUser.getGroup() == null) || (!getGroups().containsKey(theUser.getGroupName().toLowerCase()))) {
|
||||
theUser.setGroup(getDefaultGroup());
|
||||
}
|
||||
//OVERLOADED CODE
|
||||
if (overloadedUsers.containsKey(theUser.getName().toLowerCase())) {
|
||||
@@ -80,8 +78,8 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
}
|
||||
//END CODE
|
||||
removeUser(theUser.getName());
|
||||
users.put(theUser.getName().toLowerCase(), theUser);
|
||||
haveUsersChanged = true;
|
||||
getUsers().put(theUser.getName().toLowerCase(), theUser);
|
||||
setUsersChanged(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,9 +95,9 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
return true;
|
||||
}
|
||||
//END CODE
|
||||
if (users.containsKey(userName.toLowerCase())) {
|
||||
users.remove(userName.toLowerCase());
|
||||
haveUsersChanged = true;
|
||||
if (getUsers().containsKey(userName.toLowerCase())) {
|
||||
getUsers().remove(userName.toLowerCase());
|
||||
setUsersChanged(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -107,16 +105,16 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
|
||||
@Override
|
||||
public boolean removeGroup(String groupName) {
|
||||
if (groupName.equals(defaultGroup)) {
|
||||
if (groupName.equals(getDefaultGroup())) {
|
||||
return false;
|
||||
}
|
||||
for (String key : groups.keySet()) {
|
||||
for (String key : getGroups().keySet()) {
|
||||
if (groupName.equalsIgnoreCase(key)) {
|
||||
groups.remove(key);
|
||||
for (String userKey : users.keySet()) {
|
||||
User user = users.get(userKey);
|
||||
getGroups().remove(key);
|
||||
for (String userKey : getUsers().keySet()) {
|
||||
User user = getUsers().get(userKey);
|
||||
if (user.getGroupName().equalsIgnoreCase(key)) {
|
||||
user.setGroup(defaultGroup);
|
||||
user.setGroup(getDefaultGroup());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -124,12 +122,12 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
for (String userKey : overloadedUsers.keySet()) {
|
||||
User user = overloadedUsers.get(userKey);
|
||||
if (user.getGroupName().equalsIgnoreCase(key)) {
|
||||
user.setGroup(defaultGroup);
|
||||
user.setGroup(getDefaultGroup());
|
||||
}
|
||||
|
||||
}
|
||||
//END OVERLOAD
|
||||
haveGroupsChanged = true;
|
||||
setGroupsChanged(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -143,7 +141,7 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
@Override
|
||||
public Collection<User> getUserList() {
|
||||
Collection<User> overloadedList = new ArrayList<User>();
|
||||
Collection<User> normalList = users.values();
|
||||
Collection<User> normalList = getUsers().values();
|
||||
for (User u : normalList) {
|
||||
if (overloadedUsers.containsKey(u.getName().toLowerCase())) {
|
||||
overloadedList.add(overloadedUsers.get(u.getName().toLowerCase()));
|
||||
@@ -198,8 +196,8 @@ public class OverloadedWorldHolder extends WorldDataHolder {
|
||||
if (!isOverloaded(userName)) {
|
||||
return getUser(userName);
|
||||
}
|
||||
if (users.containsKey(userName.toLowerCase())) {
|
||||
return users.get(userName.toLowerCase());
|
||||
if (getUsers().containsKey(userName.toLowerCase())) {
|
||||
return getUsers().get(userName.toLowerCase());
|
||||
}
|
||||
User newUser = createUser(userName);
|
||||
return newUser;
|
||||
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package org.anjocaido.groupmanager.dataholder;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author ElgarL
|
||||
*
|
||||
*/
|
||||
public class UsersDataHolder {
|
||||
|
||||
/**
|
||||
* Root World name this set of groups is associated with.
|
||||
*/
|
||||
private String name;
|
||||
private File usersFile;
|
||||
private boolean haveUsersChanged = false;
|
||||
private long timeStampUsers = 0;
|
||||
|
||||
/**
|
||||
* The actual groups holder
|
||||
*/
|
||||
private Map<String, User> users = new HashMap<String, User>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
protected UsersDataHolder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param worldName
|
||||
*/
|
||||
public void setWorldName(String worldName) {
|
||||
this.name = worldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
public String getWorldName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the users
|
||||
*/
|
||||
public Map<String, User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param users the users to set
|
||||
*/
|
||||
public void setUsers(Map<String, User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the usersFile
|
||||
*/
|
||||
public File getUsersFile() {
|
||||
return usersFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param usersFile the usersFile to set
|
||||
*/
|
||||
public void setUsersFile(File usersFile) {
|
||||
this.usersFile = usersFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the haveUsersChanged
|
||||
*/
|
||||
public boolean HaveUsersChanged() {
|
||||
return haveUsersChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param haveUsersChanged the haveUsersChanged to set
|
||||
*/
|
||||
public void setUsersChanged(boolean haveUsersChanged) {
|
||||
this.haveUsersChanged = haveUsersChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the timeStampUsers
|
||||
*/
|
||||
public long getTimeStampUsers() {
|
||||
return timeStampUsers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeStampUsers the timeStampUsers to set
|
||||
*/
|
||||
public void setTimeStampUsers(long timeStampUsers) {
|
||||
this.timeStampUsers = timeStampUsers;
|
||||
}
|
||||
|
||||
}
|
||||
+177
-363
@@ -8,7 +8,6 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -49,72 +48,37 @@ public class WorldDataHolder {
|
||||
/**
|
||||
* The actual groups holder
|
||||
*/
|
||||
protected Map<String, Group> groups = new HashMap<String, Group>();
|
||||
protected GroupsDataHolder groups = new GroupsDataHolder();
|
||||
/**
|
||||
* The actual users holder
|
||||
*/
|
||||
protected Map<String, User> users = new HashMap<String, User>();
|
||||
|
||||
/**
|
||||
* Points to the default group
|
||||
*/
|
||||
protected Group defaultGroup = null;
|
||||
|
||||
/**
|
||||
* The file, which this class loads/save data from/to
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
protected File f;
|
||||
|
||||
protected UsersDataHolder users = new UsersDataHolder();
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected AnjoPermissionsHandler permissionsHandler;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected File usersFile;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected File groupsFile;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected boolean haveUsersChanged = false;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected boolean haveGroupsChanged = false;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected long timeStampGroups = 0;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected long timeStampUsers = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Prevent direct instantiation
|
||||
* @param worldName
|
||||
*/
|
||||
protected WorldDataHolder(String worldName) {
|
||||
public WorldDataHolder(String worldName) {
|
||||
name = worldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* The main constructor for a new WorldDataHolder
|
||||
* Please don't set the default group as null
|
||||
* @param worldName
|
||||
* @param defaultGroup the default group. its good to start with one
|
||||
* @param groups
|
||||
* @param users
|
||||
*/
|
||||
public WorldDataHolder(String worldName, Group defaultGroup) {
|
||||
public WorldDataHolder(String worldName, GroupsDataHolder groups, UsersDataHolder users) {
|
||||
this.name = worldName;
|
||||
groups.put(defaultGroup.getName().toLowerCase(), defaultGroup);
|
||||
this.defaultGroup = defaultGroup;
|
||||
this.groups = groups;
|
||||
this.users = users;
|
||||
|
||||
//this.defaultGroup = defaultGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,8 +89,8 @@ public class WorldDataHolder {
|
||||
* @return class that manage that user permission
|
||||
*/
|
||||
public User getUser(String userName) {
|
||||
if (users.containsKey(userName.toLowerCase())) {
|
||||
return users.get(userName.toLowerCase());
|
||||
if (getUsers().containsKey(userName.toLowerCase())) {
|
||||
return getUsers().get(userName.toLowerCase());
|
||||
}
|
||||
User newUser = createUser(userName);
|
||||
return newUser;
|
||||
@@ -144,11 +108,11 @@ public class WorldDataHolder {
|
||||
return;
|
||||
}
|
||||
if ((theUser.getGroup() == null)) {
|
||||
theUser.setGroup(defaultGroup);
|
||||
theUser.setGroup(groups.getDefaultGroup());
|
||||
}
|
||||
removeUser(theUser.getName());
|
||||
users.put(theUser.getName().toLowerCase(), theUser);
|
||||
haveUsersChanged = true;
|
||||
getUsers().put(theUser.getName().toLowerCase(), theUser);
|
||||
setUsersChanged(true);
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManagerEventHandler.callEvent(theUser, Action.USER_ADDED);
|
||||
}
|
||||
@@ -159,9 +123,9 @@ public class WorldDataHolder {
|
||||
* @return true if it had something to remove
|
||||
*/
|
||||
public boolean removeUser(String userName) {
|
||||
if (users.containsKey(userName.toLowerCase())) {
|
||||
users.remove(userName.toLowerCase());
|
||||
haveUsersChanged = true;
|
||||
if (getUsers().containsKey(userName.toLowerCase())) {
|
||||
getUsers().remove(userName.toLowerCase());
|
||||
setUsersChanged(true);
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManagerEventHandler.callEvent(userName, GMUserEvent.Action.USER_REMOVED);
|
||||
return true;
|
||||
@@ -175,7 +139,7 @@ public class WorldDataHolder {
|
||||
* @return true if we have data for this player.
|
||||
*/
|
||||
public boolean isUserDeclared(String userName) {
|
||||
return users.containsKey(userName.toLowerCase());
|
||||
return getUsers().containsKey(userName.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,11 +147,11 @@ public class WorldDataHolder {
|
||||
* @param group the group you want make default.
|
||||
*/
|
||||
public void setDefaultGroup(Group group) {
|
||||
if (!groups.containsKey(group.getName().toLowerCase()) || (group.getDataSource() != this)) {
|
||||
if (!getGroups().containsKey(group.getName().toLowerCase()) || (group.getDataSource() != this)) {
|
||||
addGroup(group);
|
||||
}
|
||||
defaultGroup = this.getGroup(group.getName());
|
||||
haveGroupsChanged = true;
|
||||
groups.setDefaultGroup(getGroup(group.getName()));
|
||||
setGroupsChanged(true);
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManagerEventHandler.callEvent(GMSystemEvent.Action.DEFAULT_GROUP_CHANGED);
|
||||
}
|
||||
@@ -197,7 +161,7 @@ public class WorldDataHolder {
|
||||
* @return the default group
|
||||
*/
|
||||
public Group getDefaultGroup() {
|
||||
return defaultGroup;
|
||||
return groups.getDefaultGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +173,7 @@ public class WorldDataHolder {
|
||||
if (groupName.toLowerCase().startsWith("g:"))
|
||||
return GroupManager.getGlobalGroups().getGroup(groupName);
|
||||
else
|
||||
return groups.get(groupName.toLowerCase());
|
||||
return getGroups().get(groupName.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,7 +186,7 @@ public class WorldDataHolder {
|
||||
if (groupName.toLowerCase().startsWith("g:"))
|
||||
return GroupManager.getGlobalGroups().hasGroup(groupName);
|
||||
else
|
||||
return groups.containsKey(groupName.toLowerCase());
|
||||
return getGroups().containsKey(groupName.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,8 +204,8 @@ public class WorldDataHolder {
|
||||
groupToAdd = groupToAdd.clone(this);
|
||||
}
|
||||
removeGroup(groupToAdd.getName());
|
||||
groups.put(groupToAdd.getName().toLowerCase(), groupToAdd);
|
||||
haveGroupsChanged = true;
|
||||
getGroups().put(groupToAdd.getName().toLowerCase(), groupToAdd);
|
||||
setGroupsChanged(true);
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED);
|
||||
}
|
||||
@@ -256,12 +220,12 @@ public class WorldDataHolder {
|
||||
return GroupManager.getGlobalGroups().removeGroup(groupName);
|
||||
}
|
||||
|
||||
if (defaultGroup != null && groupName.equalsIgnoreCase(defaultGroup.getName())) {
|
||||
if (getDefaultGroup() != null && groupName.equalsIgnoreCase(getDefaultGroup().getName())) {
|
||||
return false;
|
||||
}
|
||||
if (groups.containsKey(groupName.toLowerCase())) {
|
||||
groups.remove(groupName.toLowerCase());
|
||||
haveGroupsChanged = true;
|
||||
if (getGroups().containsKey(groupName.toLowerCase())) {
|
||||
getGroups().remove(groupName.toLowerCase());
|
||||
setGroupsChanged(true);
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManagerEventHandler.callEvent(groupName.toLowerCase(), GMGroupEvent.Action.GROUP_REMOVED);
|
||||
return true;
|
||||
@@ -277,13 +241,13 @@ public class WorldDataHolder {
|
||||
* @return null if user already exists. or new User
|
||||
*/
|
||||
public User createUser(String userName) {
|
||||
if (this.users.containsKey(userName.toLowerCase())) {
|
||||
if (getUsers().containsKey(userName.toLowerCase())) {
|
||||
return null;
|
||||
}
|
||||
User newUser = new User(this, userName);
|
||||
newUser.setGroup(defaultGroup);
|
||||
this.addUser(newUser);
|
||||
haveUsersChanged = true;
|
||||
newUser.setGroup(groups.getDefaultGroup(), false);
|
||||
addUser(newUser);
|
||||
setUsersChanged(true);
|
||||
return newUser;
|
||||
}
|
||||
|
||||
@@ -299,13 +263,13 @@ public class WorldDataHolder {
|
||||
return GroupManager.getGlobalGroups().newGroup(newGroup);
|
||||
}
|
||||
|
||||
if (this.groups.containsKey(groupName.toLowerCase())) {
|
||||
if (getGroups().containsKey(groupName.toLowerCase())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Group newGroup = new Group(this, groupName);
|
||||
this.addGroup(newGroup);
|
||||
haveGroupsChanged = true;
|
||||
addGroup(newGroup);
|
||||
setGroupsChanged(true);
|
||||
return newGroup;
|
||||
}
|
||||
|
||||
@@ -314,7 +278,7 @@ public class WorldDataHolder {
|
||||
* @return a collection of the groups
|
||||
*/
|
||||
public Collection<Group> getGroupList() {
|
||||
return groups.values();
|
||||
return getGroups().values();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,7 +286,7 @@ public class WorldDataHolder {
|
||||
* @return a collection of the users
|
||||
*/
|
||||
public Collection<User> getUserList() {
|
||||
return users.values();
|
||||
return getUsers().values();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -352,9 +316,9 @@ public class WorldDataHolder {
|
||||
for (Group tempGroup : ph.getGroupList()) {
|
||||
tempGroup.clone(this);
|
||||
}
|
||||
this.setDefaultGroup(this.getGroup(ph.getDefaultGroup().getName()));
|
||||
this.setDefaultGroup(getGroup(ph.getDefaultGroup().getName()));
|
||||
this.removeGroupsChangedFlag();
|
||||
this.timeStampGroups = getGroupsFile().lastModified();
|
||||
this.setTimeStampGroups(getGroupsFile().lastModified());
|
||||
|
||||
ph = null;
|
||||
} catch (Exception ex) {
|
||||
@@ -377,7 +341,7 @@ public class WorldDataHolder {
|
||||
tempGroup.clone(ph);
|
||||
}
|
||||
// setup the default group before loading user data.
|
||||
ph.setDefaultGroup(ph.getGroup(this.getDefaultGroup().getName()));
|
||||
ph.setDefaultGroup(ph.getGroup(getDefaultGroup().getName()));
|
||||
loadUsers(ph, getUsersFile());
|
||||
// transfer new data
|
||||
resetUsers();
|
||||
@@ -385,7 +349,7 @@ public class WorldDataHolder {
|
||||
tempUser.clone(this);
|
||||
}
|
||||
this.removeUsersChangedFlag();
|
||||
this.timeStampUsers = getUsersFile().lastModified();
|
||||
this.setTimeStampUsers(getUsersFile().lastModified());
|
||||
|
||||
ph = null;
|
||||
} catch (Exception ex) {
|
||||
@@ -395,165 +359,39 @@ public class WorldDataHolder {
|
||||
GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save by yourself!
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public void commit() {
|
||||
writeGroups(this, getGroupsFile());
|
||||
writeUsers(this, getUsersFile());
|
||||
public void loadGroups(File groupsFile) {
|
||||
|
||||
GroupManager.setLoaded(false);
|
||||
try {
|
||||
setGroupsFile(groupsFile);
|
||||
loadGroups(this, groupsFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
throw new IllegalArgumentException("The file which should contain groups does not exist!\n" + groupsFile.getPath());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new IllegalArgumentException("Error access the groups file!\n" + groupsFile.getPath());
|
||||
}
|
||||
|
||||
GroupManager.setLoaded(true);
|
||||
}
|
||||
|
||||
public void loadUsers(File usersFile) {
|
||||
|
||||
/**
|
||||
* Returns a data holder for the given file
|
||||
*
|
||||
* @param worldName
|
||||
* @param file
|
||||
* @return a new WorldDataHolder
|
||||
*
|
||||
* @throws Exception
|
||||
* @deprecated
|
||||
*/
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Deprecated
|
||||
public static WorldDataHolder load(String worldName, File file) throws Exception {
|
||||
WorldDataHolder ph = new WorldDataHolder(worldName);
|
||||
ph.f = file;
|
||||
final Yaml yaml = new Yaml(new SafeConstructor());
|
||||
Map<String, Object> rootDataNode;
|
||||
if (!file.exists()) {
|
||||
throw new Exception("The file which should contain permissions does not exist!\n" + file.getPath());
|
||||
}
|
||||
FileInputStream rx = new FileInputStream(file);
|
||||
try {
|
||||
rootDataNode = (Map<String, Object>) yaml.load(new UnicodeReader(rx));
|
||||
if (rootDataNode == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new Exception("The following file couldn't pass on Parser.\n" + file.getPath(), ex);
|
||||
} finally {
|
||||
rx.close();
|
||||
}
|
||||
Map<String, List<String>> inheritance = new HashMap<String, List<String>>();
|
||||
try {
|
||||
Map<String, Object> allGroupsNode = (Map<String, Object>) rootDataNode.get("groups");
|
||||
for (String groupKey : allGroupsNode.keySet()) {
|
||||
Map<String, Object> thisGroupNode = (Map<String, Object>) allGroupsNode.get(groupKey);
|
||||
Group thisGrp = ph.createGroup(groupKey);
|
||||
if (thisGrp == null) {
|
||||
throw new IllegalArgumentException("I think this group was declared more than once: " + groupKey);
|
||||
}
|
||||
if (thisGroupNode.get("default") == null) {
|
||||
thisGroupNode.put("default", false);
|
||||
}
|
||||
if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) {
|
||||
if (ph.getDefaultGroup() != null) {
|
||||
GroupManager.logger.warning("The group " + thisGrp.getName() + " is declaring be default where" + ph.getDefaultGroup().getName() + " already was.");
|
||||
GroupManager.logger.warning("Overriding first request.");
|
||||
}
|
||||
ph.setDefaultGroup(thisGrp);
|
||||
}
|
||||
GroupManager.setLoaded(false);
|
||||
try {
|
||||
setUsersFile(usersFile);
|
||||
loadUsers(this, usersFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
throw new IllegalArgumentException("The file which should contain users does not exist!\n" + usersFile.getPath());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new IllegalArgumentException("Error access the users file!\n" + usersFile.getPath());
|
||||
}
|
||||
|
||||
//PERMISSIONS NODE
|
||||
if (thisGroupNode.get("permissions") == null) {
|
||||
thisGroupNode.put("permissions", new ArrayList<String>());
|
||||
}
|
||||
if (thisGroupNode.get("permissions") instanceof List) {
|
||||
for (Object o : ((List) thisGroupNode.get("permissions"))) {
|
||||
thisGrp.addPermission(o.toString());
|
||||
}
|
||||
} else if (thisGroupNode.get("permissions") instanceof String) {
|
||||
thisGrp.addPermission((String) thisGroupNode.get("permissions"));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List<String>): " + thisGroupNode.get("permissions").getClass().getName());
|
||||
}
|
||||
|
||||
//INFO NODE
|
||||
Map<String, Object> infoNode = (Map<String, Object>) thisGroupNode.get("info");
|
||||
if (infoNode != null) {
|
||||
thisGrp.setVariables(infoNode);
|
||||
}
|
||||
|
||||
//END INFO NODE
|
||||
|
||||
Object inheritNode = thisGroupNode.get("inheritance");
|
||||
if (inheritNode == null) {
|
||||
thisGroupNode.put("inheritance", new ArrayList<String>());
|
||||
} else if (inheritNode instanceof List) {
|
||||
List<String> groupsInh = (List<String>) inheritNode;
|
||||
for (String grp : groupsInh) {
|
||||
if (inheritance.get(groupKey) == null) {
|
||||
List<String> thisInherits = new ArrayList<String>();
|
||||
inheritance.put(groupKey, thisInherits);
|
||||
}
|
||||
inheritance.get(groupKey).add(grp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
throw new Exception("Your Permissions config file is invalid. See console for details.");
|
||||
}
|
||||
if (ph.defaultGroup == null) {
|
||||
throw new IllegalArgumentException("There was no Default Group declared.");
|
||||
}
|
||||
for (String groupKey : inheritance.keySet()) {
|
||||
List<String> inheritedList = inheritance.get(groupKey);
|
||||
Group thisGroup = ph.getGroup(groupKey);
|
||||
for (String inheritedKey : inheritedList) {
|
||||
Group inheritedGroup = ph.getGroup(inheritedKey);
|
||||
if (thisGroup != null && inheritedGroup != null) {
|
||||
thisGroup.addInherits(inheritedGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Process USERS
|
||||
Map<String, Object> allUsersNode = (Map<String, Object>) rootDataNode.get("users");
|
||||
for (String usersKey : allUsersNode.keySet()) {
|
||||
Map<String, Object> thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey);
|
||||
User thisUser = ph.createUser(usersKey);
|
||||
if (thisUser == null) {
|
||||
GroupManager.logger.warning("I think this user was declared more than once: " + usersKey);
|
||||
continue;
|
||||
}
|
||||
if (thisUserNode.get("permissions") == null) {
|
||||
thisUserNode.put("permissions", new ArrayList<String>());
|
||||
}
|
||||
if (thisUserNode.get("permissions") instanceof List) {
|
||||
for (Object o : ((List) thisUserNode.get("permissions"))) {
|
||||
thisUser.addPermission(o.toString());
|
||||
}
|
||||
} else if (thisUserNode.get("permissions") instanceof String) {
|
||||
thisUser.addPermission(thisUserNode.get("permissions").toString());
|
||||
}
|
||||
|
||||
|
||||
//USER INFO NODE - BETA
|
||||
|
||||
//INFO NODE
|
||||
Map<String, Object> infoNode = (Map<String, Object>) thisUserNode.get("info");
|
||||
if (infoNode != null) {
|
||||
thisUser.setVariables(infoNode);
|
||||
}
|
||||
//END INFO NODE - BETA
|
||||
|
||||
if (thisUserNode.get("group") != null) {
|
||||
Group hisGroup = ph.getGroup(thisUserNode.get("group").toString());
|
||||
if (hisGroup == null) {
|
||||
GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName());
|
||||
thisUser.setGroup(ph.defaultGroup);
|
||||
}
|
||||
thisUser.setGroup(hisGroup);
|
||||
} else {
|
||||
thisUser.setGroup(ph.defaultGroup);
|
||||
}
|
||||
}
|
||||
return ph;
|
||||
GroupManager.setLoaded(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a NEW data holder containing data read from the files
|
||||
*
|
||||
@@ -568,8 +406,8 @@ public class WorldDataHolder {
|
||||
WorldDataHolder ph = new WorldDataHolder(worldName);
|
||||
|
||||
GroupManager.setLoaded(false);
|
||||
loadGroups(ph, groupsFile);
|
||||
loadUsers(ph, usersFile);
|
||||
if (groupsFile != null) loadGroups(ph, groupsFile);
|
||||
if (usersFile != null) loadUsers(ph, usersFile);
|
||||
GroupManager.setLoaded(true);
|
||||
|
||||
return ph;
|
||||
@@ -632,7 +470,12 @@ public class WorldDataHolder {
|
||||
}
|
||||
if (thisGroupNode.get("permissions") instanceof List) {
|
||||
for (Object o : ((List) thisGroupNode.get("permissions"))) {
|
||||
thisGrp.addPermission(o.toString());
|
||||
try {
|
||||
thisGrp.addPermission(o.toString());
|
||||
} catch (NullPointerException e) {
|
||||
// Ignore this entry as it's null.
|
||||
//throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
|
||||
}
|
||||
}
|
||||
} else if (thisGroupNode.get("permissions") instanceof String) {
|
||||
thisGrp.addPermission((String) thisGroupNode.get("permissions"));
|
||||
@@ -673,7 +516,7 @@ public class WorldDataHolder {
|
||||
// ex.printStackTrace();
|
||||
// throw new IllegalArgumentException("Your Permissions config file is invalid. See console for details.");
|
||||
//}
|
||||
if (ph.defaultGroup == null) {
|
||||
if (ph.getDefaultGroup() == null) {
|
||||
throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath());
|
||||
}
|
||||
for (String groupKey : inheritance.keySet()) {
|
||||
@@ -689,7 +532,7 @@ public class WorldDataHolder {
|
||||
|
||||
ph.removeGroupsChangedFlag();
|
||||
// Update the LastModified time.
|
||||
ph.groupsFile = groupsFile;
|
||||
ph.setGroupsFile(groupsFile);
|
||||
ph.setTimeStampGroups(groupsFile.lastModified());
|
||||
|
||||
//return ph;
|
||||
@@ -744,7 +587,12 @@ public class WorldDataHolder {
|
||||
thisUser.addPermission(o.toString());
|
||||
}
|
||||
} else if (thisUserNode.get("permissions") instanceof String) {
|
||||
thisUser.addPermission(thisUserNode.get("permissions").toString());
|
||||
try {
|
||||
thisUser.addPermission(thisUserNode.get("permissions").toString());
|
||||
} catch (NullPointerException e) {
|
||||
// Ignore this entry as it's null.
|
||||
//throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
//SUBGROUPS LOADING
|
||||
@@ -788,108 +636,21 @@ public class WorldDataHolder {
|
||||
Group hisGroup = ph.getGroup(thisUserNode.get("group").toString());
|
||||
if (hisGroup == null) {
|
||||
GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath());
|
||||
hisGroup = ph.defaultGroup;
|
||||
hisGroup = ph.getDefaultGroup();
|
||||
//throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName());
|
||||
}
|
||||
thisUser.setGroup(hisGroup);
|
||||
} else {
|
||||
thisUser.setGroup(ph.defaultGroup);
|
||||
thisUser.setGroup(ph.getDefaultGroup());
|
||||
}
|
||||
}
|
||||
|
||||
ph.removeUsersChangedFlag();
|
||||
// Update the LastModified time.
|
||||
ph.usersFile = usersFile;
|
||||
ph.setUsersFile(usersFile);
|
||||
ph.setTimeStampUsers(usersFile.lastModified());
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a dataHolder in a specified file
|
||||
* @param ph
|
||||
* @param file
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public static void write(WorldDataHolder ph, File file) {
|
||||
Map<String, Object> root = new HashMap<String, Object>();
|
||||
|
||||
Map<String, Object> pluginMap = new HashMap<String, Object>();
|
||||
root.put("plugin", pluginMap);
|
||||
|
||||
Map<String, Object> permissionsMap = new HashMap<String, Object>();
|
||||
pluginMap.put("permissions", permissionsMap);
|
||||
|
||||
permissionsMap.put("system", "default");
|
||||
|
||||
Map<String, Object> groupsMap = new HashMap<String, Object>();
|
||||
root.put("groups", groupsMap);
|
||||
for (String groupKey : ph.groups.keySet()) {
|
||||
Group group = ph.groups.get(groupKey);
|
||||
|
||||
Map<String, Object> aGroupMap = new HashMap<String, Object>();
|
||||
groupsMap.put(group.getName(), aGroupMap);
|
||||
|
||||
aGroupMap.put("default", group.equals(ph.defaultGroup));
|
||||
|
||||
Map<String, Object> infoMap = new HashMap<String, Object>();
|
||||
aGroupMap.put("info", infoMap);
|
||||
|
||||
for (String infoKey : group.getVariables().getVarKeyList()) {
|
||||
infoMap.put(infoKey, group.getVariables().getVarObject(infoKey));
|
||||
}
|
||||
|
||||
aGroupMap.put("inheritance", group.getInherits());
|
||||
|
||||
aGroupMap.put("permissions", group.getPermissionList());
|
||||
}
|
||||
|
||||
Map<String, Object> usersMap = new HashMap<String, Object>();
|
||||
root.put("users", usersMap);
|
||||
for (String userKey : ph.users.keySet()) {
|
||||
User user = ph.users.get(userKey);
|
||||
if ((user.getGroup() == null || user.getGroup().equals(ph.defaultGroup)) && user.getPermissionList().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<String, Object> aUserMap = new HashMap<String, Object>();
|
||||
usersMap.put(user.getName(), aUserMap);
|
||||
|
||||
if (user.getGroup() == null) {
|
||||
aUserMap.put("group", ph.defaultGroup.getName());
|
||||
} else {
|
||||
aUserMap.put("group", user.getGroup().getName());
|
||||
}
|
||||
//USER INFO NODE - BETA
|
||||
if (user.getVariables().getSize() > 0) {
|
||||
Map<String, Object> infoMap = new HashMap<String, Object>();
|
||||
aUserMap.put("info", infoMap);
|
||||
|
||||
for (String infoKey : user.getVariables().getVarKeyList()) {
|
||||
infoMap.put(infoKey, user.getVariables().getVarObject(infoKey));
|
||||
}
|
||||
}
|
||||
//END USER INFO NODE - BETA
|
||||
|
||||
aUserMap.put("permissions", user.getPermissionList());
|
||||
}
|
||||
DumperOptions opt = new DumperOptions();
|
||||
opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
final Yaml yaml = new Yaml(opt);
|
||||
|
||||
FileWriter tx = null;
|
||||
try {
|
||||
tx = new FileWriter(file, false);
|
||||
tx.write(yaml.dump(root));
|
||||
tx.flush();
|
||||
} catch (Exception e) {
|
||||
} finally {
|
||||
try {
|
||||
tx.close();
|
||||
} catch (IOException ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a dataHolder in a specified file
|
||||
* @param ph
|
||||
@@ -901,16 +662,16 @@ public class WorldDataHolder {
|
||||
Map<String, Object> groupsMap = new HashMap<String, Object>();
|
||||
|
||||
root.put("groups", groupsMap);
|
||||
for (String groupKey : ph.groups.keySet()) {
|
||||
Group group = ph.groups.get(groupKey);
|
||||
for (String groupKey : ph.getGroups().keySet()) {
|
||||
Group group = ph.getGroups().get(groupKey);
|
||||
|
||||
Map<String, Object> aGroupMap = new HashMap<String, Object>();
|
||||
groupsMap.put(group.getName(), aGroupMap);
|
||||
|
||||
if (ph.defaultGroup == null) {
|
||||
if (ph.getDefaultGroup() == null) {
|
||||
GroupManager.logger.severe("There is no default group for world: " + ph.getName());
|
||||
}
|
||||
aGroupMap.put("default", group.equals(ph.defaultGroup));
|
||||
aGroupMap.put("default", group.equals(ph.getDefaultGroup()));
|
||||
|
||||
Map<String, Object> infoMap = new HashMap<String, Object>();
|
||||
aGroupMap.put("info", infoMap);
|
||||
@@ -951,7 +712,7 @@ public class WorldDataHolder {
|
||||
}
|
||||
|
||||
// Update the LastModified time.
|
||||
ph.groupsFile = groupsFile;
|
||||
ph.setGroupsFile(groupsFile);
|
||||
ph.setTimeStampGroups(groupsFile.lastModified());
|
||||
ph.removeGroupsChangedFlag();
|
||||
|
||||
@@ -982,9 +743,9 @@ public class WorldDataHolder {
|
||||
|
||||
Map<String, Object> usersMap = new HashMap<String, Object>();
|
||||
root.put("users", usersMap);
|
||||
for (String userKey : ph.users.keySet()) {
|
||||
User user = ph.users.get(userKey);
|
||||
if ((user.getGroup() == null || user.getGroup().equals(ph.defaultGroup)) && user.getPermissionList().isEmpty() && user.getVariables().isEmpty() && user.isSubGroupsEmpty()) {
|
||||
for (String userKey : ph.getUsers().keySet()) {
|
||||
User user = ph.getUsers().get(userKey);
|
||||
if ((user.getGroup() == null || user.getGroup().equals(ph.getDefaultGroup())) && user.getPermissionList().isEmpty() && user.getVariables().isEmpty() && user.isSubGroupsEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -992,7 +753,7 @@ public class WorldDataHolder {
|
||||
usersMap.put(user.getName(), aUserMap);
|
||||
|
||||
if (user.getGroup() == null) {
|
||||
aUserMap.put("group", ph.defaultGroup.getName());
|
||||
aUserMap.put("group", ph.getDefaultGroup().getName());
|
||||
} else {
|
||||
aUserMap.put("group", user.getGroup().getName());
|
||||
}
|
||||
@@ -1027,7 +788,7 @@ public class WorldDataHolder {
|
||||
}
|
||||
|
||||
// Update the LastModified time.
|
||||
ph.usersFile = usersFile;
|
||||
ph.setUsersFile(usersFile);
|
||||
ph.setTimeStampUsers(usersFile.lastModified());
|
||||
ph.removeUsersChangedFlag();
|
||||
|
||||
@@ -1083,16 +844,23 @@ public class WorldDataHolder {
|
||||
}
|
||||
return permissionsHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param haveUsersChanged the haveUsersChanged to set
|
||||
*/
|
||||
public void setUsersChanged(boolean haveUsersChanged) {
|
||||
users.setUsersChanged(haveUsersChanged);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if any user data has changed
|
||||
*/
|
||||
public boolean haveUsersChanged() {
|
||||
if (haveUsersChanged) {
|
||||
if (users.HaveUsersChanged()) {
|
||||
return true;
|
||||
}
|
||||
for (User u : users.values()) {
|
||||
for (User u : users.getUsers().values()) {
|
||||
if (u.isChanged()) {
|
||||
return true;
|
||||
}
|
||||
@@ -1100,15 +868,22 @@ public class WorldDataHolder {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param setGroupsChanged the haveGroupsChanged to set
|
||||
*/
|
||||
public void setGroupsChanged(boolean setGroupsChanged) {
|
||||
groups.setGroupsChanged(setGroupsChanged);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if any group data has changed.
|
||||
*/
|
||||
public boolean haveGroupsChanged() {
|
||||
if (haveGroupsChanged) {
|
||||
if (groups.HaveGroupsChanged()) {
|
||||
return true;
|
||||
}
|
||||
for (Group g : groups.values()) {
|
||||
for (Group g : groups.getGroups().values()) {
|
||||
if (g.isChanged()) {
|
||||
return true;
|
||||
}
|
||||
@@ -1120,8 +895,8 @@ public class WorldDataHolder {
|
||||
*
|
||||
*/
|
||||
public void removeUsersChangedFlag() {
|
||||
haveUsersChanged = false;
|
||||
for (User u : users.values()) {
|
||||
setUsersChanged(false);
|
||||
for (User u : getUsers().values()) {
|
||||
u.flagAsSaved();
|
||||
}
|
||||
}
|
||||
@@ -1130,8 +905,8 @@ public class WorldDataHolder {
|
||||
*
|
||||
*/
|
||||
public void removeGroupsChangedFlag() {
|
||||
haveGroupsChanged = false;
|
||||
for (Group g : groups.values()) {
|
||||
setGroupsChanged(false);
|
||||
for (Group g : getGroups().values()) {
|
||||
g.flagAsSaved();
|
||||
}
|
||||
}
|
||||
@@ -1140,14 +915,28 @@ public class WorldDataHolder {
|
||||
* @return the usersFile
|
||||
*/
|
||||
public File getUsersFile() {
|
||||
return usersFile;
|
||||
return users.getUsersFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param file the usersFile to set
|
||||
*/
|
||||
public void setUsersFile(File file) {
|
||||
users.setUsersFile(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the groupsFile
|
||||
*/
|
||||
public File getGroupsFile() {
|
||||
return groupsFile;
|
||||
return groups.getGroupsFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param file the groupsFile to set
|
||||
*/
|
||||
public void setGroupsFile(File file) {
|
||||
groups.setGroupsFile(file);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1161,60 +950,85 @@ public class WorldDataHolder {
|
||||
* Resets Groups.
|
||||
*/
|
||||
public void resetGroups() {
|
||||
this.defaultGroup = null;
|
||||
this.groups = new HashMap<String, Group>();
|
||||
//setDefaultGroup(null);
|
||||
groups.setGroups(new HashMap<String, Group>());
|
||||
}
|
||||
/**
|
||||
* Resets Users
|
||||
*/
|
||||
public void resetUsers() {
|
||||
this.users = new HashMap<String, User>();
|
||||
users.setUsers(new HashMap<String, User>());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the groups
|
||||
*/
|
||||
public Map<String, Group> getGroups() {
|
||||
return groups;
|
||||
return groups.getGroups();
|
||||
}
|
||||
/**
|
||||
* @return the users
|
||||
*/
|
||||
public Map<String, User> getUsers() {
|
||||
return users.getUsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the groups
|
||||
*/
|
||||
public GroupsDataHolder getGroupsObject() {
|
||||
return groups;
|
||||
}
|
||||
/**
|
||||
* @param groupsDataHolder the GroupsDataHolder to set
|
||||
*/
|
||||
public void setGroupsObject(GroupsDataHolder groupsDataHolder) {
|
||||
groups = groupsDataHolder;
|
||||
}
|
||||
/**
|
||||
* @return the users
|
||||
*/
|
||||
public UsersDataHolder getUsersObject() {
|
||||
return users;
|
||||
}
|
||||
/**
|
||||
* @param usersDataHolder the UsersDataHolder to set
|
||||
*/
|
||||
public void setUsersObject(UsersDataHolder usersDataHolder) {
|
||||
users = usersDataHolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the timeStampGroups
|
||||
*/
|
||||
public long getTimeStampGroups() {
|
||||
return timeStampGroups;
|
||||
return groups.getTimeStampGroups();
|
||||
}
|
||||
/**
|
||||
* @return the timeStampUsers
|
||||
*/
|
||||
public long getTimeStampUsers() {
|
||||
return timeStampUsers;
|
||||
return users.getTimeStampUsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeStampGroups the timeStampGroups to set
|
||||
*/
|
||||
protected void setTimeStampGroups(long timeStampGroups) {
|
||||
this.timeStampGroups = timeStampGroups;
|
||||
groups.setTimeStampGroups(timeStampGroups);
|
||||
}
|
||||
/**
|
||||
* @param timeStampUsers the timeStampUsers to set
|
||||
*/
|
||||
protected void setTimeStampUsers(long timeStampUsers) {
|
||||
this.timeStampUsers = timeStampUsers;
|
||||
users.setTimeStampUsers(timeStampUsers);
|
||||
}
|
||||
|
||||
public void setTimeStamps() {
|
||||
if (groupsFile != null)
|
||||
setTimeStampGroups(groupsFile.lastModified());
|
||||
if (usersFile != null)
|
||||
setTimeStampUsers(usersFile.lastModified());
|
||||
if (getGroupsFile() != null)
|
||||
setTimeStampGroups(getGroupsFile().lastModified());
|
||||
if (getUsersFile() != null)
|
||||
setTimeStampUsers(getUsersFile().lastModified());
|
||||
}
|
||||
|
||||
}
|
||||
Loaded 100 of 141 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user