mirror of
https://github.com/EssentialsX/Essentials.git
synced 2026-11-08 18:15:29 -05:00
Compare commits
124
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bb50189bc | ||
|
|
eb665a059a | ||
|
|
f2407bcc31 | ||
|
|
a8cfbe1eab | ||
|
|
03b73072d9 | ||
|
|
48049f3870 | ||
|
|
d2c553652f | ||
|
|
3dc29be083 | ||
|
|
ee00fb77d0 | ||
|
|
d890418944 | ||
|
|
8e0560ae1a | ||
|
|
82e5447526 | ||
|
|
8b23f8608d | ||
|
|
0dd5134f5a | ||
|
|
a39a904c8a | ||
|
|
1d38b72835 | ||
|
|
efcab71969 | ||
|
|
41e11a738d | ||
|
|
62e1710607 | ||
|
|
c681befdf2 | ||
|
|
2db256678e | ||
|
|
a2ca381bbd | ||
|
|
32f5a31ea5 | ||
|
|
87dc671a0d | ||
|
|
621f9b4f48 | ||
|
|
3858e1cdd6 | ||
|
|
ff7cc5aec9 | ||
|
|
d18a47a643 | ||
|
|
497a08940e | ||
|
|
bd8fe521cd | ||
|
|
59c93901d3 | ||
|
|
3177f25eb6 | ||
|
|
b0fe189156 | ||
|
|
8103e822ed | ||
|
|
c597653ce2 | ||
|
|
d9ceb727ef | ||
|
|
2844af0039 | ||
|
|
066f3fd726 | ||
|
|
e9c0bb2133 | ||
|
|
f0acf733a5 | ||
|
|
33c6fc1f1f | ||
|
|
91b504cc66 | ||
|
|
6ea57bcd2f | ||
|
|
c92c066a3a | ||
|
|
caff3c115b | ||
|
|
517961b26a | ||
|
|
85f63d0afe | ||
|
|
ecc56351ec | ||
|
|
9b04705ec9 | ||
|
|
e786653364 | ||
|
|
e5613d43cc | ||
|
|
ce8f05cd94 | ||
|
|
e52a9c1f6b | ||
|
|
de744fe9e2 | ||
|
|
a0031d1d45 | ||
|
|
d60dd01f0f | ||
|
|
ad3bc2ad98 | ||
|
|
cf69a6d72c | ||
|
|
1a65a31a7e | ||
|
|
9c998eac2f | ||
|
|
2bdc00dc14 | ||
|
|
83e8dac6a0 | ||
|
|
3879d582d3 | ||
|
|
1fd5222d40 | ||
|
|
fe15bab05f | ||
|
|
f2dd51cf57 | ||
|
|
ac1f2badc7 | ||
|
|
d3f6e82474 | ||
|
|
676f941bb8 | ||
|
|
bd74bd1286 | ||
|
|
5831cde90e | ||
|
|
b2394048fa | ||
|
|
4811e46dd6 | ||
|
|
8d266a3440 | ||
|
|
f680fb1b76 | ||
|
|
a845f351f8 | ||
|
|
997a409b5a | ||
|
|
a6673c5157 | ||
|
|
5ef7135fc8 | ||
|
|
4c698762c3 | ||
|
|
82e389be8f | ||
|
|
1df79bc9f4 | ||
|
|
ab590af927 | ||
|
|
002e4a2772 | ||
|
|
0e9b971280 | ||
|
|
73b5fe971f | ||
|
|
6398626559 | ||
|
|
828f97c9a8 | ||
|
|
d6d4752383 | ||
|
|
d2bf35dac2 | ||
|
|
8d6e3e7c18 | ||
|
|
0b057d8e29 | ||
|
|
4c6cc5ced0 | ||
|
|
b828222176 | ||
|
|
bbab993ef1 | ||
|
|
b110ce79cc | ||
|
|
ab530f35d0 | ||
|
|
0654a76ccc | ||
|
|
e8fbdef38b | ||
|
|
aa085de3e7 | ||
|
|
2e1c880502 | ||
|
|
e3756623a1 | ||
|
|
8f28073b29 | ||
|
|
e2024ca2b6 | ||
|
|
80491513a2 | ||
|
|
f67e13122d | ||
|
|
16e19a7775 | ||
|
|
a220b267d4 | ||
|
|
1153a0eee4 | ||
|
|
b140f606b4 | ||
|
|
3454db3e2b | ||
|
|
8249a961f6 | ||
|
|
41344ce1b0 | ||
|
|
aa47499656 | ||
|
|
bc93bc6ae7 | ||
|
|
089c2210bd | ||
|
|
1a2fc307fd | ||
|
|
c374f474ed | ||
|
|
2a1b19a8a8 | ||
|
|
dfdf49ac35 | ||
|
|
d2a3240905 | ||
|
|
1c381fc203 | ||
|
|
a2fa666fd5 | ||
|
|
76eb00575b |
No files matched your search
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-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/Permissions3.jar"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Essentials</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -636,13 +636,6 @@ is divided into following sections:
|
||||
<param name="call.target" value="jar"/>
|
||||
<param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
|
||||
</antcall>
|
||||
<antcall target="-maybe-call-dep">
|
||||
<param name="call.built.properties" value="${built-jar.properties}"/>
|
||||
<param location="${project.EssentialsPermissionsCommands}" name="call.subproject"/>
|
||||
<param location="${project.EssentialsPermissionsCommands}/build.xml" name="call.script"/>
|
||||
<param name="call.target" value="jar"/>
|
||||
<param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
|
||||
</antcall>
|
||||
<antcall target="-maybe-call-dep">
|
||||
<param name="call.built.properties" value="${built-jar.properties}"/>
|
||||
<param location="${project.EssentialsProtect}" name="call.subproject"/>
|
||||
@@ -1136,13 +1129,6 @@ is divided into following sections:
|
||||
<param name="call.target" value="clean"/>
|
||||
<param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
|
||||
</antcall>
|
||||
<antcall target="-maybe-call-dep">
|
||||
<param name="call.built.properties" value="${built-clean.properties}"/>
|
||||
<param location="${project.EssentialsPermissionsCommands}" name="call.subproject"/>
|
||||
<param location="${project.EssentialsPermissionsCommands}/build.xml" name="call.script"/>
|
||||
<param name="call.target" value="clean"/>
|
||||
<param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
|
||||
</antcall>
|
||||
<antcall target="-maybe-call-dep">
|
||||
<param name="call.built.properties" value="${built-clean.properties}"/>
|
||||
<param location="${project.EssentialsProtect}" name="call.subproject"/>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=2bd2dd75
|
||||
build.xml.data.CRC32=51b33957
|
||||
build.xml.script.CRC32=7a797370
|
||||
build.xml.stylesheet.CRC32=28e38971@1.43.1.45
|
||||
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=2bd2dd75
|
||||
nbproject/build-impl.xml.script.CRC32=89fb91fc
|
||||
nbproject/build-impl.xml.data.CRC32=51b33957
|
||||
nbproject/build-impl.xml.script.CRC32=66b89647
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
|
||||
@@ -67,7 +67,6 @@ javac.classpath=\
|
||||
${reference.Essentials.jar}:\
|
||||
${reference.EssentialsChat.jar}:\
|
||||
${reference.EssentialsProtect.jar}:\
|
||||
${reference.EssentialsPermissionsCommands.jar}:\
|
||||
${reference.EssentialsSpawn.jar}:\
|
||||
${reference.EssentialsGeoIP.jar}:\
|
||||
${reference.EssentialsGroupBridge.jar}:\
|
||||
@@ -106,7 +105,6 @@ project.EssentialsChat=../EssentialsChat
|
||||
project.EssentialsGeoIP=../EssentialsGeoIP
|
||||
project.EssentialsGroupBridge=../EssentialsGroupBridge
|
||||
project.EssentialsGroupManager=../EssentialsGroupManager
|
||||
project.EssentialsPermissionsCommands=../EssentialsPermissionsCommands
|
||||
project.EssentialsProtect=../EssentialsProtect
|
||||
project.EssentialsSpawn=../EssentialsSpawn
|
||||
project.EssentialsXMPP=../EssentialsXMPP
|
||||
@@ -115,7 +113,6 @@ reference.EssentialsChat.jar=${project.EssentialsChat}/dist/EssentialsChat.jar
|
||||
reference.EssentialsGeoIP.jar=${project.EssentialsGeoIP}/dist/EssentialsGeoIP.jar
|
||||
reference.EssentialsGroupBridge.jar=${project.EssentialsGroupBridge}/dist/EssentialsGroupBridge.jar
|
||||
reference.EssentialsGroupManager.jar=${project.EssentialsGroupManager}/dist/EssentialsGroupManager.jar
|
||||
reference.EssentialsPermissionsCommands.jar=${project.EssentialsPermissionsCommands}/dist/EssentialsPermissionsCommands.jar
|
||||
reference.EssentialsProtect.jar=${project.EssentialsProtect}/dist/EssentialsProtect.jar
|
||||
reference.EssentialsSpawn.jar=${project.EssentialsSpawn}/dist/EssentialsSpawn.jar
|
||||
reference.EssentialsXMPP.jar=${project.EssentialsXMPP}/dist/EssentialsXMPP.jar
|
||||
|
||||
@@ -55,14 +55,6 @@
|
||||
<clean-target>clean</clean-target>
|
||||
<id>jar</id>
|
||||
</reference>
|
||||
<reference>
|
||||
<foreign-project>EssentialsPermissionsCommands</foreign-project>
|
||||
<artifact-type>jar</artifact-type>
|
||||
<script>build.xml</script>
|
||||
<target>jar</target>
|
||||
<clean-target>clean</clean-target>
|
||||
<id>jar</id>
|
||||
</reference>
|
||||
<reference>
|
||||
<foreign-project>EssentialsProtect</foreign-project>
|
||||
<artifact-type>jar</artifact-type>
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.ServerConfigurationManager;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
|
||||
|
||||
public class BanWorkaround implements IConf
|
||||
{
|
||||
private transient final IEssentials ess;
|
||||
private transient final ServerConfigurationManager scm;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient final Set<String> bans = new HashSet<String>();
|
||||
private transient final Set<String> bannedIps = new HashSet<String>();
|
||||
|
||||
public BanWorkaround(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
this.scm = ((CraftServer)ess.getServer()).getHandle();
|
||||
}
|
||||
|
||||
public void banByName(final String name)
|
||||
{
|
||||
scm.a(name);
|
||||
reloadConfig();
|
||||
}
|
||||
|
||||
public void unbanByName(String name)
|
||||
{
|
||||
scm.b(name);
|
||||
reloadConfig();
|
||||
}
|
||||
|
||||
public void banByIp(final String ip)
|
||||
{
|
||||
scm.c(ip);
|
||||
reloadConfig();
|
||||
}
|
||||
|
||||
public void unbanByIp(final String ip)
|
||||
{
|
||||
scm.d(ip);
|
||||
reloadConfig();
|
||||
}
|
||||
|
||||
public boolean isNameBanned(final String name)
|
||||
{
|
||||
return bans.contains(name.toLowerCase());
|
||||
}
|
||||
|
||||
public boolean isIpBanned(final String ip)
|
||||
{
|
||||
return bannedIps.contains(ip.toLowerCase());
|
||||
}
|
||||
|
||||
public void reloadConfig()
|
||||
{
|
||||
//I don't like this but it needs to be done until CB fixors
|
||||
final File file = new File(ess.getDataFolder().getParentFile().getParentFile(), "banned-players.txt");
|
||||
try
|
||||
{
|
||||
if (!file.exists())
|
||||
{
|
||||
throw new FileNotFoundException(Util.i18n("bannedPlayersFileNotFound"));
|
||||
}
|
||||
|
||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
|
||||
try
|
||||
{
|
||||
bans.clear();
|
||||
while (bufferedReader.ready())
|
||||
{
|
||||
|
||||
final String line = bufferedReader.readLine().trim().toLowerCase();
|
||||
if (line.length() > 0 && line.charAt(0) == '#')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bans.add(line);
|
||||
|
||||
}
|
||||
}
|
||||
catch (IOException io)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), io);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
bufferedReader.close();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), ex);
|
||||
}
|
||||
|
||||
final File ipFile = new File(ess.getDataFolder().getParentFile().getParentFile(), "banned-ips.txt");
|
||||
try
|
||||
{
|
||||
if (!ipFile.exists())
|
||||
{
|
||||
throw new FileNotFoundException(Util.i18n("bannedIpsFileNotFound"));
|
||||
}
|
||||
|
||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(ipFile));
|
||||
try
|
||||
{
|
||||
bannedIps.clear();
|
||||
while (bufferedReader.ready())
|
||||
{
|
||||
|
||||
final String line = bufferedReader.readLine().trim().toLowerCase();
|
||||
if (line.length() > 0 && line.charAt(0) == '#')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bannedIps.add(line);
|
||||
|
||||
}
|
||||
}
|
||||
catch (IOException io)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), io);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
bufferedReader.close();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,6 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
private transient Worth worth;
|
||||
private transient List<IConf> confList;
|
||||
private transient Backup backup;
|
||||
private transient BanWorkaround bans;
|
||||
private transient ItemDb itemDb;
|
||||
private transient EssentialsUpdateTimer updateTimer;
|
||||
private transient final Methods paymentMethod = new Methods();
|
||||
@@ -119,8 +118,6 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
confList.add(warps);
|
||||
worth = new Worth(this.getDataFolder());
|
||||
confList.add(worth);
|
||||
bans = new BanWorkaround(this);
|
||||
confList.add(bans);
|
||||
itemDb = new ItemDb(this);
|
||||
confList.add(itemDb);
|
||||
reload();
|
||||
@@ -185,11 +182,13 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
|
||||
final SignEntityListener signEntityListener = new SignEntityListener(this);
|
||||
pm.registerEvent(Type.ENTITY_EXPLODE, signEntityListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.ENDERMAN_PICKUP, signEntityListener, Priority.Low, 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.FOOD_LEVEL_CHANGE, entityListener, Priority.Lowest, this);
|
||||
|
||||
jail = new Jail(this);
|
||||
final JailPlayerListener jailPlayerListener = new JailPlayerListener(this);
|
||||
@@ -675,12 +674,6 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
return permissionsHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BanWorkaround getBans()
|
||||
{
|
||||
return bans;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDb getItemDb()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityListener;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
@@ -80,4 +81,13 @@ public class EssentialsEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFoodLevelChange(FoodLevelChangeEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
|
||||
{
|
||||
event.setFoodLevel(20);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,21 +94,15 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
final Location from = event.getFrom();
|
||||
final Location to = event.getTo().clone();
|
||||
to.setX(from.getX());
|
||||
to.setY(from.getY());
|
||||
to.setY(from.getBlock().getTypeId() == 0 ? from.getY() - 1 : from.getY());
|
||||
to.setZ(from.getZ());
|
||||
try
|
||||
{
|
||||
event.setTo(Util.getSafeDestination(to));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
event.setTo(to);
|
||||
}
|
||||
event.setTo(to);
|
||||
return;
|
||||
}
|
||||
|
||||
Location afk = user.getAfkPosition();
|
||||
if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) {
|
||||
if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9)
|
||||
{
|
||||
user.updateActivity(true);
|
||||
}
|
||||
|
||||
@@ -266,14 +260,6 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
ess.getBackup().onPlayerJoin();
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
//we do not know the ip address on playerlogin so we need to do this here.
|
||||
if (user.isIpBanned())
|
||||
{
|
||||
final String banReason = user.getBanReason();
|
||||
user.kickPlayer(banReason != null && !banReason.isEmpty() ? banReason : Util.i18n("defaultBanReason"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ess.getSettings().changeDisplayName())
|
||||
{
|
||||
user.setDisplayName(user.getNick());
|
||||
@@ -315,20 +301,21 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
{
|
||||
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());
|
||||
user.setNPC(false);
|
||||
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
user.checkBanTimeout(currentTime);
|
||||
boolean banExpired = user.checkBanTimeout(currentTime);
|
||||
user.checkMuteTimeout(currentTime);
|
||||
user.checkJailTimeout(currentTime);
|
||||
|
||||
if (user.isBanned())
|
||||
if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
|
||||
{
|
||||
final String banReason = user.getBanReason();
|
||||
event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() ? banReason : Util.i18n("defaultBanReason"));
|
||||
event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : Util.i18n("defaultBanReason"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -438,7 +425,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
final ItemStack is = user.getItemInHand();
|
||||
if (is == null || is.getType() == Material.AIR)
|
||||
if (is == null || is.getType() == Material.AIR || !user.arePowerToolsEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -465,7 +452,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
else
|
||||
{
|
||||
user.getServer().dispatchCommand(user, command);
|
||||
user.getServer().dispatchCommand(event.getPlayer(), command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,7 +471,8 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
{
|
||||
for (Player player : ess.getServer().getOnlinePlayers())
|
||||
{
|
||||
if (ess.getUser(player).isSocialSpyEnabled())
|
||||
User spyer = ess.getUser(player);
|
||||
if (spyer.isSocialSpyEnabled() && !user.equals(spyer))
|
||||
{
|
||||
player.sendMessage(user.getDisplayName() + " : " + event.getMessage());
|
||||
}
|
||||
|
||||
@@ -21,10 +21,9 @@ public class EssentialsPluginListener extends ServerListener implements IConf
|
||||
public void onPluginEnable(final PluginEnableEvent event)
|
||||
{
|
||||
ess.getPermissionsHandler().checkPermissions();
|
||||
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(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() + ")");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +34,7 @@ public class EssentialsPluginListener extends ServerListener implements IConf
|
||||
// Check to see if the plugin thats being disabled is the one we are using
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@@ -280,11 +289,11 @@ public class EssentialsUpgrade
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
final String defworld = (String)config.getProperty("home.default");
|
||||
final Location defloc = getFakeLocation(config,"home.worlds." + defworld);
|
||||
final Location defloc = getFakeLocation(config, "home.worlds." + defworld);
|
||||
if (defloc != null)
|
||||
{
|
||||
config.setProperty("homes.home", defloc);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> worlds = config.getKeys("home.worlds");
|
||||
Location loc;
|
||||
@@ -570,6 +579,7 @@ public class EssentialsUpgrade
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Location getFakeLocation(EssentialsConf config, String path)
|
||||
{
|
||||
String worldName = config.getString((path != null ? path + "." : "") + "world");
|
||||
@@ -590,6 +600,53 @@ public class EssentialsUpgrade
|
||||
(float)config.getDouble((path != null ? path + "." : "") + "pitch", 0));
|
||||
}
|
||||
|
||||
private void deleteOldItemsCsv()
|
||||
{
|
||||
if (doneFile.getBoolean("deleteOldItemsCsv", false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
final File file = new File(ess.getDataFolder(), "items.csv");
|
||||
if (file.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
final Set<BigInteger> oldconfigs = new HashSet<BigInteger>();
|
||||
oldconfigs.add(new BigInteger("66ec40b09ac167079f558d1099e39f10", 16)); // sep 1
|
||||
oldconfigs.add(new BigInteger("34284de1ead43b0bee2aae85e75c041d", 16)); // crlf
|
||||
oldconfigs.add(new BigInteger("c33bc9b8ee003861611bbc2f48eb6f4f", 16)); // jul 24
|
||||
oldconfigs.add(new BigInteger("6ff17925430735129fc2a02f830c1daa", 16)); // crlf
|
||||
|
||||
MessageDigest digest = ManagedFile.getDigest();
|
||||
final BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
|
||||
final DigestInputStream dis = new DigestInputStream(bis, digest);
|
||||
final byte[] buffer = new byte[1024];
|
||||
try
|
||||
{
|
||||
while (dis.read(buffer) != -1)
|
||||
{
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
dis.close();
|
||||
}
|
||||
|
||||
BigInteger hash = new BigInteger(1, digest.digest());
|
||||
if (oldconfigs.contains(hash) && !file.delete())
|
||||
{
|
||||
throw new IOException("Could not delete file " + file.toString());
|
||||
}
|
||||
doneFile.setProperty("deleteOldItemsCsv", true);
|
||||
doneFile.save();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void beforeSettings()
|
||||
{
|
||||
if (!ess.getDataFolder().exists())
|
||||
@@ -607,5 +664,6 @@ public class EssentialsUpgrade
|
||||
convertWarps();
|
||||
updateUsersPowerToolsFormat();
|
||||
updateUsersHomesFormat();
|
||||
deleteOldItemsCsv();
|
||||
}
|
||||
}
|
||||
@@ -424,5 +424,17 @@ public class FakeWorld implements World
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoSave()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAutoSave(boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,8 +53,6 @@ public interface IEssentials extends Plugin
|
||||
|
||||
int scheduleSyncRepeatingTask(final Runnable run, long delay, long period);
|
||||
|
||||
BanWorkaround getBans();
|
||||
|
||||
TNTExplodeListener getTNTListener();
|
||||
|
||||
PermissionsHandler getPermissionsHandler();
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@@ -17,108 +11,45 @@ public class ItemDb implements IConf
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public ItemDb(IEssentials ess)
|
||||
public ItemDb(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
file = new ManagedFile("items.csv", ess);
|
||||
}
|
||||
private final static Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private final transient Map<String, Integer> items = new HashMap<String, Integer>();
|
||||
private final transient Map<String, Short> durabilities = new HashMap<String, Short>();
|
||||
private final transient ManagedFile file;
|
||||
|
||||
@Override
|
||||
public void reloadConfig()
|
||||
{
|
||||
final File file = new File(ess.getDataFolder(), "items.csv");
|
||||
|
||||
if (!file.exists())
|
||||
{
|
||||
final InputStream res = ItemDb.class.getResourceAsStream("/items.csv");
|
||||
FileWriter tx = null;
|
||||
try
|
||||
{
|
||||
tx = new FileWriter(file);
|
||||
for (int i = 0; (i = res.read()) > 0;)
|
||||
{
|
||||
tx.write(i);
|
||||
}
|
||||
tx.flush();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
|
||||
return;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
res.close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
try
|
||||
{
|
||||
if (tx != null)
|
||||
{
|
||||
tx.close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
final List<String> lines = file.getLines();
|
||||
|
||||
if (lines.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BufferedReader rx = null;
|
||||
try
|
||||
{
|
||||
rx = new BufferedReader(new FileReader(file));
|
||||
durabilities.clear();
|
||||
items.clear();
|
||||
durabilities.clear();
|
||||
items.clear();
|
||||
|
||||
for (int i = 0; rx.ready(); i++)
|
||||
for (String line : lines)
|
||||
{
|
||||
line = line.trim().toLowerCase();
|
||||
if (line.length() > 0 && line.charAt(0) == '#')
|
||||
{
|
||||
try
|
||||
{
|
||||
final String line = rx.readLine().trim().toLowerCase();
|
||||
if (line.startsWith("#"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final String[] parts = line.split("[^a-z0-9]");
|
||||
if (parts.length < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final int numeric = Integer.parseInt(parts[1]);
|
||||
|
||||
durabilities.put(parts[0].toLowerCase(), parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0);
|
||||
items.put(parts[0].toLowerCase(), numeric);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.warning(Util.format("parseError", "items.csv", i));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (rx != null) {
|
||||
try
|
||||
{
|
||||
rx.close();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
final String[] parts = line.split("[^a-z0-9]");
|
||||
if (parts.length < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final int numeric = Integer.parseInt(parts[1]);
|
||||
|
||||
durabilities.put(parts[0].toLowerCase(), parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0);
|
||||
items.put(parts[0].toLowerCase(), numeric);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +94,7 @@ public class ItemDb implements IConf
|
||||
metaData = durabilities.get(itemname);
|
||||
}
|
||||
}
|
||||
else if(Material.getMaterial(itemname) != null)
|
||||
else if (Material.getMaterial(itemname) != null)
|
||||
{
|
||||
itemid = Material.getMaterial(itemname).getId();
|
||||
metaData = 0;
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.math.BigInteger;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.DigestOutputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
|
||||
public class ManagedFile
|
||||
{
|
||||
private final static int BUFFERSIZE = 1024 * 8;
|
||||
private final transient File file;
|
||||
|
||||
public ManagedFile(final String filename, final IEssentials ess)
|
||||
{
|
||||
file = new File(ess.getDataFolder(), filename);
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (checkForVersion(file, ess.getDescription().getVersion()) && !file.delete())
|
||||
{
|
||||
throw new IOException("Could not delete file " + file.toString());
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (!file.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
copyResourceAscii("/" + filename, file);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyResourceAscii(final String resourceName, final File file) throws IOException
|
||||
{
|
||||
final InputStreamReader reader = new InputStreamReader(ManagedFile.class.getResourceAsStream(resourceName));
|
||||
try
|
||||
{
|
||||
final MessageDigest digest = getDigest();
|
||||
final DigestOutputStream digestStream = new DigestOutputStream(new FileOutputStream(file), digest);
|
||||
try
|
||||
{
|
||||
final OutputStreamWriter writer = new OutputStreamWriter(digestStream);
|
||||
try
|
||||
{
|
||||
final char[] buffer = new char[BUFFERSIZE];
|
||||
do
|
||||
{
|
||||
final int length = reader.read(buffer);
|
||||
if (length >= 0)
|
||||
{
|
||||
writer.write(buffer, 0, length);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
writer.write("\n");
|
||||
writer.flush();
|
||||
final BigInteger hashInt = new BigInteger(1, digest.digest());
|
||||
digestStream.on(false);
|
||||
digestStream.write('#');
|
||||
digestStream.write(hashInt.toString(16).getBytes());
|
||||
}
|
||||
finally
|
||||
{
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
digestStream.close();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean checkForVersion(final File file, final String version) throws IOException
|
||||
{
|
||||
if (file.length() < 33)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
|
||||
try
|
||||
{
|
||||
final byte[] buffer = new byte[(int)file.length()];
|
||||
int position = 0;
|
||||
do
|
||||
{
|
||||
final int length = bis.read(buffer, position, Math.min((int)file.length() - position, BUFFERSIZE));
|
||||
if (length < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
position += length;
|
||||
}
|
||||
while (position < file.length());
|
||||
final ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
|
||||
if (bais.skip(file.length() - 33) != file.length() - 33)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
final BufferedReader reader = new BufferedReader(new InputStreamReader(bais));
|
||||
try
|
||||
{
|
||||
String hash = reader.readLine();
|
||||
if (hash.matches("#[a-f0-9]{32}"))
|
||||
{
|
||||
hash = hash.substring(1);
|
||||
bais.reset();
|
||||
final String versionline = reader.readLine();
|
||||
if (versionline.matches("#version: .+"))
|
||||
{
|
||||
final String versioncheck = versionline.substring(10);
|
||||
if (!versioncheck.equalsIgnoreCase(version))
|
||||
{
|
||||
bais.reset();
|
||||
final MessageDigest digest = getDigest();
|
||||
final DigestInputStream digestStream = new DigestInputStream(bais, digest);
|
||||
try
|
||||
{
|
||||
final byte[] bytes = new byte[(int)file.length() - 33];
|
||||
digestStream.read(bytes);
|
||||
final BigInteger correct = new BigInteger(hash, 16);
|
||||
final BigInteger test = new BigInteger(1, digest.digest());
|
||||
if (correct.equals(test))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Bukkit.getLogger().warning("File " + file.toString() + " has been modified by user and file version differs, please update the file manually.");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
digestStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
bis.close();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static MessageDigest getDigest() throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return MessageDigest.getInstance("MD5");
|
||||
}
|
||||
catch (NoSuchAlgorithmException ex)
|
||||
{
|
||||
throw new IOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getLines()
|
||||
{
|
||||
try
|
||||
{
|
||||
final BufferedReader reader = new BufferedReader(new FileReader(file));
|
||||
try
|
||||
{
|
||||
final List<String> lines = new ArrayList<String>();
|
||||
do
|
||||
{
|
||||
final String line = reader.readLine();
|
||||
if (line == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.add(line);
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
return lines;
|
||||
}
|
||||
finally
|
||||
{
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,10 @@ public enum Mob
|
||||
SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID),
|
||||
ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE),
|
||||
MONSTER("Monster", Enemies.ENEMY, CreatureType.MONSTER),
|
||||
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF);
|
||||
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF),
|
||||
CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER),
|
||||
ENDERMAN("Enderman", Enemies.ENEMY, CreatureType.ENDERMAN),
|
||||
SILVERFISH("Silverfish", Enemies.ENEMY, CreatureType.SILVERFISH);
|
||||
|
||||
public static final Logger logger = Logger.getLogger("Minecraft");
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.Achievement;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Instrument;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@@ -39,22 +40,24 @@ public class OfflinePlayer implements Player
|
||||
private Location location = new Location(null, 0, 0, 0, 0, 0);
|
||||
private World world;
|
||||
private UUID uniqueId = UUID.randomUUID();
|
||||
private org.bukkit.OfflinePlayer base;
|
||||
|
||||
public OfflinePlayer(String name, IEssentials ess)
|
||||
{
|
||||
this.name = name;
|
||||
this.ess = ess;
|
||||
this.world = ess.getServer().getWorlds().get(0);
|
||||
this.base = ess.getServer().getOfflinePlayer(name);
|
||||
}
|
||||
|
||||
public boolean isOnline()
|
||||
{
|
||||
return false;
|
||||
return base.isOnline();
|
||||
}
|
||||
|
||||
public boolean isOp()
|
||||
{
|
||||
return false;
|
||||
return base.isOp();
|
||||
}
|
||||
|
||||
public void sendMessage(String string)
|
||||
@@ -576,6 +579,7 @@ public class OfflinePlayer implements Player
|
||||
|
||||
public void setOp(boolean bln)
|
||||
{
|
||||
base.setOp(bln);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -583,4 +587,131 @@ public class OfflinePlayer implements Player
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBanned()
|
||||
{
|
||||
return base.isBanned();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBanned(boolean bln)
|
||||
{
|
||||
base.setBanned(bln);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWhitelisted()
|
||||
{
|
||||
return base.isWhitelisted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWhitelisted(boolean bln)
|
||||
{
|
||||
base.setWhitelisted(bln);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameMode getGameMode()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGameMode(GameMode gm)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExperience()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExperience(int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLevel()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevel(int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalExperience()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTotalExperience(int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExhaustion()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExhaustion(float f)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSaturation()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSaturation(float f)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFoodLevel()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFoodLevel(int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBedSpawnLocation()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSprinting()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSprinting(boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,16 +17,6 @@ public class PlayerExtension extends PlayerWrapper
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
public boolean isBanned()
|
||||
{
|
||||
return ess.getBans().isNameBanned(this.getName());
|
||||
}
|
||||
|
||||
public boolean isIpBanned()
|
||||
{
|
||||
return ess.getBans().isIpBanned(getAddress().getAddress().getHostAddress());
|
||||
}
|
||||
|
||||
public float getCorrectedYaw()
|
||||
{
|
||||
float angle = (getLocation().getYaw() - 90.0f) % 360.0f;
|
||||
|
||||
@@ -617,4 +617,131 @@ public class PlayerWrapper implements Player
|
||||
{
|
||||
base.sendMap(mv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBanned()
|
||||
{
|
||||
return base.isBanned();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBanned(boolean bln)
|
||||
{
|
||||
base.setBanned(bln);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWhitelisted()
|
||||
{
|
||||
return base.isWhitelisted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWhitelisted(boolean bln)
|
||||
{
|
||||
base.setWhitelisted(bln);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameMode getGameMode()
|
||||
{
|
||||
return base.getGameMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGameMode(GameMode gm)
|
||||
{
|
||||
base.setGameMode(gm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExperience()
|
||||
{
|
||||
return base.getExperience();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExperience(int i)
|
||||
{
|
||||
base.setExperience(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLevel()
|
||||
{
|
||||
return base.getLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevel(int i)
|
||||
{
|
||||
base.setLevel(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalExperience()
|
||||
{
|
||||
return base.getTotalExperience();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTotalExperience(int i)
|
||||
{
|
||||
base.setTotalExperience(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExhaustion()
|
||||
{
|
||||
return base.getExhaustion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExhaustion(float f)
|
||||
{
|
||||
base.setExhaustion(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSaturation()
|
||||
{
|
||||
return base.getSaturation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSaturation(float f)
|
||||
{
|
||||
base.setSaturation(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFoodLevel()
|
||||
{
|
||||
return base.getFoodLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFoodLevel(int i)
|
||||
{
|
||||
base.setFoodLevel(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBedSpawnLocation()
|
||||
{
|
||||
return base.getBedSpawnLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSprinting()
|
||||
{
|
||||
return base.isSprinting();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSprinting(boolean bln)
|
||||
{
|
||||
base.setSprinting(bln);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public class Settings implements ISettings
|
||||
@Override
|
||||
public boolean isNetherEnabled()
|
||||
{
|
||||
return config.getBoolean("nether.enabled", true);
|
||||
return config.getBoolean("nether.enabled", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -362,7 +362,7 @@ public class Settings implements ISettings
|
||||
if (config.getBoolean("nether.use-1to1-ratio", false)) {
|
||||
return 1.0;
|
||||
}
|
||||
return config.getDouble("nether.ratio", 16.0);
|
||||
return config.getDouble("nether.ratio", 8.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -264,14 +264,7 @@ public class Teleport implements Runnable
|
||||
final Location loc = user.getHome(home);
|
||||
if (loc == null)
|
||||
{
|
||||
if (ess.getSettings().spawnIfNoHome())
|
||||
{
|
||||
respawn(ess.getSpawn(), chargeFor);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
teleport(new Target(loc), chargeFor);
|
||||
}
|
||||
|
||||
@@ -381,7 +381,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
this.hidden = hidden;
|
||||
}
|
||||
|
||||
public void checkJailTimeout(final long currentTime)
|
||||
//Returns true if status expired during this check
|
||||
public boolean checkJailTimeout(final long currentTime)
|
||||
{
|
||||
if (getJailTimeout() > 0 && getJailTimeout() < currentTime && isJailed())
|
||||
{
|
||||
@@ -396,26 +397,34 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void checkMuteTimeout(final long currentTime)
|
||||
//Returns true if status expired during this check
|
||||
public boolean checkMuteTimeout(final long currentTime)
|
||||
{
|
||||
if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted())
|
||||
{
|
||||
setMuteTimeout(0);
|
||||
sendMessage(Util.i18n("canTalkAgain"));
|
||||
setMuted(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void checkBanTimeout(final long currentTime)
|
||||
//Returns true if status expired during this check
|
||||
public boolean checkBanTimeout(final long currentTime)
|
||||
{
|
||||
if (getBanTimeout() > 0 && getBanTimeout() < currentTime && ess.getBans().isNameBanned(getName()))
|
||||
if (getBanTimeout() > 0 && getBanTimeout() < currentTime && isBanned())
|
||||
{
|
||||
setBanTimeout(0);
|
||||
ess.getBans().unbanByName(getName());
|
||||
setBanned(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void updateActivity(final boolean broadcast)
|
||||
@@ -464,4 +473,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
{
|
||||
return afkPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean toggleGodModeEnabled()
|
||||
{
|
||||
if (!isGodModeEnabled()) {
|
||||
setFoodLevel(20);
|
||||
}
|
||||
return super.toggleGodModeEnabled();
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
geolocation = _getGeoLocation();
|
||||
isSocialSpyEnabled = _isSocialSpyEnabled();
|
||||
isNPC = _isNPC();
|
||||
arePowerToolsEnabled = _arePowerToolsEnabled();
|
||||
}
|
||||
private double money;
|
||||
|
||||
@@ -153,6 +154,8 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
public void setHome(String name, Location loc)
|
||||
{
|
||||
//Invalid names will corrupt the yaml
|
||||
name = Util.sanitizeFileName(name);
|
||||
homes.put(name, loc);
|
||||
config.setProperty("homes." + name, loc);
|
||||
config.save();
|
||||
@@ -240,6 +243,12 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
|
||||
}
|
||||
|
||||
public void clearAllPowertools() {
|
||||
powertools.clear();
|
||||
config.setProperty("powertools", powertools);
|
||||
config.save();
|
||||
}
|
||||
|
||||
public List<String> getPowertool(ItemStack stack)
|
||||
{
|
||||
return (List<String>)powertools.get(stack.getTypeId());
|
||||
@@ -258,6 +267,12 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("powertools", powertools);
|
||||
config.save();
|
||||
}
|
||||
|
||||
public boolean hasPowerTools()
|
||||
{
|
||||
return powertools.size() > 0;
|
||||
}
|
||||
|
||||
private Location lastLocation;
|
||||
|
||||
private Location _getLastLocation()
|
||||
@@ -766,4 +781,31 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("npc", set);
|
||||
config.save();
|
||||
}
|
||||
|
||||
private boolean arePowerToolsEnabled;
|
||||
|
||||
public boolean arePowerToolsEnabled()
|
||||
{
|
||||
return arePowerToolsEnabled;
|
||||
}
|
||||
|
||||
public void setPowerToolsEnabled(boolean set)
|
||||
{
|
||||
arePowerToolsEnabled = set;
|
||||
config.setProperty("powertoolsenabled", set);
|
||||
config.save();
|
||||
}
|
||||
|
||||
public boolean togglePowerToolsEnabled()
|
||||
{
|
||||
boolean ret = !arePowerToolsEnabled();
|
||||
setPowerToolsEnabled(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private boolean _arePowerToolsEnabled()
|
||||
{
|
||||
return config.getBoolean("powertoolsenabled", true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ComputationException;
|
||||
import com.google.common.collect.MapMaker;
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
@@ -47,6 +50,10 @@ public class UserMap implements Function<String, User>, IConf
|
||||
{
|
||||
// Ignore these
|
||||
}
|
||||
catch (ComputationException ex)
|
||||
{
|
||||
Bukkit.getLogger().log(Level.INFO, "Failed to preload user "+name, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,10 +14,12 @@ import java.text.MessageFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Enumeration;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -217,6 +219,40 @@ public class Util
|
||||
return c.getTimeInMillis();
|
||||
}
|
||||
|
||||
// The player can stand inside these materials
|
||||
private static final Set<Integer> AIR_MATERIALS = new HashSet<Integer>();
|
||||
|
||||
static {
|
||||
AIR_MATERIALS.add(Material.AIR.getId());
|
||||
AIR_MATERIALS.add(Material.SAPLING.getId());
|
||||
AIR_MATERIALS.add(Material.POWERED_RAIL.getId());
|
||||
AIR_MATERIALS.add(Material.DETECTOR_RAIL.getId());
|
||||
AIR_MATERIALS.add(Material.DEAD_BUSH.getId());
|
||||
AIR_MATERIALS.add(Material.RAILS.getId());
|
||||
AIR_MATERIALS.add(Material.YELLOW_FLOWER.getId());
|
||||
AIR_MATERIALS.add(Material.RED_ROSE.getId());
|
||||
AIR_MATERIALS.add(Material.RED_MUSHROOM.getId());
|
||||
AIR_MATERIALS.add(Material.BROWN_MUSHROOM.getId());
|
||||
AIR_MATERIALS.add(Material.SEEDS.getId());
|
||||
AIR_MATERIALS.add(Material.SIGN_POST.getId());
|
||||
AIR_MATERIALS.add(Material.WALL_SIGN.getId());
|
||||
AIR_MATERIALS.add(Material.LADDER.getId());
|
||||
AIR_MATERIALS.add(Material.SUGAR_CANE_BLOCK.getId());
|
||||
AIR_MATERIALS.add(Material.REDSTONE_WIRE.getId());
|
||||
AIR_MATERIALS.add(Material.REDSTONE_TORCH_OFF.getId());
|
||||
AIR_MATERIALS.add(Material.REDSTONE_TORCH_ON.getId());
|
||||
AIR_MATERIALS.add(Material.TORCH.getId());
|
||||
AIR_MATERIALS.add(Material.SOIL.getId());
|
||||
AIR_MATERIALS.add(Material.DIODE_BLOCK_OFF.getId());
|
||||
AIR_MATERIALS.add(Material.DIODE_BLOCK_ON.getId());
|
||||
AIR_MATERIALS.add(Material.TRAP_DOOR.getId());
|
||||
AIR_MATERIALS.add(Material.STONE_BUTTON.getId());
|
||||
AIR_MATERIALS.add(Material.STONE_PLATE.getId());
|
||||
AIR_MATERIALS.add(Material.WOOD_PLATE.getId());
|
||||
AIR_MATERIALS.add(Material.IRON_DOOR_BLOCK.getId());
|
||||
AIR_MATERIALS.add(Material.WOODEN_DOOR.getId());
|
||||
}
|
||||
|
||||
public static Location getSafeDestination(final Location loc) throws Exception
|
||||
{
|
||||
if (loc == null || loc.getWorld() == null)
|
||||
@@ -224,9 +260,9 @@ public class Util
|
||||
throw new Exception(Util.i18n("destinationNotSet"));
|
||||
}
|
||||
final World world = loc.getWorld();
|
||||
int x = loc.getBlockX();
|
||||
int y = loc.getBlockY();
|
||||
int z = loc.getBlockZ();
|
||||
int x = (int)Math.round(loc.getX());
|
||||
int y = (int)Math.round(loc.getY());
|
||||
int z = (int)Math.round(loc.getZ());
|
||||
|
||||
while (isBlockAboveAir(world, x, y, z))
|
||||
{
|
||||
@@ -264,7 +300,7 @@ public class Util
|
||||
|
||||
private static boolean isBlockAboveAir(final World world, final int x, final int y, final int z)
|
||||
{
|
||||
return world.getBlockAt(x, y - 1, z).getType() == Material.AIR;
|
||||
return AIR_MATERIALS.contains(world.getBlockAt(x, y - 1, z).getType().getId());
|
||||
}
|
||||
|
||||
public static boolean isBlockUnsafe(final World world, final int x, final int y, final int z)
|
||||
@@ -280,8 +316,8 @@ public class Util
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((world.getBlockAt(x, y, z).getType() != Material.AIR)
|
||||
|| (world.getBlockAt(x, y + 1, z).getType() != Material.AIR))
|
||||
if ((!AIR_MATERIALS.contains(world.getBlockAt(x, y, z).getType().getId()))
|
||||
|| (!AIR_MATERIALS.contains(world.getBlockAt(x, y + 1, z).getType().getId())))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public class Commandban extends EssentialsCommand
|
||||
{
|
||||
banReason = Util.i18n("defaultBanReason");
|
||||
}
|
||||
player.setBanned(true);
|
||||
player.kickPlayer(banReason);
|
||||
ess.getBans().banByName(player.getName());
|
||||
String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
|
||||
|
||||
for(Player p : server.getOnlinePlayers())
|
||||
|
||||
@@ -20,7 +20,7 @@ public class Commandbanip extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
ess.getBans().banByIp(args[0]);
|
||||
ess.getServer().banIP(args[0]);
|
||||
sender.sendMessage(Util.i18n("banIpAddress"));
|
||||
}
|
||||
}
|
||||
@@ -45,11 +45,15 @@ public class Commandhome extends EssentialsCommand
|
||||
catch (NotEnoughArgumentsException e)
|
||||
{
|
||||
List<String> homes = u.getHomes();
|
||||
if (homes.isEmpty())
|
||||
if (homes.isEmpty() && u.equals(user) && ess.getSettings().spawnIfNoHome())
|
||||
{
|
||||
user.getTeleport().respawn(ess.getSpawn(), charge);
|
||||
}
|
||||
else if (homes.isEmpty())
|
||||
{
|
||||
throw new Exception(u == user ? Util.i18n("noHomeSet") : Util.i18n("noHomeSetPlayer"));
|
||||
}
|
||||
else if ((homes.size() == 1) && u == user)
|
||||
else if (homes.size() == 1 && u.equals(user))
|
||||
{
|
||||
user.getTeleport().home(u, homes.get(0), charge);
|
||||
}
|
||||
|
||||
@@ -49,5 +49,6 @@ public class Commandinvsee extends EssentialsCommand
|
||||
user.getInventory().setContents(invUserStack);
|
||||
user.sendMessage(Util.format("invSee", invUser.getDisplayName()));
|
||||
user.sendMessage(Util.i18n("invSeeHelp"));
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,6 @@ public class Commandmail extends EssentialsCommand
|
||||
user.setMails(null);
|
||||
throw new Exception(Util.i18n("mailCleared"));
|
||||
}
|
||||
throw new NotEnoughArgumentsException();
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,16 @@ public class Commandpowertool extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
String command = getFinalArg(args, 0);
|
||||
|
||||
// check to see if this is a clear all command
|
||||
if(command != null && command.equalsIgnoreCase("clearall"))
|
||||
{
|
||||
user.clearAllPowertools();
|
||||
user.sendMessage(Util.i18n("powerToolClearAll"));
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemStack itemStack = user.getItemInHand();
|
||||
if (itemStack == null || itemStack.getType() == Material.AIR)
|
||||
{
|
||||
@@ -26,7 +36,6 @@ public class Commandpowertool extends EssentialsCommand
|
||||
}
|
||||
|
||||
final String itemName = itemStack.getType().toString().toLowerCase().replaceAll("_", " ");
|
||||
String command = getFinalArg(args, 0);
|
||||
List<String> powertools = user.getPowertool(itemStack);
|
||||
if (command != null && !command.isEmpty())
|
||||
{
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandpowertooltoggle extends EssentialsCommand
|
||||
{
|
||||
public Commandpowertooltoggle()
|
||||
{
|
||||
super("powertooltoggle");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if(!user.hasPowerTools())
|
||||
{
|
||||
user.sendMessage(Util.i18n("noPowerTools"));
|
||||
return;
|
||||
}
|
||||
user.sendMessage(user.togglePowerToolsEnabled()
|
||||
? Util.i18n("powerToolsEnabled")
|
||||
: Util.i18n("powerToolsDisabled"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -97,29 +96,31 @@ public class Commandptime extends EssentialsCommand
|
||||
*/
|
||||
private void getUsersTime(final CommandSender sender, final Collection<User> users)
|
||||
{
|
||||
if (users.size() > 1)
|
||||
if (users.size() > 1)
|
||||
{
|
||||
sender.sendMessage(Util.format("pTimePlayers"));
|
||||
}
|
||||
|
||||
for (User user : users)
|
||||
|
||||
for (User user : users)
|
||||
{
|
||||
if(user.getPlayerTimeOffset() == 0)
|
||||
if (user.getPlayerTimeOffset() == 0)
|
||||
{
|
||||
sender.sendMessage(Util.format("pTimeNormal", user.getName()));
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
String time = DescParseTickFormat.format(user.getPlayerTime());
|
||||
if(!user.isPlayerTimeRelative())
|
||||
if (!user.isPlayerTimeRelative())
|
||||
{
|
||||
sender.sendMessage(Util.format("pTimeCurrentFixed", user.getName(), time));
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
sender.sendMessage(Util.format("pTimeCurrent", user.getName(), time));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,7 +178,8 @@ public class Commandptime extends EssentialsCommand
|
||||
{
|
||||
sender.sendMessage(Util.format("pTimeSetFixed", time, msg.toString()));
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
sender.sendMessage(Util.format("pTimeSet", time, msg.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ public class Commandspawner extends EssentialsCommand
|
||||
try
|
||||
{
|
||||
String name = args[0];
|
||||
name = name.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(name);
|
||||
|
||||
name = name.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : name.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(name);
|
||||
|
||||
Mob mob = null;
|
||||
mob = Mob.fromName(name);
|
||||
if (mob == null)
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
String[] mountparts = args[0].split(",");
|
||||
String[] parts = mountparts[0].split(":");
|
||||
String mobType = parts[0];
|
||||
mobType = mobType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mobType);
|
||||
mobType = mobType.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : mobType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mobType);
|
||||
String mobData = null;
|
||||
if (parts.length == 2)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
{
|
||||
parts = mountparts[1].split(":");
|
||||
mountType = parts[0];
|
||||
mountType = mountType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mountType);
|
||||
mountType = mountType.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : mountType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mountType);
|
||||
if (parts.length == 2)
|
||||
{
|
||||
mountData = parts[1];
|
||||
@@ -77,7 +77,8 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
8, 9
|
||||
};
|
||||
Block block = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock();
|
||||
if(block == null) {
|
||||
if (block == null)
|
||||
{
|
||||
user.sendMessage(Util.i18n("unableToSpawnMob"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ public class Commandtempban extends EssentialsCommand
|
||||
final String banReason = Util.format("tempBanned", Util.formatDateDiff(banTimestamp));
|
||||
player.setBanReason(banReason);
|
||||
player.setBanTimeout(banTimestamp);
|
||||
player.setBanned(true);
|
||||
player.kickPlayer(banReason);
|
||||
ess.getBans().banByName(player.getName());
|
||||
String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
|
||||
|
||||
for(Player p : server.getOnlinePlayers())
|
||||
|
||||
@@ -25,7 +25,7 @@ public class Commandtime extends EssentialsCommand
|
||||
{
|
||||
worldSelector = args[1];
|
||||
}
|
||||
Set<World> worlds = getWorlds(server, sender, worldSelector);
|
||||
final Set<World> worlds = getWorlds(server, sender, worldSelector);
|
||||
|
||||
// If no arguments we are reading the time
|
||||
if (args.length == 0)
|
||||
@@ -34,7 +34,7 @@ public class Commandtime extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
User user = ess.getUser(sender);
|
||||
final User user = ess.getUser(sender);
|
||||
if (user != null && !user.isAuthorized("essentials.time.set"))
|
||||
{
|
||||
user.sendMessage(Util.i18n("timeSetPermission"));
|
||||
|
||||
@@ -15,7 +15,6 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
super("togglejail");
|
||||
}
|
||||
|
||||
//TODO: move these to messages file
|
||||
@Override
|
||||
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
{
|
||||
@@ -73,7 +72,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
|
||||
if (args.length >= 2 && p.isJailed() && !args[1].equalsIgnoreCase(p.getJail()))
|
||||
{
|
||||
sender.sendMessage("§cPerson is already in jail " + p.getJail());
|
||||
sender.sendMessage(Util.format("jailAlreadyIncarcerated", p.getJail()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
String time = getFinalArg(args, 2);
|
||||
long timeDiff = Util.parseDateDiff(time, true);
|
||||
p.setJailTimeout(timeDiff);
|
||||
sender.sendMessage("Jail time extend to " + Util.formatDateDiff(timeDiff));
|
||||
sender.sendMessage(Util.format("jailSentenceExtended", Util.formatDateDiff(timeDiff)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -94,13 +93,13 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
}
|
||||
p.setJailed(false);
|
||||
p.setJailTimeout(0);
|
||||
p.sendMessage("§7You have been released");
|
||||
p.sendMessage(Util.format("jailReleasedPlayerNotify"));
|
||||
p.setJail(null);
|
||||
if (!(p.getBase() instanceof OfflinePlayer))
|
||||
{
|
||||
p.getTeleport().back();
|
||||
}
|
||||
sender.sendMessage("§7Player " + p.getName() + " unjailed.");
|
||||
sender.sendMessage(Util.format("jailReleased", p.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,12 @@ public class Commandtppos extends EssentialsCommand
|
||||
int y = Integer.parseInt(args[1]);
|
||||
int z = Integer.parseInt(args[2]);
|
||||
Location l = new Location(user.getWorld(), x, y, z);
|
||||
if (args.length > 3) {
|
||||
l.setYaw(Float.parseFloat(args[3]));
|
||||
}
|
||||
if (args.length > 4) {
|
||||
l.setPitch(Float.parseFloat(args[4]));
|
||||
}
|
||||
Trade charge = new Trade(this.getName(), ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.sendMessage(Util.i18n("teleporting"));
|
||||
|
||||
@@ -21,17 +21,15 @@ public class Commandunban extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
String name;
|
||||
try
|
||||
{
|
||||
User u = getPlayer(server, args, 0, true);
|
||||
name = u.getName();
|
||||
final User u = getPlayer(server, args, 0, true);
|
||||
u.setBanned(false);
|
||||
sender.sendMessage(Util.i18n("unbannedPlayer"));
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
{
|
||||
name = args[0];
|
||||
sender.sendMessage(Util.i18n("playerNotFound"));
|
||||
}
|
||||
ess.getBans().unbanByName(name);
|
||||
sender.sendMessage(Util.i18n("unbannedPlayer"));
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class Commandunbanip extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
ess.getBans().unbanByIp(args[0]);
|
||||
ess.getServer().unbanIP(args[0]);
|
||||
sender.sendMessage(Util.i18n("unbannedIP"));
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,20 @@ package com.earth2me.essentials.perm;
|
||||
import de.bananaco.permissions.Permissions;
|
||||
import de.bananaco.permissions.interfaces.PermissionSet;
|
||||
import de.bananaco.permissions.worlds.WorldPermissionsManager;
|
||||
import de.bananaco.permissions.info.InfoReader;
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class BPermissionsHandler extends SuperpermsHandler
|
||||
public class BPermissionsHandler implements IPermissionsHandler
|
||||
{
|
||||
private final transient WorldPermissionsManager wpm;
|
||||
|
||||
private final transient InfoReader info;
|
||||
public BPermissionsHandler()
|
||||
{
|
||||
wpm = Permissions.getWorldPermissionsManager();
|
||||
info = new InfoReader();
|
||||
info.instantiate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,4 +51,28 @@ public class BPermissionsHandler extends SuperpermsHandler
|
||||
}
|
||||
return groups.contains(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBuild(final Player base, final String group)
|
||||
{
|
||||
return hasPermission(base, "essentials.build") || hasPermission(base, "bPermissions.build");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrefix(final Player base)
|
||||
{
|
||||
return info.getPrefix(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSuffix(final Player base)
|
||||
{
|
||||
return info.getSuffix(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(final Player base, final String node)
|
||||
{
|
||||
return base.hasPermission(node);
|
||||
}
|
||||
}
|
||||
@@ -74,4 +74,10 @@ public class PermissionsBukkitHandler extends SuperpermsHandler
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBuild(Player base, String group)
|
||||
{
|
||||
return base.hasPermission("essentials.build") || base.hasPermission("permissions.build");
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* Method.java
|
||||
* Interface to be implemented by a payment method.
|
||||
*
|
||||
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun)
|
||||
* @copyright Copyright (C) 2011
|
||||
@@ -41,6 +41,14 @@ public interface Method
|
||||
*/
|
||||
public String getVersion();
|
||||
|
||||
/**
|
||||
* Returns the amount of decimal places that get stored
|
||||
* NOTE: it will return -1 if there is no rounding
|
||||
*
|
||||
* @return <code>int</code> for each decimal place
|
||||
*/
|
||||
public int fractionalDigits();
|
||||
|
||||
/**
|
||||
* Formats amounts into this payment methods style of currency display.
|
||||
*
|
||||
|
||||
@@ -5,9 +5,6 @@ import java.util.Set;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>Methods</code> initializes Methods that utilize the Method interface
|
||||
@@ -15,15 +12,13 @@ import java.util.Set;
|
||||
*
|
||||
* Allowing you to check whether a payment method exists or not.
|
||||
*
|
||||
* <blockquote><pre>
|
||||
* Methods methods = new Methods();
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* 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>
|
||||
* Methods methods = new Methods("iConomy");
|
||||
* economy:
|
||||
* preferred: "iConomy"
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @author: Nijikokun <nijikokun@shortmail.com> (@nijikokun)
|
||||
@@ -32,51 +27,62 @@ import java.util.Set;
|
||||
*/
|
||||
public class Methods
|
||||
{
|
||||
private boolean self = false;
|
||||
private Method Method = null;
|
||||
private String preferred = "";
|
||||
private Set<Method> Methods = new HashSet<Method>();
|
||||
private Set<String> Dependencies = new HashSet<String>();
|
||||
private Set<Method> Attachables = new HashSet<Method>();
|
||||
private static String version = null;
|
||||
private static boolean self = false;
|
||||
private static Method Method = null;
|
||||
private static String preferred = "";
|
||||
private static Set<Method> Methods = new HashSet<Method>();
|
||||
private static Set<String> Dependencies = new HashSet<String>();
|
||||
private static Set<Method> Attachables = new HashSet<Method>();
|
||||
|
||||
/**
|
||||
* Initialize Method class
|
||||
*/
|
||||
public Methods()
|
||||
static
|
||||
{
|
||||
this._init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes <code>Methods</code> class utilizing a "preferred" payment method check before
|
||||
* returning the first method that was initialized.
|
||||
*
|
||||
* @param preferred Payment method that is most preferred for this setup.
|
||||
*/
|
||||
public Methods(String preferred)
|
||||
{
|
||||
this._init();
|
||||
|
||||
if (this.Dependencies.contains(preferred))
|
||||
{
|
||||
this.preferred = preferred;
|
||||
}
|
||||
_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement all methods along with their respective name & class.
|
||||
*
|
||||
* @see #Methods()
|
||||
* @see #Methods(java.lang.String)
|
||||
*/
|
||||
private void _init()
|
||||
private static void _init()
|
||||
{
|
||||
this.addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo4());
|
||||
this.addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo5());
|
||||
this.addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo6());
|
||||
this.addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE6());
|
||||
this.addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE7());
|
||||
this.addMethod("MultiCurrency", new com.earth2me.essentials.register.payment.methods.MCUR());
|
||||
addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo6());
|
||||
addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo5());
|
||||
addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo4());
|
||||
addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE6());
|
||||
addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE7());
|
||||
addMethod("Currency", new com.earth2me.essentials.register.payment.methods.MCUR());
|
||||
Dependencies.add("MultiCurrency");
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by the plugin to setup version
|
||||
*
|
||||
* @param v version
|
||||
*/
|
||||
public static void setVersion(String v)
|
||||
{
|
||||
version = v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use to reset methods during disable
|
||||
*/
|
||||
public static void reset()
|
||||
{
|
||||
version = null;
|
||||
self = false;
|
||||
Method = null;
|
||||
preferred = "";
|
||||
Attachables.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Use to get version of Register plugin
|
||||
* @return version
|
||||
*/
|
||||
public static String getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +92,7 @@ public class Methods
|
||||
* @return <code>Set<String></code> - Array of payment methods that are loaded.
|
||||
* @see #setMethod(org.bukkit.plugin.Plugin)
|
||||
*/
|
||||
public Set<String> getDependencies()
|
||||
public static Set<String> getDependencies()
|
||||
{
|
||||
return Dependencies;
|
||||
}
|
||||
@@ -98,7 +104,7 @@ public class Methods
|
||||
* @param plugin Plugin data from bukkit, Internal Class file.
|
||||
* @return Method <em>or</em> Null
|
||||
*/
|
||||
public Method createMethod(Plugin plugin)
|
||||
public static Method createMethod(Plugin plugin)
|
||||
{
|
||||
for (Method method : Methods)
|
||||
{
|
||||
@@ -112,7 +118,7 @@ public class Methods
|
||||
return null;
|
||||
}
|
||||
|
||||
private void addMethod(String name, Method method)
|
||||
private static void addMethod(String name, Method method)
|
||||
{
|
||||
Dependencies.add(name);
|
||||
Methods.add(method);
|
||||
@@ -125,7 +131,7 @@ public class Methods
|
||||
* @see #setMethod(org.bukkit.plugin.Plugin)
|
||||
* @see #checkDisabled(org.bukkit.plugin.Plugin)
|
||||
*/
|
||||
public boolean hasMethod()
|
||||
public static boolean hasMethod()
|
||||
{
|
||||
return (Method != null);
|
||||
}
|
||||
@@ -134,15 +140,16 @@ public class Methods
|
||||
* Checks Plugin Class against a multitude of checks to verify it's usability
|
||||
* as a payment method.
|
||||
*
|
||||
* @param method Plugin data from bukkit, Internal Class file.
|
||||
* @param <code>PluginManager</code> the plugin manager for the server
|
||||
* @return <code>boolean</code> True on success, False on failure.
|
||||
*/
|
||||
public boolean setMethod(Plugin method)
|
||||
public static boolean setMethod(PluginManager manager)
|
||||
{
|
||||
if (hasMethod())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (self)
|
||||
{
|
||||
self = false;
|
||||
@@ -152,44 +159,37 @@ public class Methods
|
||||
int count = 0;
|
||||
boolean match = false;
|
||||
Plugin plugin = null;
|
||||
PluginManager manager = method.getServer().getPluginManager();
|
||||
|
||||
for (String name : this.getDependencies())
|
||||
for (String name : getDependencies())
|
||||
{
|
||||
if (hasMethod())
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (method.getDescription().getName().equals(name))
|
||||
{
|
||||
plugin = method;
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin = manager.getPlugin(name);
|
||||
}
|
||||
|
||||
plugin = manager.getPlugin(name);
|
||||
if (plugin == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Method current = this.createMethod(plugin);
|
||||
Method current = createMethod(plugin);
|
||||
if (current == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (this.preferred.isEmpty())
|
||||
if (preferred.isEmpty())
|
||||
{
|
||||
this.Method = current;
|
||||
Method = current;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Attachables.add(current);
|
||||
Attachables.add(current);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.preferred.isEmpty())
|
||||
if (!preferred.isEmpty())
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -199,7 +199,7 @@ public class Methods
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Method attached : this.Attachables)
|
||||
for (Method attached : Attachables)
|
||||
{
|
||||
if (attached == null)
|
||||
{
|
||||
@@ -212,21 +212,21 @@ public class Methods
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.preferred.isEmpty())
|
||||
if (preferred.isEmpty())
|
||||
{
|
||||
this.Method = attached;
|
||||
Method = attached;
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
if (this.preferred.equalsIgnoreCase(attached.getName()))
|
||||
if (preferred.equalsIgnoreCase(attached.getName()))
|
||||
{
|
||||
this.Method = attached;
|
||||
Method = attached;
|
||||
}
|
||||
else
|
||||
{
|
||||
Method = attached;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Method = attached;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,12 +239,28 @@ public class Methods
|
||||
return hasMethod();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the preferred economy
|
||||
*
|
||||
* @return <code>boolean</code>
|
||||
*/
|
||||
public static boolean setPreferred(String check)
|
||||
{
|
||||
if (getDependencies().contains(check))
|
||||
{
|
||||
preferred = check;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the existing and initialized (hopefully) Method Class.
|
||||
*
|
||||
* @return <code>Method</code> <em>or</em> <code>Null</code>
|
||||
*/
|
||||
public Method getMethod()
|
||||
public static Method getMethod()
|
||||
{
|
||||
return Method;
|
||||
}
|
||||
@@ -256,16 +272,18 @@ public class Methods
|
||||
* @param method Plugin data from bukkit, Internal Class file.
|
||||
* @return <code>boolean</code>
|
||||
*/
|
||||
public boolean checkDisabled(Plugin method)
|
||||
public static boolean checkDisabled(Plugin method)
|
||||
{
|
||||
if (!hasMethod())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Method.isCompatible(method))
|
||||
{
|
||||
Method = null;
|
||||
}
|
||||
|
||||
return (Method == null);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
|
||||
import cosine.boseconomy.BOSEconomy;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* BOSEconomy 6 Implementation of Method
|
||||
*
|
||||
@@ -11,191 +13,256 @@ import org.bukkit.plugin.Plugin;
|
||||
* @copyright (c) 2011
|
||||
* @license AOL license <http://aol.nexua.org>
|
||||
*/
|
||||
public class BOSE6 implements Method {
|
||||
private BOSEconomy BOSEconomy;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BOSE6 implements Method
|
||||
{
|
||||
private BOSEconomy BOSEconomy;
|
||||
|
||||
public BOSEconomy getPlugin() {
|
||||
return this.BOSEconomy;
|
||||
}
|
||||
public BOSEconomy getPlugin()
|
||||
{
|
||||
return this.BOSEconomy;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "BOSEconomy";
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return "BOSEconomy";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "0.6.2";
|
||||
}
|
||||
public String getVersion()
|
||||
{
|
||||
return "0.6.2";
|
||||
}
|
||||
|
||||
public String format(double amount) {
|
||||
String currency = this.BOSEconomy.getMoneyNamePlural();
|
||||
if(amount == 1) currency = this.BOSEconomy.getMoneyName();
|
||||
return amount + " " + currency;
|
||||
}
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean hasBanks() {
|
||||
return true;
|
||||
}
|
||||
public String format(double amount)
|
||||
{
|
||||
String currency = this.BOSEconomy.getMoneyNamePlural();
|
||||
|
||||
public boolean hasBank(String bank) {
|
||||
return this.BOSEconomy.bankExists(bank);
|
||||
}
|
||||
if (amount == 1)
|
||||
{
|
||||
currency = this.BOSEconomy.getMoneyName();
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name) {
|
||||
return this.BOSEconomy.playerRegistered(name, false);
|
||||
}
|
||||
return amount + " " + currency;
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return this.BOSEconomy.isBankOwner(bank, name) || this.BOSEconomy.isBankMember(bank, name);
|
||||
}
|
||||
public boolean hasBanks()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name) {
|
||||
if(!hasAccount(name)) return null;
|
||||
return new BOSEAccount(name, this.BOSEconomy);
|
||||
}
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return this.BOSEconomy.bankExists(bank);
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
if(!hasBankAccount(bank, name)) return null;
|
||||
return new BOSEBankAccount(bank, BOSEconomy);
|
||||
}
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return this.BOSEconomy.playerRegistered(name, false);
|
||||
}
|
||||
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy") && plugin instanceof BOSEconomy && plugin.getDescription().getVersion().equals("0.6.2");
|
||||
}
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return this.BOSEconomy.isBankOwner(bank, name)
|
||||
|| this.BOSEconomy.isBankMember(bank, name);
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin) {
|
||||
BOSEconomy = (BOSEconomy)plugin;
|
||||
}
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
if (!hasAccount(name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public class BOSEAccount implements MethodAccount {
|
||||
private String name;
|
||||
private BOSEconomy BOSEconomy;
|
||||
return new BOSEAccount(name, this.BOSEconomy);
|
||||
}
|
||||
|
||||
public BOSEAccount(String name, BOSEconomy bOSEconomy) {
|
||||
this.name = name;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
if (!hasBankAccount(bank, name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return (double) this.BOSEconomy.getPlayerMoney(this.name);
|
||||
}
|
||||
return new BOSEBankAccount(bank, BOSEconomy);
|
||||
}
|
||||
|
||||
public boolean set(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, IntAmount, false);
|
||||
}
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy")
|
||||
&& plugin instanceof BOSEconomy
|
||||
&& plugin.getDescription().getVersion().equals("0.6.2");
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
return this.BOSEconomy.addPlayerMoney(this.name, IntAmount, false);
|
||||
}
|
||||
public void setPlugin(Plugin plugin)
|
||||
{
|
||||
BOSEconomy = (BOSEconomy)plugin;
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance - IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance * IntAmount), false);
|
||||
}
|
||||
public class BOSEAccount implements MethodAccount
|
||||
{
|
||||
private final String name;
|
||||
private final BOSEconomy BOSEconomy;
|
||||
|
||||
public boolean divide(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance / IntAmount), false);
|
||||
}
|
||||
public BOSEAccount(String name, BOSEconomy bOSEconomy)
|
||||
{
|
||||
this.name = name;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return (double)this.BOSEconomy.getPlayerMoney(this.name);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, IntAmount, false);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
return this.BOSEconomy.addPlayerMoney(this.name, IntAmount, false);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance - IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance * IntAmount), false);
|
||||
}
|
||||
|
||||
public class BOSEBankAccount implements MethodBankAccount {
|
||||
private final String bank;
|
||||
private final BOSEconomy BOSEconomy;
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance / IntAmount), false);
|
||||
}
|
||||
|
||||
public BOSEBankAccount(String bank, BOSEconomy bOSEconomy) {
|
||||
this.bank = bank;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return this.bank;
|
||||
}
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
public int getBankId() {
|
||||
return -1;
|
||||
}
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return (double) this.BOSEconomy.getBankMoney(bank);
|
||||
}
|
||||
public boolean isNegative()
|
||||
{
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
public boolean set(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
return this.BOSEconomy.setBankMoney(bank, IntAmount, true);
|
||||
}
|
||||
public boolean remove()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance + IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance - IntAmount), false);
|
||||
}
|
||||
public class BOSEBankAccount implements MethodBankAccount
|
||||
{
|
||||
private final String bank;
|
||||
private final BOSEconomy BOSEconomy;
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance * IntAmount), false);
|
||||
}
|
||||
public BOSEBankAccount(String bank, BOSEconomy bOSEconomy)
|
||||
{
|
||||
this.bank = bank;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance / IntAmount), false);
|
||||
}
|
||||
public String getBankName()
|
||||
{
|
||||
return this.bank;
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
public int getBankId()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return (double)this.BOSEconomy.getBankMoney(bank);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
return this.BOSEconomy.setBankMoney(bank, IntAmount, true);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance + IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
return this.BOSEconomy.removeBank(bank);
|
||||
}
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance - IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance * IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
int IntAmount = (int)Math.ceil(amount);
|
||||
int balance = (int)this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance / IntAmount), false);
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
public boolean isNegative()
|
||||
{
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
public boolean remove()
|
||||
{
|
||||
return this.BOSEconomy.removeBank(bank);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
|
||||
import cosine.boseconomy.BOSEconomy;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* BOSEconomy 7 Implementation of Method
|
||||
*
|
||||
@@ -12,182 +14,244 @@ import org.bukkit.plugin.Plugin;
|
||||
* @copyright (c) 2011
|
||||
* @license AOL license <http://aol.nexua.org>
|
||||
*/
|
||||
public class BOSE7 implements Method
|
||||
{
|
||||
private BOSEconomy BOSEconomy;
|
||||
|
||||
public class BOSE7 implements Method {
|
||||
private BOSEconomy BOSEconomy;
|
||||
public BOSEconomy getPlugin()
|
||||
{
|
||||
return this.BOSEconomy;
|
||||
}
|
||||
|
||||
public BOSEconomy getPlugin() {
|
||||
return this.BOSEconomy;
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return "BOSEconomy";
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "BOSEconomy";
|
||||
}
|
||||
public String getVersion()
|
||||
{
|
||||
return "0.7.0";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "0.7.0";
|
||||
}
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return this.BOSEconomy.getFractionalDigits();
|
||||
}
|
||||
|
||||
public String format(double amount) {
|
||||
String currency = this.BOSEconomy.getMoneyNamePlural();
|
||||
if(amount == 1) currency = this.BOSEconomy.getMoneyName();
|
||||
return amount + " " + currency;
|
||||
}
|
||||
public String format(double amount)
|
||||
{
|
||||
String currency = this.BOSEconomy.getMoneyNamePlural();
|
||||
|
||||
public boolean hasBanks() {
|
||||
return true;
|
||||
}
|
||||
if (amount == 1)
|
||||
{
|
||||
currency = this.BOSEconomy.getMoneyName();
|
||||
}
|
||||
|
||||
public boolean hasBank(String bank) {
|
||||
return this.BOSEconomy.bankExists(bank);
|
||||
}
|
||||
return amount + " " + currency;
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name) {
|
||||
return this.BOSEconomy.playerRegistered(name, false);
|
||||
}
|
||||
public boolean hasBanks()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return this.BOSEconomy.isBankOwner(bank, name) || this.BOSEconomy.isBankMember(bank, name);
|
||||
}
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return this.BOSEconomy.bankExists(bank);
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name) {
|
||||
if(!hasAccount(name)) return null;
|
||||
return new BOSEAccount(name, this.BOSEconomy);
|
||||
}
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return this.BOSEconomy.playerRegistered(name, false);
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
if(!hasBankAccount(bank, name)) return null;
|
||||
return new BOSEBankAccount(bank, BOSEconomy);
|
||||
}
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return this.BOSEconomy.isBankOwner(bank, name) || this.BOSEconomy.isBankMember(bank, name);
|
||||
}
|
||||
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy") && plugin instanceof BOSEconomy && !plugin.getDescription().getVersion().equals("0.6.2");
|
||||
}
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
if (!hasAccount(name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin) {
|
||||
BOSEconomy = (BOSEconomy)plugin;
|
||||
}
|
||||
return new BOSEAccount(name, this.BOSEconomy);
|
||||
}
|
||||
|
||||
public class BOSEAccount implements MethodAccount {
|
||||
private String name;
|
||||
private BOSEconomy BOSEconomy;
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
if (!hasBankAccount(bank, name))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public BOSEAccount(String name, BOSEconomy bOSEconomy) {
|
||||
this.name = name;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
return new BOSEBankAccount(bank, BOSEconomy);
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return this.BOSEconomy.getPlayerMoneyDouble(this.name);
|
||||
}
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy")
|
||||
&& plugin instanceof BOSEconomy
|
||||
&& !plugin.getDescription().getVersion().equals("0.6.2");
|
||||
}
|
||||
|
||||
public boolean set(double amount) {
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, amount, false);
|
||||
}
|
||||
public void setPlugin(Plugin plugin)
|
||||
{
|
||||
BOSEconomy = (BOSEconomy)plugin;
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
return this.BOSEconomy.addPlayerMoney(this.name, amount, false);
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance - amount), false);
|
||||
}
|
||||
public class BOSEAccount implements MethodAccount
|
||||
{
|
||||
private String name;
|
||||
private BOSEconomy BOSEconomy;
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance * amount), false);
|
||||
}
|
||||
public BOSEAccount(String name, BOSEconomy bOSEconomy)
|
||||
{
|
||||
this.name = name;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance / amount), false);
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return this.BOSEconomy.getPlayerMoneyDouble(this.name);
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, amount, false);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
return this.BOSEconomy.addPlayerMoney(this.name, amount, false);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance - amount), false);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance * amount), false);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance / amount), false);
|
||||
}
|
||||
|
||||
public class BOSEBankAccount implements MethodBankAccount {
|
||||
private String bank;
|
||||
private BOSEconomy BOSEconomy;
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
public BOSEBankAccount(String bank, BOSEconomy bOSEconomy) {
|
||||
this.bank = bank;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return this.bank;
|
||||
}
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
public int getBankId() {
|
||||
return -1;
|
||||
}
|
||||
public boolean isNegative()
|
||||
{
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return this.BOSEconomy.getBankMoneyDouble(bank);
|
||||
}
|
||||
public boolean remove()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean set(double amount) {
|
||||
return this.BOSEconomy.setBankMoney(bank, amount, true);
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance + amount), false);
|
||||
}
|
||||
public class BOSEBankAccount implements MethodBankAccount
|
||||
{
|
||||
private String bank;
|
||||
private BOSEconomy BOSEconomy;
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance - amount), false);
|
||||
}
|
||||
public BOSEBankAccount(String bank, BOSEconomy bOSEconomy)
|
||||
{
|
||||
this.bank = bank;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance * amount), false);
|
||||
}
|
||||
public String getBankName()
|
||||
{
|
||||
return this.bank;
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance / amount), false);
|
||||
}
|
||||
public int getBankId()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return this.BOSEconomy.getBankMoneyDouble(bank);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
return this.BOSEconomy.setBankMoney(bank, amount, true);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance + amount), false);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance - amount), false);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
return this.BOSEconomy.removeBank(bank);
|
||||
}
|
||||
}
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance * amount), false);
|
||||
}
|
||||
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance / amount), false);
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
public boolean isNegative()
|
||||
{
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
public boolean remove()
|
||||
{
|
||||
return this.BOSEconomy.removeBank(bank);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import me.ashtheking.currency.CurrencyList;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* MultiCurrency Method implementation.
|
||||
*
|
||||
@@ -14,107 +15,141 @@ import org.bukkit.plugin.Plugin;
|
||||
* @copyright (c) 2011
|
||||
* @license AOL license <http://aol.nexua.org>
|
||||
*/
|
||||
public class MCUR implements Method {
|
||||
private Currency currencyList;
|
||||
public class MCUR implements Method
|
||||
{
|
||||
private Currency currencyList;
|
||||
|
||||
public Object getPlugin() {
|
||||
return this.currencyList;
|
||||
}
|
||||
public Object getPlugin()
|
||||
{
|
||||
return this.currencyList;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "MultiCurrency";
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return "MultiCurrency";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "0.09";
|
||||
}
|
||||
public String getVersion()
|
||||
{
|
||||
return "0.09";
|
||||
}
|
||||
|
||||
public String format(double amount) {
|
||||
return amount + " Currency";
|
||||
}
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean hasBanks() {
|
||||
return false;
|
||||
}
|
||||
public String format(double amount)
|
||||
{
|
||||
return amount + " Currency";
|
||||
}
|
||||
|
||||
public boolean hasBank(String bank) {
|
||||
return false;
|
||||
}
|
||||
public boolean hasBanks()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name) {
|
||||
return true;
|
||||
}
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return false;
|
||||
}
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name) {
|
||||
return new MCurrencyAccount(name);
|
||||
}
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return null;
|
||||
}
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
return new MCurrencyAccount(name);
|
||||
}
|
||||
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase(getName()) && plugin instanceof Currency;
|
||||
}
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin) {
|
||||
currencyList = (Currency) plugin;
|
||||
}
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
return (plugin.getDescription().getName().equalsIgnoreCase("Currency")
|
||||
|| plugin.getDescription().getName().equalsIgnoreCase("MultiCurrency"))
|
||||
&& plugin instanceof Currency;
|
||||
}
|
||||
|
||||
public class MCurrencyAccount implements MethodAccount{
|
||||
private String name;
|
||||
public void setPlugin(Plugin plugin)
|
||||
{
|
||||
currencyList = (Currency)plugin;
|
||||
}
|
||||
|
||||
public MCurrencyAccount(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return CurrencyList.getValue((String) CurrencyList.maxCurrency(name)[0], name);
|
||||
}
|
||||
public class MCurrencyAccount implements MethodAccount
|
||||
{
|
||||
private String name;
|
||||
|
||||
public boolean set(double amount) {
|
||||
CurrencyList.setValue((String) CurrencyList.maxCurrency(name)[0], name, amount);
|
||||
return true;
|
||||
}
|
||||
public MCurrencyAccount(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
return CurrencyList.add(name, amount);
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return CurrencyList.getValue((String)CurrencyList.maxCurrency(name)[0], name);
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
return CurrencyList.subtract(name, amount);
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
CurrencyList.setValue((String)CurrencyList.maxCurrency(name)[0], name, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
return CurrencyList.multiply(name, amount);
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
return CurrencyList.add(name, amount);
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
return CurrencyList.divide(name, amount);
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
return CurrencyList.subtract(name, amount);
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return CurrencyList.hasEnough(name, amount);
|
||||
}
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
return CurrencyList.multiply(name, amount);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return CurrencyList.hasOver(name, amount);
|
||||
}
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
return CurrencyList.divide(name, amount);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return CurrencyList.hasUnder(name, amount);
|
||||
}
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return CurrencyList.hasEnough(name, amount);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return CurrencyList.isNegative(name);
|
||||
}
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return CurrencyList.hasOver(name, amount);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
return CurrencyList.remove(name);
|
||||
}
|
||||
}
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return CurrencyList.hasUnder(name, amount);
|
||||
}
|
||||
|
||||
public boolean isNegative()
|
||||
{
|
||||
return CurrencyList.isNegative(name);
|
||||
}
|
||||
|
||||
public boolean remove()
|
||||
{
|
||||
return CurrencyList.remove(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import com.nijiko.coelho.iConomy.iConomy;
|
||||
import com.nijiko.coelho.iConomy.system.Account;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* iConomy 4 Implementation of Method
|
||||
*
|
||||
@@ -14,122 +15,175 @@ import org.bukkit.plugin.Plugin;
|
||||
* @copyright (c) 2011
|
||||
* @license AOL license <http://aol.nexua.org>
|
||||
*/
|
||||
public class iCo4 implements Method {
|
||||
private iConomy iConomy;
|
||||
public class iCo4 implements Method
|
||||
{
|
||||
private iConomy iConomy;
|
||||
|
||||
public iConomy getPlugin() {
|
||||
return this.iConomy;
|
||||
}
|
||||
public iConomy getPlugin()
|
||||
{
|
||||
return this.iConomy;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "iConomy";
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return "iConomy";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "4";
|
||||
}
|
||||
public String getVersion()
|
||||
{
|
||||
return "4";
|
||||
}
|
||||
|
||||
public String format(double amount) {
|
||||
return this.iConomy.getBank().format(amount);
|
||||
}
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public boolean hasBanks() {
|
||||
return false;
|
||||
}
|
||||
public String format(double amount)
|
||||
{
|
||||
return com.nijiko.coelho.iConomy.iConomy.getBank().format(amount);
|
||||
}
|
||||
|
||||
public boolean hasBank(String bank) {
|
||||
return false;
|
||||
}
|
||||
public boolean hasBanks()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name) {
|
||||
return this.iConomy.getBank().hasAccount(name);
|
||||
}
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return false;
|
||||
}
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return com.nijiko.coelho.iConomy.iConomy.getBank().hasAccount(name);
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name) {
|
||||
return new iCoAccount(this.iConomy.getBank().getAccount(name));
|
||||
}
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy") && plugin.getClass().getName().equals("com.nijiko.coelho.iConomy.iConomy") && plugin instanceof iConomy;
|
||||
}
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
return new iCoAccount(com.nijiko.coelho.iConomy.iConomy.getBank().getAccount(name));
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin) {
|
||||
iConomy = (iConomy)plugin;
|
||||
}
|
||||
|
||||
public class iCoAccount implements MethodAccount {
|
||||
private Account account;
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public iCoAccount(Account account) {
|
||||
this.account = account;
|
||||
}
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy")
|
||||
&& plugin.getClass().getName().equals("com.nijiko.coelho.iConomy.iConomy")
|
||||
&& plugin instanceof iConomy;
|
||||
}
|
||||
|
||||
public Account getiCoAccount() {
|
||||
return account;
|
||||
}
|
||||
public void setPlugin(Plugin plugin)
|
||||
{
|
||||
iConomy = (iConomy)plugin;
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return this.account.getBalance();
|
||||
}
|
||||
|
||||
public boolean set(double amount) {
|
||||
if(this.account == null) return false;
|
||||
this.account.setBalance(amount);
|
||||
return true;
|
||||
}
|
||||
public class iCoAccount implements MethodAccount
|
||||
{
|
||||
private Account account;
|
||||
|
||||
public boolean add(double amount) {
|
||||
if(this.account == null) return false;
|
||||
this.account.add(amount);
|
||||
return true;
|
||||
}
|
||||
public iCoAccount(Account account)
|
||||
{
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
if(this.account == null) return false;
|
||||
this.account.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
public Account getiCoAccount()
|
||||
{
|
||||
return account;
|
||||
}
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
if(this.account == null) return false;
|
||||
this.account.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return this.account.getBalance();
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
if(this.account == null) return false;
|
||||
this.account.divide(amount);
|
||||
return true;
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.setBalance(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return this.account.hasEnough(amount);
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.add(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return this.account.hasOver(amount);
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return this.account.isNegative();
|
||||
}
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.divide(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
if(this.account == null) return false;
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return this.account.hasEnough(amount);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return this.account.hasOver(amount);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
public boolean isNegative()
|
||||
{
|
||||
return this.account.isNegative();
|
||||
}
|
||||
|
||||
public boolean remove()
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import com.iConomy.iConomy;
|
||||
import com.iConomy.system.Account;
|
||||
import com.iConomy.system.BankAccount;
|
||||
import com.iConomy.system.Holdings;
|
||||
import com.iConomy.util.Constants;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@@ -37,9 +37,14 @@ public class iCo5 implements Method
|
||||
return "5";
|
||||
}
|
||||
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public String format(double amount)
|
||||
{
|
||||
return this.iConomy.format(amount);
|
||||
return com.iConomy.iConomy.format(amount);
|
||||
}
|
||||
|
||||
public boolean hasBanks()
|
||||
@@ -49,32 +54,34 @@ public class iCo5 implements Method
|
||||
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return (hasBanks()) && this.iConomy.Banks.exists(bank);
|
||||
return (hasBanks()) && com.iConomy.iConomy.Banks.exists(bank);
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return this.iConomy.hasAccount(name);
|
||||
return com.iConomy.iConomy.hasAccount(name);
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return (hasBank(bank)) && this.iConomy.getBank(bank).hasAccount(name);
|
||||
return (hasBank(bank)) && com.iConomy.iConomy.getBank(bank).hasAccount(name);
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
return new iCoAccount(this.iConomy.getAccount(name));
|
||||
return new iCoAccount(com.iConomy.iConomy.getAccount(name));
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
return new iCoBankAccount(this.iConomy.getBank(bank).getAccount(name));
|
||||
return new iCoBankAccount(com.iConomy.iConomy.getBank(bank).getAccount(name));
|
||||
}
|
||||
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy") && plugin.getClass().getName().equals("com.iConomy.iConomy") && plugin instanceof iConomy;
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy")
|
||||
&& plugin.getClass().getName().equals("com.iConomy.iConomy")
|
||||
&& plugin instanceof iConomy;
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin)
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import com.iCo6.iConomy;
|
||||
import com.iCo6.system.Account;
|
||||
import com.iCo6.system.Accounts;
|
||||
import com.iCo6.system.Holdings;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* iConomy 6 Implementation of Method
|
||||
*
|
||||
@@ -16,127 +17,177 @@ import org.bukkit.plugin.Plugin;
|
||||
* @copyright (c) 2011
|
||||
* @license AOL license <http://aol.nexua.org>
|
||||
*/
|
||||
public class iCo6 implements Method {
|
||||
private iConomy iConomy;
|
||||
public class iCo6 implements Method
|
||||
{
|
||||
private iConomy iConomy;
|
||||
|
||||
public iConomy getPlugin() {
|
||||
return this.iConomy;
|
||||
}
|
||||
public iConomy getPlugin()
|
||||
{
|
||||
return this.iConomy;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "iConomy";
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return "iConomy";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "6";
|
||||
}
|
||||
public String getVersion()
|
||||
{
|
||||
return "6";
|
||||
}
|
||||
|
||||
public String format(double amount) {
|
||||
return this.iConomy.format(amount);
|
||||
}
|
||||
public int fractionalDigits()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public boolean hasBanks() {
|
||||
return false;
|
||||
}
|
||||
public String format(double amount)
|
||||
{
|
||||
return com.iCo6.iConomy.format(amount);
|
||||
}
|
||||
|
||||
public boolean hasBank(String bank) {
|
||||
return false;
|
||||
}
|
||||
public boolean hasBanks()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name) {
|
||||
return (new Accounts()).exists(name);
|
||||
}
|
||||
public boolean hasBank(String bank)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return false;
|
||||
}
|
||||
public boolean hasAccount(String name)
|
||||
{
|
||||
return (new Accounts()).exists(name);
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name) {
|
||||
return new iCoAccount((new Accounts()).get(name));
|
||||
}
|
||||
public boolean hasBankAccount(String bank, String name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return null;
|
||||
}
|
||||
public MethodAccount getAccount(String name)
|
||||
{
|
||||
return new iCoAccount((new Accounts()).get(name));
|
||||
}
|
||||
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
try { Class.forName("com.iCo6.IO"); }
|
||||
catch(Exception e) { return false; }
|
||||
public MethodBankAccount getBankAccount(String bank, String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy") && plugin.getClass().getName().equals("com.iCo6.iConomy") && plugin instanceof iConomy;
|
||||
}
|
||||
public boolean isCompatible(Plugin plugin)
|
||||
{
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy")
|
||||
&& plugin.getClass().getName().equals("com.iCo6.iConomy")
|
||||
&& plugin instanceof iConomy;
|
||||
}
|
||||
|
||||
public void setPlugin(Plugin plugin) {
|
||||
iConomy = (iConomy)plugin;
|
||||
}
|
||||
public void setPlugin(Plugin plugin)
|
||||
{
|
||||
iConomy = (iConomy)plugin;
|
||||
}
|
||||
|
||||
public class iCoAccount implements MethodAccount {
|
||||
private Account account;
|
||||
private Holdings holdings;
|
||||
|
||||
public iCoAccount(Account account) {
|
||||
this.account = account;
|
||||
this.holdings = account.getHoldings();
|
||||
}
|
||||
public class iCoAccount implements MethodAccount
|
||||
{
|
||||
private Account account;
|
||||
private Holdings holdings;
|
||||
|
||||
public Account getiCoAccount() {
|
||||
return account;
|
||||
}
|
||||
public iCoAccount(Account account)
|
||||
{
|
||||
this.account = account;
|
||||
this.holdings = account.getHoldings();
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return this.holdings.getBalance();
|
||||
}
|
||||
public Account getiCoAccount()
|
||||
{
|
||||
return account;
|
||||
}
|
||||
|
||||
public boolean set(double amount) {
|
||||
if(this.holdings == null) return false;
|
||||
this.holdings.setBalance(amount);
|
||||
return true;
|
||||
}
|
||||
public double balance()
|
||||
{
|
||||
return this.holdings.getBalance();
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
if(this.holdings == null) return false;
|
||||
this.holdings.add(amount);
|
||||
return true;
|
||||
}
|
||||
public boolean set(double amount)
|
||||
{
|
||||
if (this.holdings == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.holdings.setBalance(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
if(this.holdings == null) return false;
|
||||
this.holdings.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
public boolean add(double amount)
|
||||
{
|
||||
if (this.holdings == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.holdings.add(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
if(this.holdings == null) return false;
|
||||
this.holdings.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
public boolean subtract(double amount)
|
||||
{
|
||||
if (this.holdings == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.holdings.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
if(this.holdings == null) return false;
|
||||
this.holdings.divide(amount);
|
||||
return true;
|
||||
}
|
||||
public boolean multiply(double amount)
|
||||
{
|
||||
if (this.holdings == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.holdings.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return this.holdings.hasEnough(amount);
|
||||
}
|
||||
public boolean divide(double amount)
|
||||
{
|
||||
if (this.holdings == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.holdings.divide(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return this.holdings.hasOver(amount);
|
||||
}
|
||||
public boolean hasEnough(double amount)
|
||||
{
|
||||
return this.holdings.hasEnough(amount);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return this.holdings.hasUnder(amount);
|
||||
}
|
||||
public boolean hasOver(double amount)
|
||||
{
|
||||
return this.holdings.hasOver(amount);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return this.holdings.isNegative();
|
||||
}
|
||||
public boolean hasUnder(double amount)
|
||||
{
|
||||
return this.holdings.hasUnder(amount);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
if(this.account == null) return false;
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public boolean isNegative()
|
||||
{
|
||||
return this.holdings.isNegative();
|
||||
}
|
||||
|
||||
public boolean remove()
|
||||
{
|
||||
if (this.account == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,6 @@ public class EssentialsSign
|
||||
{
|
||||
private static final Set<Material> EMPTY_SET = new HashSet<Material>();
|
||||
protected transient final String signName;
|
||||
//TODO: Add these settings to messages
|
||||
private static final String FORMAT_SUCCESS = "§1[%s]";
|
||||
private static final String FORMAT_TEMPLATE = "[%s]";
|
||||
private static final String FORMAT_FAIL = "§4[%s]";
|
||||
|
||||
public EssentialsSign(final String signName)
|
||||
{
|
||||
@@ -41,7 +37,7 @@ public class EssentialsSign
|
||||
// they won't change it to §1[Signname]
|
||||
return true;
|
||||
}
|
||||
sign.setLine(0, String.format(FORMAT_FAIL, this.signName));
|
||||
sign.setLine(0, Util.format("signFormatFail", this.signName));
|
||||
try
|
||||
{
|
||||
final boolean ret = onSignCreate(sign, user, getUsername(user), ess);
|
||||
@@ -65,12 +61,12 @@ public class EssentialsSign
|
||||
|
||||
public String getSuccessName()
|
||||
{
|
||||
return String.format(FORMAT_SUCCESS, this.signName);
|
||||
return Util.format("signFormatSuccess", this.signName);
|
||||
}
|
||||
|
||||
public String getTemplateName()
|
||||
{
|
||||
return String.format(FORMAT_TEMPLATE, this.signName);
|
||||
return Util.format("signFormatTemplate", this.signName);
|
||||
}
|
||||
|
||||
private String getUsername(final User user)
|
||||
@@ -181,6 +177,11 @@ public class EssentialsSign
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onBlockBreak(final Block block, final IEssentials ess)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onBlockExplode(final Block block, final IEssentials ess)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.earth2me.essentials.signs;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.entity.EndermanPickupEvent;
|
||||
import org.bukkit.event.entity.EndermanPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityListener;
|
||||
|
||||
@@ -40,4 +42,33 @@ public class SignEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndermanPickup(EndermanPickupEvent event)
|
||||
{
|
||||
if (event.isCancelled() || ess.getSettings().areSignsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Block block = event.getBlock();
|
||||
if (((block.getType() == Material.WALL_SIGN
|
||||
|| block.getType() == Material.SIGN_POST)
|
||||
&& EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block)))
|
||||
|| EssentialsSign.checkIfBlockBreaksSigns(block))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockBreak(block, ess))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,8 @@ public class SignHeal extends EssentialsSign
|
||||
final Trade charge = getTrade(sign, 1, ess);
|
||||
charge.isAffordableFor(player);
|
||||
player.setHealth(20);
|
||||
player.setFoodLevel(20);
|
||||
player.setFireTicks(0);
|
||||
player.sendMessage(Util.i18n("youAreHealed"));
|
||||
charge.charge(player);
|
||||
return true;
|
||||
|
||||
@@ -40,8 +40,7 @@ public class SignProtection extends EssentialsSign
|
||||
sign.setLine(3, "§1" + username);
|
||||
return true;
|
||||
}
|
||||
//TODO: move to messages
|
||||
player.sendMessage("§4You are not allowed to create sign here.");
|
||||
player.sendMessage(Util.i18n("signProtectInvalidLocation"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -184,11 +183,16 @@ public class SignProtection extends EssentialsSign
|
||||
SignProtectionState retstate = SignProtectionState.NOSIGN;
|
||||
for (SignProtectionState state : signs.values())
|
||||
{
|
||||
if (state == SignProtectionState.OWNER || state == SignProtectionState.ALLOWED)
|
||||
|
||||
if (state == SignProtectionState.OWNER)
|
||||
{
|
||||
return state;
|
||||
}
|
||||
if (state == SignProtectionState.NOT_ALLOWED)
|
||||
if (state == SignProtectionState.ALLOWED)
|
||||
{
|
||||
retstate = state;
|
||||
}
|
||||
else if (state == SignProtectionState.NOT_ALLOWED && retstate != SignProtectionState.ALLOWED)
|
||||
{
|
||||
retstate = state;
|
||||
}
|
||||
@@ -296,6 +300,14 @@ public class SignProtection extends EssentialsSign
|
||||
player.sendMessage(Util.format("noDestroyPermission", block.getType().toString().toLowerCase()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockBreak(final Block block, final IEssentials ess)
|
||||
{
|
||||
final SignProtectionState state = isBlockProtected(block, null, null, false);
|
||||
|
||||
return state == SignProtectionState.NOSIGN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockExplode(final Block block, final IEssentials ess)
|
||||
|
||||
@@ -79,14 +79,11 @@ reclaim-onlogout: false
|
||||
# Should primitive spawn protection be enabled? For most servers, this should be flase; it is better to use a third-party plugin to protect it.
|
||||
spawn-protection: false
|
||||
|
||||
# Nether settings (switch between worlds with "/world nether" and "/world normal")
|
||||
# Sets whether the nether system is enabled, what folder to save the world in, and whether portals should teleport players between worlds.
|
||||
# Nether settings
|
||||
# Sets wether you want to change the default behaviour of the nether portals.
|
||||
nether:
|
||||
enabled: false
|
||||
folder: nether
|
||||
portals-enabled: false
|
||||
generate-exit-portals: false
|
||||
ratio: 16
|
||||
|
||||
# Mob limit on spawnmob
|
||||
spawnmob-limit: 10
|
||||
@@ -401,6 +398,7 @@ protect:
|
||||
creeper-explosion: false
|
||||
creeper-playerdamage: false
|
||||
creeper-blockdamage: false
|
||||
enderman-pickup: false
|
||||
# Monsters won't follow players
|
||||
# permission essentials.protect.entitytarget.bypass disables this
|
||||
entitytarget: false
|
||||
@@ -421,6 +419,9 @@ protect:
|
||||
squid: false
|
||||
zombie: false
|
||||
wolf: false
|
||||
cave_spider: false
|
||||
enderman: false
|
||||
silverfish: false
|
||||
|
||||
# Maximum height the creeper should explode. -1 allows them to explode everywhere.
|
||||
# Set prevent.creeper-explosion to true, if you want to disable creeper explosions.
|
||||
|
||||
@@ -100,11 +100,11 @@ groups:
|
||||
- essentials.world
|
||||
Admin:
|
||||
# Since we use essentials.* permission here, we can still disable commands like this
|
||||
# This is only available for essentials permissions
|
||||
- -essentials.backup
|
||||
- -essentials.essentials
|
||||
- -essentials.setspawn
|
||||
- -essentials.reloadall
|
||||
# This can be done with any pemission nodes
|
||||
- ^essentials.backup
|
||||
- ^essentials.essentials
|
||||
- ^essentials.setspawn
|
||||
- ^essentials.reloadall
|
||||
- essentials.*
|
||||
Owner:
|
||||
- essentials.*
|
||||
|
||||
+139
-1
@@ -1,4 +1,5 @@
|
||||
#Last updated on 30/8/2011 21:30 (gmt -5) for minecraft version 1.7.3
|
||||
#version: TeamCity
|
||||
# If you change this file, it will not be automatically updated after the next release.
|
||||
#item,id,metadata
|
||||
stone,1,0
|
||||
sstone,1,0
|
||||
@@ -1251,6 +1252,92 @@ tdoor,96,0
|
||||
doort,96,0
|
||||
trapd,96,0
|
||||
dtrap,96,0
|
||||
silverstone,97,0
|
||||
silverfishstone,97,0
|
||||
silverfishs,97,0
|
||||
sfstone,97,0
|
||||
stonesilverfish,97,0
|
||||
fishstone,97,0
|
||||
trapstone,97,0
|
||||
stonebrick,98,0
|
||||
stonebricks,98,0
|
||||
stonebrickblock,98,0
|
||||
stonebb,98,0
|
||||
mossystonebrick,98,1
|
||||
mossystonebricks,98,1
|
||||
mossystonebrickblock,98,1
|
||||
mossystonebb,98,1
|
||||
crackedstonebrick,98,1
|
||||
crackedstonebricks,98,1
|
||||
crackedstonebrickblock,98,1
|
||||
crackedstonebb,98,1
|
||||
hugeredmushroom,99,0
|
||||
bigredmushroom,99,0
|
||||
brmushroom,99,0
|
||||
giantredmushroom,99,0
|
||||
grmushroom,99,0
|
||||
hugebrownmushroom,100,0
|
||||
bigbrownmushroom,100,0
|
||||
bbmushroom,100,0
|
||||
giantbrownmushroom,100,0
|
||||
gbmushroom,100,0
|
||||
ironbars,101,0
|
||||
ironbarsb,101,0
|
||||
ironbarsblock,101,0
|
||||
metalbarsblock,101,0
|
||||
metalbarsb,101,0
|
||||
metalbars,101,0
|
||||
jailbarsblock,101,0
|
||||
jailbarsb,101,0
|
||||
jailbars,101,0
|
||||
glasspane,102,0
|
||||
flatglass,102,0
|
||||
skinnyglass,102,0
|
||||
glassflat,102,0
|
||||
melon,103,0
|
||||
watermelon,103,0
|
||||
greenmelon,103,0
|
||||
melongreen,103,0
|
||||
melonblock,103,0
|
||||
watermelonblock,103,0
|
||||
greenmelonblock,103,0
|
||||
pumpkinstem,104,0
|
||||
stempumpkin,104,0
|
||||
pumpstem,104,0
|
||||
stempump,104,0
|
||||
melonstem,105,0
|
||||
watermelonstem,105,0
|
||||
greenmelonstem,105,0
|
||||
stemmelon,105,0
|
||||
stemwatermelon,105,0
|
||||
stemgreenmelon,105,0
|
||||
vines,106,0
|
||||
vine,106,0
|
||||
greenvines,106,0
|
||||
gardenvines,106,0
|
||||
vinesgreen,106,0
|
||||
fencegate,107,0
|
||||
woodenfence,107,0
|
||||
woodenfencegate,107,0
|
||||
gatefence,107,0
|
||||
woodengate,107,0
|
||||
woodgate,107,0
|
||||
gardengate,107,0
|
||||
brickstairs,108,0
|
||||
redbrickstairs,108,0
|
||||
bstairs,108,0
|
||||
stairsbrick,108,0
|
||||
brickstair,108,0
|
||||
redstairs,108,0
|
||||
stonebrickstairs,109,0
|
||||
stonebstairs,109,0
|
||||
sbstairs,109,0
|
||||
stairsstonebrick,109,0
|
||||
cementbrickstairs,109,0
|
||||
cementstairs,109,0
|
||||
cementbstairs,109,0
|
||||
greybrickstairs,109,0
|
||||
greybstairs,109,0
|
||||
ironshovel,256,0
|
||||
ironspade,256,0
|
||||
ishovel,256,0
|
||||
@@ -2070,6 +2157,57 @@ shears,359,0
|
||||
shear,359,0
|
||||
sheers,359,0
|
||||
sheer,359,0
|
||||
melonslice,360,0
|
||||
mslice,360,0
|
||||
slicemelon,360,0
|
||||
watermelonslice,360,0
|
||||
greenmelonslice,360,0
|
||||
melongreenslice,360,0
|
||||
pumpkinseeds,361,0
|
||||
pseeds,361,0
|
||||
seedsp,361,0
|
||||
seedspumpkin,361,0
|
||||
pumpseeds,361,0
|
||||
seedspump,361,0
|
||||
melonseeds,362,0
|
||||
mseeds,362,0
|
||||
watermelonseeds,362,0
|
||||
greenmelonseeds,362,0
|
||||
gmelonseeds,362,0
|
||||
seedsmelon,362,0
|
||||
seedswatermelon,362,0
|
||||
rawbeef,363,0
|
||||
rawsteak,363,0
|
||||
uncookedbeef,363,0
|
||||
uncookedsteak,363,0
|
||||
cowmeat,363,0
|
||||
plainbeef,363,0
|
||||
cookedbeef,364,0
|
||||
grilledbeef,364,0
|
||||
cookedsteak,364,0
|
||||
grilledsteak,364,0
|
||||
cookedcowmeat,364,0
|
||||
rawchicken,365,0
|
||||
uncookedchicken,365,0
|
||||
plainchicken,365,0
|
||||
chickenplain,365,0
|
||||
chickenuncooked,365,0
|
||||
chickenraw,365,0
|
||||
cookedchicken,366,0
|
||||
grilledchicken,366,0
|
||||
toastedchicken,366,0
|
||||
rottenflesh,367,0
|
||||
zombieflesh,367,0
|
||||
rottenmeat,367,0
|
||||
zombiemeat,367,0
|
||||
badflesh,367,0
|
||||
poisenflesh,367,0
|
||||
zombieremains,367,0
|
||||
enderpearl,368,0
|
||||
pearl,368,0
|
||||
epearl,368,0
|
||||
bluepearl,368,0
|
||||
endergem,368,0
|
||||
goldmusicrecord,2256,0
|
||||
goldmusicdisk,2256,0
|
||||
goldmusiccd,2256,0
|
||||
|
||||
|
@@ -54,7 +54,7 @@ deleteJail = \u00a77Jail {0} has been removed.
|
||||
deleteWarp = \u00a77Warp {0} has been removed.
|
||||
deniedAccessCommand = {0} was denied access to command.
|
||||
dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
|
||||
dependancyException = [Essentials] An error occured when trying to download a dependacy
|
||||
dependancyException = [Essentials] An error occurred when trying to download a dependacy
|
||||
dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
|
||||
depth = \u00a77You are at sea level.
|
||||
depthAboveSea = \u00a77You are {0} block(s) above sea level.
|
||||
@@ -131,8 +131,12 @@ itemSold = \u00a77Sold for \u00a7c {0} \u00a77 ({1} items at {2} each)
|
||||
itemSoldConsole = {0} sold {1} for \u00a77 {2} \u00a77 ({3} items at {4} each)
|
||||
itemSpawn = \u00a77Giving {0} of {1}
|
||||
itemsCsvNotLoaded = Could not load items.csv.
|
||||
jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
|
||||
jailMessage = \u00a7cYou do the crime, you do the time.
|
||||
jailNotExist = That jail does not exist.
|
||||
jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
|
||||
jailReleasedPlayerNotify = \u00a77You have been released!
|
||||
jailSentenceExtended = Jail time extend to: {0)
|
||||
jailSet = \u00a77Jail {0} has been set
|
||||
jumpError = That would hurt your computer''s brain.
|
||||
kickDefault = Kicked from server
|
||||
@@ -163,10 +167,11 @@ minute = minute
|
||||
minutes = minutes
|
||||
missingItems = You do not have {0}x {1}.
|
||||
missingPrefixSuffix = Missing a prefix or suffix for {0}
|
||||
mobsAvailable = \u00a77Mobs: {0}
|
||||
mobSpawnError = Error while changing mob spawner.
|
||||
mobSpawnLimit = Mob quantity limited to server limit
|
||||
mobSpawnTarget = Target block must be a mob spawner.
|
||||
moneyRecievedFrom = \u00a7a{0} has been recieved from {1}
|
||||
moneyRecievedFrom = \u00a7a{0} has been received from {1}
|
||||
moneySentTo = \u00a7a{0} has been sent to {1}
|
||||
moneyTaken = {0} taken from your bank account.
|
||||
month = month
|
||||
@@ -199,6 +204,7 @@ noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c p
|
||||
noMotd = \u00a7cThere is no message of the day.
|
||||
noNewMail = \u00a77You have no new mail.
|
||||
noPendingRequest = You do not have a pending request.
|
||||
noPowerTools = You have no power tools assigned.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
noRules = \u00a7cThere are no rules specified yet.
|
||||
noWarpsDefined = No warps defined
|
||||
@@ -239,11 +245,14 @@ possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
|
||||
powerToolAir = Command can''t be attached to air.
|
||||
powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
|
||||
powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
|
||||
powerToolClearAll = All powertool commands have been cleared.
|
||||
powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} has no commands assigned.
|
||||
powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
|
||||
powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
|
||||
powerToolRemoveAll = All commands removed from {0}.
|
||||
powerToolsEnabled = All of your power tools have been enabled.
|
||||
powerToolsDisabled = All of your power tools have been disabled.
|
||||
protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
|
||||
questionFormat = \u00a77[Question]\u00a7f {0}
|
||||
reloadAllPlugins = \u00a77Reloaded all plugins.
|
||||
@@ -256,7 +265,7 @@ requestAcceptedFrom = \u00a77{0} accepted your teleport request.
|
||||
requestDenied = \u00a77Teleport request denied.
|
||||
requestDeniedFrom = \u00a77{0} denied your teleport request.
|
||||
requestSent = \u00a77Request sent to {0}\u00a77.
|
||||
returnPlayerToJailError = Error occured when trying to return player to jail.
|
||||
returnPlayerToJailError = Error occurred when trying to return player to jail.
|
||||
second = second
|
||||
seconds = seconds
|
||||
seenOffline = Player {0} is offline since {1}
|
||||
@@ -265,6 +274,10 @@ serverFull = Server is full
|
||||
setSpawner = Changed spawner type to {0}
|
||||
sheepMalformedColor = Malformed color.
|
||||
shoutFormat = \u00a77[Shout]\u00a7f {0}
|
||||
signFormatFail = \u00a74[{0}]
|
||||
signFormatSuccess = \u00a71[{0}]
|
||||
signFormatTemplate = [{0}]
|
||||
signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
|
||||
similarWarpExist = A warp with a similar name already exists.
|
||||
slimeMalformedSize = Malformed size.
|
||||
soloMob = That mob likes to be alone
|
||||
|
||||
@@ -131,8 +131,12 @@ itemSold = \u00a77Solgte for \u00a7c {0} \u00a77 ({1} elementer for {2} hver)
|
||||
itemSoldConsole = {0} solgte {1} for \u00a77 {2} \u00a77 ({3} elementer for {4} hver)
|
||||
itemSpawn = \u00a77Giver {0} af {1}
|
||||
itemsCsvNotLoaded = Kunne ikke indl\u00e6se items.csv.
|
||||
jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
|
||||
jailMessage = \u00a7cBryd reglerne, og tag din straf.
|
||||
jailNotExist = Det f\u00e6ngsel eksisterer ikke.
|
||||
jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
|
||||
jailReleasedPlayerNotify = \u00a77You have been released!
|
||||
jailSentenceExtended = Jail time extend to: {0)
|
||||
jailSet = \u00a77F\u00e6ngsel {0} er blevet sat
|
||||
jumpError = Det ville skade din computer''s hjerne.
|
||||
kickDefault = Kicket fra serveren
|
||||
@@ -200,6 +204,7 @@ noMotd = \u00a7cDer er ikke nogen besked for dagen.
|
||||
noNewMail = \u00a77Du har ingen ny post.
|
||||
noPendingRequest = Du har ikke en ventende anmodning.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
noPowerTools= You have no power tools assigned.
|
||||
noRules = \u00a7cDer er ingen regler fastsat endnu.
|
||||
noWarpsDefined = Ingen warps defineret
|
||||
none = ingen
|
||||
@@ -239,11 +244,14 @@ possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}.
|
||||
powerToolAir = Kommando kan ikke blive tildelt luft.
|
||||
powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
|
||||
powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
|
||||
powerToolClearAll = All powertool commands have been cleared.
|
||||
powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} has no commands assigned.
|
||||
powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
|
||||
powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
|
||||
powerToolRemoveAll = All commands removed from {0}.
|
||||
powerToolsEnabled= All of your power tools have been enabled.
|
||||
powerToolsDisabled= All of your power tools have been disabled.
|
||||
protectionOwner = \u00a76[EssentialsProtect] Beskyttelses ejer: {0}
|
||||
questionFormat = \u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
|
||||
reloadAllPlugins = \u00a77Genindl\u00e6ste alle tilf\u00f8jelser.
|
||||
@@ -265,6 +273,10 @@ serverFull = Server er fuld
|
||||
setSpawner = Changed spawner type to {0}
|
||||
sheepMalformedColor = Misdannet farve.
|
||||
shoutFormat = \u00a77[R\u00e5b]\u00a7f {0}
|
||||
signFormatFail = \u00a74[{0}]
|
||||
signFormatSuccess = \u00a71[{0}]
|
||||
signFormatTemplate = [{0}]
|
||||
signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
|
||||
similarWarpExist = En warp med lignende tekst eksisterer allerede.
|
||||
slimeMalformedSize = Misdannet st\u00f8rrelse.
|
||||
soloMob = Den mob kan godt lide at v\u00e6re alene
|
||||
@@ -357,3 +369,5 @@ year = \u00e5r
|
||||
years = \u00e5r
|
||||
youAreHealed = \u00a77Du er blevet helbredt.
|
||||
youHaveNewMail = \u00a7cDu har {0} beskeder!\u00a7f Type \u00a77/post l\u00e6s\u00a7f for at se din post.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ alertBroke = zerst\u00f6rt:
|
||||
alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3}
|
||||
alertPlaced = platziert:
|
||||
alertUsed = benutzt:
|
||||
autoAfkKickReason=You have been kicked for idling more than {0} minutes.
|
||||
autoAfkKickReason = Du wurdest gekickt, weil du f\u00fcr {0} Minuten inaktiv warst.
|
||||
backAfterDeath = \u00a77Benutze den Befehl /back um zu deinem Todespunkt zur\u00fcck zu kehren.
|
||||
backUsageMsg = \u00a77Kehre zur letzten Position zur\u00fcck.
|
||||
backupFinished = Backup beendet
|
||||
@@ -47,9 +47,9 @@ creatingEmptyConfig = Erstelle leere Konfiguration: {0}
|
||||
creatingPortal = Erzeuge Portal bei {0},{1},{2}.
|
||||
day = Tag
|
||||
days = Tage
|
||||
defaultBanReason = Der Bann-Hammer hat gesprochen!
|
||||
defaultBanReason = Der Bann-Hammer hat gesprochen!
|
||||
deleteFileError = Konnte Datei nicht l\u00f6schen: {0}
|
||||
deleteHome = \u00a77Home {0} has been removed.
|
||||
deleteHome = \u00a77Zuhause {0} wurde gel\u00f6scht.
|
||||
deleteJail = \u00a77Gef\u00e4ngnis {0} wurde gel\u00f6scht.
|
||||
deleteWarp = \u00a77Warp-Punkt {0} wurde gel\u00f6scht.
|
||||
deniedAccessCommand = {0} hat keinen Zugriff auf diesen Befehl.
|
||||
@@ -131,8 +131,12 @@ itemSold = \u00a77Verkauft f\u00fcr \u00a7c{0}\u00a77 ({1} Einheiten je {2})
|
||||
itemSoldConsole = {0} verkauft {1} f\u00fcr \u00a77{2}\u00a77 ({3} Einheiten je {4})
|
||||
itemSpawn = \u00a77Gebe {0}x {1}
|
||||
itemsCsvNotLoaded = Konnte items.csv nicht laden.
|
||||
jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
|
||||
jailMessage = \u00a7cYou do the crime, you do the time.
|
||||
jailNotExist = Dieses Gef\u00e4ngnis existiert nicht.
|
||||
jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
|
||||
jailReleasedPlayerNotify = \u00a77You have been released!
|
||||
jailSentenceExtended = Jail time extend to: {0)
|
||||
jailSet = \u00a77Gef\u00e4ngnis {0} wurde erstellt.
|
||||
jumpError = Das w\u00fcrde deinen Computer \u00fcberlasten.
|
||||
kickDefault = Vom Server geworfen
|
||||
@@ -156,7 +160,7 @@ mailSent = \u00a77Nachricht gesendet!
|
||||
markMailAsRead = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
|
||||
markedAsAway = \u00a77Du wirst als abwesend angezeigt.
|
||||
markedAsNotAway = \u00a77Du wirst nicht mehr als abwesend angezeigt.
|
||||
maxHomes=You cannot set more than {0} homes.
|
||||
maxHomes = Du kannst nicht mehr als {0} Zuhause setzen.
|
||||
mayNotJail = \u00a7cDu kannst diese Person nicht einsperren.
|
||||
me = mir
|
||||
minute = Minute
|
||||
@@ -176,11 +180,11 @@ msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cDu darfst diesen Spieler nicht stumm machen.
|
||||
mutedPlayer = Player {0} ist nun stumm.
|
||||
mutedPlayerFor = Player {0} ist nun stumm f\u00fcr {1}.
|
||||
mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschalt.
|
||||
mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschaltet.
|
||||
needTpohere = Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen.
|
||||
negativeBalanceError = Spieler darf keine Schulden machen.
|
||||
nickChanged = Nickname ge\u00e4ndert.
|
||||
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
||||
nickDisplayName=\u00a77Du musst \u00a7fchange-displayname\u00a7c in der Essentials-Config aktivieren.
|
||||
nickInUse = \u00a7cDieser Name wird bereits verwendet.
|
||||
nickNamesAlpha = \u00a7cNicknamen d\u00fcrfen nur alphanumerische Zeichen enthalten.
|
||||
nickNoMore = \u00a7Du hast keinen Nicknamen mehr.
|
||||
@@ -200,6 +204,7 @@ noMotd = \u00a7cEs existiert keine Willkommensnachricht.
|
||||
noNewMail = \u00a77Du hast keine Nachrichten.
|
||||
noPendingRequest = Du hast keine Teleportierungsanfragen.
|
||||
noPlacePermission = \u00a7cDu hast keine Rechte, einen Block in der N\u00e4he des Schildes zu platzieren.
|
||||
noPowerTools=You have no power tools assigned.
|
||||
noRules = \u00a7cEs wurden keine Regeln definiert.
|
||||
noWarpsDefined = Keine Warp-Punkte erstellt.
|
||||
none = keine
|
||||
@@ -214,12 +219,12 @@ onlyDayNight = /time unterst\u00fctzt nur day und night.
|
||||
onlyPlayers = Nur Spieler k\u00f6nnen {0} benutzen.
|
||||
onlySunStorm = /weather unterst\u00fctzt nur sun und storm.
|
||||
pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
|
||||
pTimeCurrentFixed = \u00a7e{0}''s\u00a7f time is fixed to {1}.
|
||||
pTimeNormal = \u00a7e{0}''s\u00a7f time is normal and matches the server.
|
||||
pTimeOthersPermission = \u00a7cYou are not authorized to set other players'' time.
|
||||
pTimePlayers = These players have their own time:
|
||||
pTimeReset = Player time has been reset for: \u00a7e{0}
|
||||
pTimeSet = Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
|
||||
pTimeCurrentFixed = \u00a7e{0}''s\u00a7f Zeit wurde zu {1} gesetzt.
|
||||
pTimeNormal = \u00a7e{0}''s\u00a7f Zeit ist normal und entspricht der Serverzeit.
|
||||
pTimeOthersPermission = \u00a7cDu hast keine Berechtigung die Zeit von anderen Spielern zu \u00e4ndern.
|
||||
pTimePlayers = Diese Spieler haben ihre eigene Zeit:
|
||||
pTimeReset = Zeit wurde zur\u00fcgesetzt f\u00fcr: \u00a7e{0}
|
||||
pTimeSet = Zeit wurde f\u00fcr \u00a7e{1}\u00a7f zu \u00a73{0}\u00a7f gesetzt.
|
||||
pTimeSetFixed = Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
|
||||
parseError = Fehler beim Parsen von {0} in Zeile {1}
|
||||
pendingTeleportCancelled = \u00a7cLaufende Teleportierung abgebrochen.
|
||||
@@ -237,24 +242,26 @@ playerUnmuted = \u00a77Du bist nicht mehr stumm.
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
|
||||
powerToolAir = Befehl kann nicht mit Luft verbunden werden.
|
||||
powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
|
||||
powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
|
||||
powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} has no commands assigned.
|
||||
powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
|
||||
powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
|
||||
powerToolRemoveAll = All commands removed from {0}.
|
||||
powerToolAlreadySet = Befehl \u00a7c{0}\u00a7f ist bereits zu {1} hinzugef\u00fcgt.
|
||||
powerToolAttach = Befehl \u00a7c{0}\u00a7f erfolgreich zu {1} hinzugef\u00fcgt.
|
||||
powerToolList = {1} hat die folgenden Befehle: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} hat keinen Befehl.
|
||||
powerToolNoSuchCommandAssigned = Befehl \u00a7c{0}\u00a7f wurde nicht zu {1} hinzugef\u00fcgt.
|
||||
powerToolRemove = Befehl \u00a7c{0}\u00a7f erfolgreich von {1} entfernt.
|
||||
powerToolRemoveAll = Alle Befehle von {0} entfernt.
|
||||
powerToolsEnabled=All of your power tools have been enabled.
|
||||
powerToolsDisabled=All of your power tools have been disabled.
|
||||
protectionOwner = \u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
|
||||
questionFormat = \u00a77[Frage]\u00a7f {0}
|
||||
reloadAllPlugins = \u00a77Alle plugins neu geladen.
|
||||
repair = You have successfully repaired your: \u00a7e{0}.
|
||||
repairAlreadyFixed = \u00a77This item does not need repairing.
|
||||
repairInvalidType = \u00a7cThis item cannot be repaired.
|
||||
repairNone = There were no items that needing repairing.
|
||||
repair = Du hast erfolgreich deine {0} repariert.
|
||||
repairAlreadyFixed = \u00a77Dieser Gegenstand ben\u00f6tigt keine Reparatur.
|
||||
repairInvalidType = \u00a7cDieser Gegenstand kann nicht repariert werden.
|
||||
repairNone = Es sind keine Gegenst\u00e4nde vorhanden, die repariert werden k\u00f6nnen.
|
||||
requestAccepted = \u00a77Teleportierungsanfrage akzeptiert.
|
||||
requestAcceptedFrom = \u00a77{0} accepted your teleport request.
|
||||
requestAcceptedFrom = \u00a77{0} hat deine Teleportierungsanfrage angenommen.
|
||||
requestDenied = \u00a77Teleportierungsanfrage verweigert.
|
||||
requestDeniedFrom = \u00a77{0} denied your teleport request.
|
||||
requestDeniedFrom = \u00a77{0} hat deine Teleportierungsanfrage abgelehnt.
|
||||
requestSent = \u00a77Anfrage gesendet an {0}\u00a77.
|
||||
returnPlayerToJailError = Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
|
||||
second = Sekunde
|
||||
@@ -262,9 +269,13 @@ seconds = Sekunden
|
||||
seenOffline = Spieler {0} ist offline seit {1}
|
||||
seenOnline = Spieler {0} ist online seit {1}
|
||||
serverFull = Server ist voll
|
||||
setSpawner = Changed spawner type to {0}
|
||||
setSpawner = \u00c4ndere Mob-Spawner zu {0}
|
||||
sheepMalformedColor = Ung\u00fcltige Farbe.
|
||||
shoutFormat = \u00a77[Schrei]\u00a7f {0}
|
||||
signFormatFail = \u00a74[{0}]
|
||||
signFormatSuccess = \u00a71[{0}]
|
||||
signFormatTemplate = [{0}]
|
||||
signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
|
||||
similarWarpExist = Ein Warp-Punkt mit einem \u00e4hnlichen Namen existiert bereits.
|
||||
slimeMalformedSize = Ung\u00fcltige Gr\u00f6sse.
|
||||
soloMob = Das Monster m\u00f6chte allein sein.
|
||||
@@ -274,7 +285,7 @@ suicideMessage = \u00a77Lebewohl grausame Welt...
|
||||
suicideSuccess = \u00a77{0} hat sich das Leben genommen.
|
||||
takenFromAccount = \u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen.
|
||||
takenFromOthersAccount = \u00a7c{0} wurde von {1} wurde Rechnung getragen.
|
||||
teleportAAll = \u00a77Teleporting request sent to all players...
|
||||
teleportAAll = \u00a77Teleportierungsanfrage zu allen Spielern gesendet...
|
||||
teleportAll = \u00a77Teleportiere alle Spieler...
|
||||
teleportAtoB = \u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77.
|
||||
teleportDisabled = {0} verweigert die Teleportierung.
|
||||
@@ -282,7 +293,7 @@ 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.
|
||||
teleportTop = \u00a77Teleportiere nach oben.
|
||||
teleportationCommencing = \u00a77Teleportierung started...
|
||||
teleportationCommencing = \u00a77Teleportierung gestartet...
|
||||
teleportationDisabled = \u00a77Teleportierung deaktiviert.
|
||||
teleportationEnabled = \u00a77Teleportierung aktiviert.
|
||||
teleporting = \u00a77Teleportiere...
|
||||
@@ -293,15 +304,15 @@ thunder = Es donnert nun in deiner Welt {0}.
|
||||
thunderDuration = Es donnert nun f\u00fcr {1} Sekunden in deiner Welt {0}.
|
||||
timeBeforeHeal = Zeit bis zur n\u00e4chsten Heilung: {0}
|
||||
timeBeforeTeleport = Zeit bis zum n\u00e4chsten Teleport: {0}
|
||||
timeFormat = \u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
|
||||
timeFormat = \u00a73{0}\u00a7f oder \u00a73{1}\u00a7f oder \u00a73{2}\u00a7f
|
||||
timePattern = (?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[dt][a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:h|st)[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
|
||||
timeSet = Zeit in allen Welten gesetzt.
|
||||
timeSetPermission = \u00a7cYou are not authorized to set the time.
|
||||
timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
timeSetPermission = \u00a7cDu hast keine Berechtigung die Zeit zu \u00e4ndern.
|
||||
timeWorldCurrent = Die momentane Zeit in {0} ist \u00a73{1}
|
||||
timeWorldSet = Die Zeit in \u00a7c{1}\u00a7f wurde zu {0} gesetzt.
|
||||
tradeCompleted = \u00a77Handel abgeschlossen.
|
||||
tradeSignEmpty = Der Bestand des Trade-Schild ist aufgebraucht.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
tradeSignEmptyOwner = Es gibt nichts mehr zu Sammeln von diesem Trade-Schild.
|
||||
treeFailure = \u00a7cBaumpflanzung gescheitert. Versuche es auf Gras oder Dreck.
|
||||
treeSpawned = \u00a77Baum gepflanzt.
|
||||
typeTpaccept = \u00a77Um zu teleportieren, schreibe \u00a7c/tpaccept\u00a77.
|
||||
@@ -337,7 +348,7 @@ warpNotExist = Warp-Punkt existiert nicht.
|
||||
warpSet = \u00a77Warp-Punkt {0} wurde erstellt.
|
||||
warpUsePermission = \u00a7cDu hast keinen Zugriff f\u00fcr diesen Warp-Punkt.
|
||||
warpingTo = \u00a77Teleportiere zu Warp-Punkt {0}.
|
||||
warpsCount = \u00a77There are {0} warps. Showing page {1} of {2}.
|
||||
warpsCount = \u00a77Es gibt {0} Warp-Punkte. Zeige Seite {1} von {2}.
|
||||
weatherStorm = \u00a77In deiner Welt st\u00fcrmt es nun.
|
||||
weatherStormFor = \u00a77In deiner Welt st\u00fcrmt es nun f\u00fcr {0} Sekunden.
|
||||
weatherSun = \u00a77In deiner Welt scheint nun die Sonne.
|
||||
@@ -357,3 +368,6 @@ year = Jahr
|
||||
years = Jahre
|
||||
youAreHealed = \u00a77Du wurdest geheilt.
|
||||
youHaveNewMail = \u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
|
||||
powerToolClearAll= All powertool commands have been cleared.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ deleteJail = \u00a77Jail {0} has been removed.
|
||||
deleteWarp = \u00a77Warp {0} has been removed.
|
||||
deniedAccessCommand = {0} was denied access to command.
|
||||
dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
|
||||
dependancyException = [Essentials] An error occured when trying to download a dependacy
|
||||
dependancyException = [Essentials] An error occurred when trying to download a dependacy
|
||||
dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
|
||||
depth = \u00a77You are at sea level.
|
||||
depthAboveSea = \u00a77You are {0} block(s) above sea level.
|
||||
@@ -131,8 +131,12 @@ itemSold = \u00a77Sold for \u00a7c {0} \u00a77 ({1} items at {2} each)
|
||||
itemSoldConsole = {0} sold {1} for \u00a77 {2} \u00a77 ({3} items at {4} each)
|
||||
itemSpawn = \u00a77Giving {0} of {1}
|
||||
itemsCsvNotLoaded = Could not load items.csv.
|
||||
jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
|
||||
jailMessage = \u00a7cYou do the crime, you do the time.
|
||||
jailNotExist = That jail does not exist.
|
||||
jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
|
||||
jailReleasedPlayerNotify = \u00a77You have been released!
|
||||
jailSentenceExtended = Jail time extend to: {0)
|
||||
jailSet = \u00a77Jail {0} has been set
|
||||
jumpError = That would hurt your computer''s brain.
|
||||
kickDefault = Kicked from server
|
||||
@@ -166,7 +170,7 @@ missingPrefixSuffix = Missing a prefix or suffix for {0}
|
||||
mobSpawnError = Error while changing mob spawner.
|
||||
mobSpawnLimit = Mob quantity limited to server limit
|
||||
mobSpawnTarget = Target block must be a mob spawner.
|
||||
moneyRecievedFrom = \u00a7a{0} has been recieved from {1}
|
||||
moneyRecievedFrom = \u00a7a{0} has been received from {1}
|
||||
moneySentTo = \u00a7a{0} has been sent to {1}
|
||||
moneyTaken = {0} taken from your bank account.
|
||||
month = month
|
||||
@@ -200,6 +204,7 @@ noMotd = \u00a7cThere is no message of the day.
|
||||
noNewMail = \u00a77You have no new mail.
|
||||
noPendingRequest = You do not have a pending request.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
noPowerTools=You have no power tools assigned.
|
||||
noRules = \u00a7cThere are no rules specified yet.
|
||||
noWarpsDefined = No warps defined
|
||||
none = none
|
||||
@@ -239,11 +244,14 @@ possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
|
||||
powerToolAir = Command can''t be attached to air.
|
||||
powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
|
||||
powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
|
||||
powerToolClearAll = All powertool commands have been cleared.
|
||||
powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} has no commands assigned.
|
||||
powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
|
||||
powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
|
||||
powerToolRemoveAll = All commands removed from {0}.
|
||||
powerToolsEnabled=All of your power tools have been enabled.
|
||||
powerToolsDisabled=All of your power tools have been enabled.
|
||||
protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
|
||||
questionFormat = \u00a77[Question]\u00a7f {0}
|
||||
reloadAllPlugins = \u00a77Reloaded all plugins.
|
||||
@@ -256,7 +264,7 @@ requestAcceptedFrom = \u00a77{0} accepted your teleport request.
|
||||
requestDenied = \u00a77Teleport request denied.
|
||||
requestDeniedFrom = \u00a77{0} denied your teleport request
|
||||
requestSent = \u00a77Request sent to {0}\u00a77.
|
||||
returnPlayerToJailError = Error occured when trying to return player to jail.
|
||||
returnPlayerToJailError = Error occurred when trying to return player to jail.
|
||||
second = second
|
||||
seconds = seconds
|
||||
seenOffline = Player {0} is offline since {1}
|
||||
@@ -265,6 +273,10 @@ serverFull = Server is full
|
||||
setSpawner = Changed spawner type to {0}
|
||||
sheepMalformedColor = Malformed color.
|
||||
shoutFormat = \u00a77[Shout]\u00a7f {0}
|
||||
signFormatFail = \u00a74[{0}]
|
||||
signFormatSuccess = \u00a71[{0}]
|
||||
signFormatTemplate = [{0}]
|
||||
signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
|
||||
similarWarpExist = A warp with a similar name already exists.
|
||||
slimeMalformedSize = Malformed size.
|
||||
soloMob = That mob likes to be alone
|
||||
@@ -357,3 +369,5 @@ year = year
|
||||
years = years
|
||||
youAreHealed = \u00a77You have been healed.
|
||||
youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
|
||||
|
||||
|
||||
@@ -131,8 +131,12 @@ itemSold = \u00a77Vendu pour \u00a7c {0} \u00a77 ({1} objet(s) \u00e0 {2} 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.
|
||||
jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
|
||||
jailMessage = \u00a7cVous avez commis un crime, vous en payez le prix.
|
||||
jailNotExist = Cette prison n''existe pas.
|
||||
jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
|
||||
jailReleasedPlayerNotify = \u00a77You have been released!
|
||||
jailSentenceExtended = Jail time extend to: {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
|
||||
@@ -200,6 +204,7 @@ 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.
|
||||
noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
|
||||
noPowerTools=You have no power tools assigned.
|
||||
noRules = \u00a7cIl n''y a pas encore de r\u00e8gles d\u00e9finies.
|
||||
noWarpsDefined = Aucun warps d\u00e9finis.
|
||||
none = aucun
|
||||
@@ -239,11 +244,14 @@ possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}.
|
||||
powerToolAir = La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air.
|
||||
powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
|
||||
powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
|
||||
powerToolClearAll = All powertool commands have been cleared.
|
||||
powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} has no commands assigned.
|
||||
powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
|
||||
powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
|
||||
powerToolRemoveAll = All commands removed from {0}.
|
||||
powerToolsEnabled=All of your power tools have been enabled.
|
||||
powerToolsDisabled=All of your power tools have been disabled.
|
||||
protectionOwner = \u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
|
||||
questionFormat = \u00a77[Question]\u00a7f {0}
|
||||
reloadAllPlugins = \u00a77Tous les plugins ont \u00e9t\u00e9 recharg\u00e9s.
|
||||
@@ -265,6 +273,10 @@ serverFull = Le serveur est plein.
|
||||
setSpawner = Changed spawner type to {0}
|
||||
sheepMalformedColor = Couleur mal form\u00e9e.
|
||||
shoutFormat = \u00a77[Crie]\u00a7f {0}
|
||||
signFormatFail = \u00a74[{0}]
|
||||
signFormatSuccess = \u00a71[{0}]
|
||||
signFormatTemplate = [{0}]
|
||||
signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
|
||||
similarWarpExist = Un warp avec un nom similaire existe d\u00e9j\u00e0.
|
||||
slimeMalformedSize = Taille mal form\u00e9e.
|
||||
soloMob = Ce monstre aime \u00eatre seul.
|
||||
@@ -357,3 +369,5 @@ 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.
|
||||
|
||||
|
||||
@@ -131,8 +131,12 @@ itemSold = \u00a77Verkocht voor \u00a7c {0} \u00a77 ({1} voorwerpen voor {2} per
|
||||
itemSoldConsole = {0} verkocht {1} voor \u00a77 {2} \u00a77 ({3} voorwerpen voor {4} per stuk)
|
||||
itemSpawn = \u00a77Geeft {0} {1}
|
||||
itemsCsvNotLoaded = De item kunnen niet geladen worden.csv.
|
||||
jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
|
||||
jailMessage = \u00a7cYou do the crime, you do the time.
|
||||
jailNotExist = Die gevangenis bestaat niet.
|
||||
jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
|
||||
jailReleasedPlayerNotify = \u00a77You have been released!
|
||||
jailSentenceExtended = Jail time extend to: {0)
|
||||
jailSet = \u00a77Gevangenis {0} is ingesteld
|
||||
jumpError = Dat zou je computers hersenen beschadigen.
|
||||
kickDefault = Gekicked van de server
|
||||
@@ -200,6 +204,7 @@ noMotd = \u00a7cEr is geen bericht van de dag.
|
||||
noNewMail = \u00a77Je hebt geen nieuwe berichten.
|
||||
noPendingRequest = Je hebt geen aanvragen.
|
||||
noPlacePermission = \u00a7cJe hebt geen toestemming om een blok naast die sign te plaatsen.
|
||||
noPowerTools=You have no power tools assigned.
|
||||
noRules = \u00a7cEr zijn nog geen regels gegeven.
|
||||
noWarpsDefined = Geen warps gedefinieerd
|
||||
none = geen
|
||||
@@ -239,11 +244,14 @@ possibleWorlds = \u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}.
|
||||
powerToolAir = Command kan niet worden bevestigd aan lucht.
|
||||
powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
|
||||
powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
|
||||
powerToolClearAll = All powertool commands have been cleared.
|
||||
powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
|
||||
powerToolListEmpty = {0} has no commands assigned.
|
||||
powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
|
||||
powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
|
||||
powerToolRemoveAll = All commands removed from {0}.
|
||||
powerToolsEnabled=All of your power tools have been enabled.
|
||||
powerToolsDisabled=All of your power tools have been disabled.
|
||||
protectionOwner = \u00a76[EssentialsProtect] Beschermingeigenaar: {0}
|
||||
questionFormat = \u00a77[Vraag]\u00a7f {0}
|
||||
reloadAllPlugins = \u00a77Alle plugins zijn herladen.
|
||||
@@ -265,6 +273,10 @@ serverFull = Server is vol
|
||||
setSpawner = Changed spawner type to {0}
|
||||
sheepMalformedColor = Misvoormde kleur.
|
||||
shoutFormat = \u00a77[Shout]\u00a7f {0}
|
||||
signFormatFail = \u00a74[{0}]
|
||||
signFormatSuccess = \u00a71[{0}]
|
||||
signFormatTemplate = [{0}]
|
||||
signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
|
||||
similarWarpExist = Er bestaat al een warp met dezelfde naam.
|
||||
slimeMalformedSize = Misvoormde grootte.
|
||||
soloMob = Die mob is liever in zijn eentje
|
||||
@@ -357,3 +369,5 @@ year = jaar
|
||||
years = jaren
|
||||
youAreHealed = \u00a77Je bent genezen.
|
||||
youHaveNewMail = \u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ commands:
|
||||
aliases: [ecompass]
|
||||
delhome:
|
||||
description: Removes a home
|
||||
usage: /<command> [player] <name>
|
||||
usage: /<command> [player:]<name>
|
||||
aliases: [edelhome,remhome,rmhome,eremhome,ermhome]
|
||||
deljail:
|
||||
description: Removes a jail
|
||||
@@ -120,7 +120,7 @@ commands:
|
||||
aliases: [ehelpop]
|
||||
home:
|
||||
description: Teleport to your home.
|
||||
usage: /<command> <player>
|
||||
usage: /<command> [player:][name]
|
||||
aliases: [ehome]
|
||||
ignore:
|
||||
description: Ignore other players.
|
||||
@@ -210,6 +210,10 @@ commands:
|
||||
description: Assigns a command to the item in hand, {player} will be replaced by the name of the player that you click.
|
||||
usage: /<command> [l:|a:|r:][command] <arguments>
|
||||
aliases: [pt,epowertool,ept]
|
||||
powertooltoggle:
|
||||
description: Enables or disables all current powertools
|
||||
usage: /<command>
|
||||
aliases: [ptt,epowertooltoggle,eptt]
|
||||
ptime:
|
||||
description: Adjust player's client time. Add @ prefix to fix.
|
||||
usage: /<command> [list|reset|day|night|dawn|17:30|4pm|4000ticks] <player|*>
|
||||
@@ -244,7 +248,7 @@ commands:
|
||||
aliases: [esell]
|
||||
sethome:
|
||||
description: Set your home to your current location.
|
||||
usage: /<command>
|
||||
usage: /<command> [[player:]name]
|
||||
aliases: [esethome]
|
||||
setjail:
|
||||
description: Creates a jail where you specified named [jailname]
|
||||
@@ -330,7 +334,7 @@ commands:
|
||||
usage: /<command> <player>
|
||||
tppos:
|
||||
description: Teleport to coordinates.
|
||||
usage: /<command> <x> <y> <z>
|
||||
usage: /<command> <x> <y> <z> [yaw] [pitch]
|
||||
tptoggle:
|
||||
description: Blocks all forms of teleportation.
|
||||
usage: /<command>
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.avaje.ebean.config.ServerConfig;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
@@ -378,4 +380,82 @@ public class FakeServer implements Server
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWhitelist(boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<org.bukkit.OfflinePlayer> getWhitelistedPlayers()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadWhitelist()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Player getPlayerExact(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int broadcast(String string, String string1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.OfflinePlayer getOfflinePlayer(String string)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getIPBans()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void banIP(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbanIP(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<org.bukkit.OfflinePlayer> getBannedPlayers()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameMode getDefaultGameMode()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultGameMode(GameMode gm)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-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 combineaccessrules="false" kind="src" path="/EssentialsGroupManager"/>
|
||||
<classpathentry kind="lib" path="../lib/Permissions3.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>EssentialsGroupBridge</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -4,6 +4,19 @@ annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=EssentialsGroupBridge
|
||||
application.vendor=gabrielcouto
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=true
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width=120
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap=none
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
@@ -26,16 +39,14 @@ dist.jar=${dist.dir}/EssentialsGroupBridge.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
|
||||
file.reference.Permissions.jar=..\\lib\\Permissions.jar
|
||||
file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
|
||||
includes=**
|
||||
jar.archive.disabled=${jnlp.enabled}
|
||||
jar.compress=true
|
||||
jar.index=${jnlp.enabled}
|
||||
javac.classpath=\
|
||||
${reference.EssentialsGroupManager.jar}:\
|
||||
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
|
||||
${file.reference.Permissions.jar}
|
||||
${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
package com.nijiko.permissions;
|
||||
|
||||
public class Entry {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.nijiko.permissions;
|
||||
|
||||
public class Group extends Entry {
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,458 @@
|
||||
package com.nijiko.permissions;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Permissions 3.0
|
||||
* Copyright (C) 2011 Matt 'The Yeti' Burnett <admin@theyeticave.net>
|
||||
* Original Credit & Copyright (C) 2010 Nijikokun <nijikokun@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Permissions Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Permissions Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Permissions Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
public abstract class PermissionHandler {
|
||||
//World config manipulation methods
|
||||
|
||||
/**
|
||||
* Sets the default world that is loaded on startup.
|
||||
* @param world World to load on startup
|
||||
*/
|
||||
public abstract void setDefaultWorld(String world);
|
||||
/**
|
||||
* Check if world is loaded.
|
||||
* A world is considered as loaded if there exists a user/group storage for it or it mirrors another world.
|
||||
* @param world Target world
|
||||
* @return Whether the world is loaded.
|
||||
*/
|
||||
public abstract boolean checkWorld(String world);
|
||||
|
||||
/**
|
||||
* Attempts to load a world. If the world is already loaded, nothing happens.
|
||||
* @param world World to load
|
||||
* @return Whether world isn't already loaded
|
||||
* @throws Exception Any exception that may occur when loading the world.
|
||||
*/
|
||||
public abstract boolean loadWorld(String world) throws Exception;
|
||||
/**
|
||||
* Forces a load of the world.
|
||||
* @param world World to load
|
||||
* @throws Exception Any exception that may occur when loading the world.
|
||||
*/
|
||||
public abstract void forceLoadWorld(String world) throws Exception;
|
||||
/**
|
||||
* Returns a set of the names all loaded worlds.
|
||||
* A world is considered as loaded if there exists a user/group storage for it or it mirrors another world.
|
||||
* @return Set of the names all loaded worlds.
|
||||
*/
|
||||
public abstract Set<String> getWorlds();
|
||||
/**
|
||||
* Loads the default world and global permissions.
|
||||
* @throws Exception Any exception that may occur when loading the worlds.
|
||||
*/
|
||||
public abstract void load() throws Exception;
|
||||
/**
|
||||
* Reloads all worlds
|
||||
*/
|
||||
public abstract void reload();
|
||||
/**
|
||||
* Reloads the specified world
|
||||
* @param world Name of target world
|
||||
* @return False if world is not loaded, true otherwise
|
||||
*/
|
||||
public abstract boolean reload(String world);
|
||||
/**
|
||||
* Forces all storages to save,
|
||||
*/
|
||||
public abstract void saveAll();
|
||||
/**
|
||||
* This method forces a save of the specified world
|
||||
* @param world Name of target world
|
||||
*/
|
||||
public abstract void save(String world);
|
||||
/**
|
||||
* Forces all storages to close.
|
||||
*/
|
||||
public abstract void closeAll();
|
||||
|
||||
//Permission-checking methods
|
||||
/**
|
||||
* This is an alias for permission(Player, String).
|
||||
* @param player Target player
|
||||
* @param node Permission node
|
||||
* @return True if the player has the specified node, false otherwise
|
||||
*/
|
||||
public abstract boolean has(Player player, String node);
|
||||
/**
|
||||
* This is an alias for permission(String, String, String).
|
||||
* @param worldName Target world (may be different from player's current world)
|
||||
* @param playerName Player's name
|
||||
* @param node Permission node
|
||||
* @return True if the player has the specified node, false otherwise
|
||||
*/
|
||||
public abstract boolean has(String worldName, String playerName, String node);
|
||||
/**
|
||||
* This method checks if the player has the given permissions in his/her current world.
|
||||
* In other words, this calls permissions(player.getWorld().getName(), player.getName(), node).
|
||||
* @param player Target player
|
||||
* @param node Permission node
|
||||
* @return True if the player has the specified node, false otherwise
|
||||
*/
|
||||
public abstract boolean permission(Player player, String node);
|
||||
/**
|
||||
* This method checks if the player has the given permissions in the given world.
|
||||
* @param worldName Target world (may be different from player's current world)
|
||||
* @param playerName Player's name
|
||||
* @param node Permission node
|
||||
* @return True if the player has the specified node, false otherwise
|
||||
*/
|
||||
public abstract boolean permission(String worldName, String playerName, String node);
|
||||
|
||||
//Permission-manipulation methods
|
||||
/**
|
||||
* Adds the given permission to the targeted player.
|
||||
* @param world Target world (may be different from player's current world)
|
||||
* @param user Player's name
|
||||
* @param node Permission node
|
||||
*/
|
||||
public abstract void addUserPermission(String world, String user, String node);
|
||||
/**
|
||||
* Removes the given permission from the targeted player.
|
||||
* @param world Target world (may be different from player's current world)
|
||||
* @param user Player's name
|
||||
* @param node Permission node
|
||||
*/
|
||||
public abstract void removeUserPermission(String world, String user, String node);
|
||||
/**
|
||||
* Adds the given permission to the targeted group.
|
||||
* @param world Target world
|
||||
* @param user Group's name
|
||||
* @param node Permission node
|
||||
*/
|
||||
public abstract void addGroupPermission(String world, String user, String node);
|
||||
/**
|
||||
* Removes the given permission from the targeted group.
|
||||
* @param world Target world
|
||||
* @param user Group's name
|
||||
* @param node Permission node
|
||||
*/
|
||||
public abstract void removeGroupPermission(String world, String user, String node);
|
||||
|
||||
//Chat, prefix, suffix, build methods
|
||||
/**
|
||||
* Retrieves the properly-capitalised version of the given group's name.
|
||||
* Returns an empty string if group does not exist.
|
||||
* @param world Group's world
|
||||
* @param group Group's name (any capitalisation)
|
||||
* @return Group's properly-capitalised name.
|
||||
*/
|
||||
public abstract String getGroupProperName(String world, String group);
|
||||
/**
|
||||
* Gets the appropriate prefix for the user.
|
||||
* This method is a utility method for chat plugins to get the user's prefix
|
||||
* without having to look at every one of the user's ancestors.
|
||||
* Returns an empty string if user has no parent groups.
|
||||
* @param world Player's world
|
||||
* @param user Player's name
|
||||
* @return Player's prefix
|
||||
*/
|
||||
public abstract String getUserPrefix(String world, String user);
|
||||
/**
|
||||
* Gets the appropriate suffix for the user.
|
||||
* This method is a utility method for chat plugins to get the user's suffix
|
||||
* without having to look at every one of the user's ancestors.
|
||||
* Returns an empty string if user has no parent groups.
|
||||
* @param world Player's world
|
||||
* @param user Player's name
|
||||
* @return Player's suffix
|
||||
*/
|
||||
public abstract String getUserSuffix(String world, String user);
|
||||
/**
|
||||
* Gets the primary group of the user.
|
||||
* Returns the default group if user has no parent groups,
|
||||
* or null if there is no default group for that world.
|
||||
* @param world Player's world
|
||||
* @param user Player's name
|
||||
* @return Player's primary group
|
||||
*/
|
||||
public abstract Group getPrimaryGroupObject(String world, String user);
|
||||
/**
|
||||
* Gets name of the primary group of the user.
|
||||
* Returns the name of the default group if user has no parent groups,
|
||||
* or "Default" if there is no default group for that world.
|
||||
* @param world Player's world
|
||||
* @param user Player's name
|
||||
* @return Name of player's primary group
|
||||
*/
|
||||
public abstract String getPrimaryGroup(String world, String user);
|
||||
/**
|
||||
* Check if user can build.
|
||||
* @param world Player's world
|
||||
* @param user Player's name
|
||||
* @return Whether the user can build
|
||||
*/
|
||||
public abstract boolean canUserBuild(String world, String user);
|
||||
|
||||
/**
|
||||
* Retrieves group's raw prefix, inheritance not included.
|
||||
* Will return an empty string if no prefix is defined for the group.
|
||||
* @param world Group's world
|
||||
* @param group Group's name
|
||||
* @return The prefix defined for the group, empty string if prefix is not defined.
|
||||
*/
|
||||
public abstract String getGroupRawPrefix(String world, String group);
|
||||
/**
|
||||
* Retrieves group's raw suffix, inheritance not included.
|
||||
* Will return an empty string if no suffix is defined for the group.
|
||||
* @param world Group's world
|
||||
* @param group Group's name
|
||||
* @return The suffix defined for the group, empty string if suffix is not defined.
|
||||
*/
|
||||
public abstract String getGroupRawSuffix(String world, String group);
|
||||
/**
|
||||
* Retrieves group's build setting, inheritance not included.
|
||||
* @param world Group's world
|
||||
* @param group Group's name
|
||||
* @return Returns group's build setting.
|
||||
*/
|
||||
public abstract boolean canGroupRawBuild(String world, String group);
|
||||
|
||||
//Entry methods
|
||||
/**
|
||||
* Returns the user object defined by the given world and name.
|
||||
* This method attempts to create the object if it does not exist.
|
||||
* @param world User's world
|
||||
* @param name User's name
|
||||
* @return User object
|
||||
* @throws Exception An exception when creating the user object
|
||||
*/
|
||||
public abstract User safeGetUser(String world, String name) throws Exception;
|
||||
/**
|
||||
* Returns the group object defined by the given world and name.
|
||||
* This method attempts to create the object if it does not exist.
|
||||
* @param world Group's world
|
||||
* @param name Group's name
|
||||
* @return Group object
|
||||
* @throws Exception An exception when creating the group object
|
||||
*/
|
||||
public abstract Group safeGetGroup(String world, String name) throws Exception;
|
||||
/**
|
||||
* Returns the user object defined by the given world and name.
|
||||
* This method will return null if the object does not exist.
|
||||
* @param world User's world
|
||||
* @param name User's name
|
||||
* @return User object, or null if it doesn't exist
|
||||
*/
|
||||
public abstract User getUserObject(String world, String name);
|
||||
/**
|
||||
* Returns the group object defined by the given world and name.
|
||||
* This method will return null if the object does not exist.
|
||||
* @param world Group's world
|
||||
* @param name Group's name
|
||||
* @return Group object, or null if it doesn't exist
|
||||
*/
|
||||
public abstract Group getGroupObject(String world, String name);
|
||||
|
||||
/**
|
||||
* Returns the group object representing the default group of the given world.
|
||||
* This method will return null if the object does not exist or the world has no default group.
|
||||
* @param world Target world
|
||||
* @return Group object representing default world, or null if it doesn't exist or is not defined.
|
||||
*/
|
||||
public abstract Group getDefaultGroup(String world);
|
||||
/**
|
||||
* Returns all the user objects in the world.
|
||||
* Will return null if world does not exist.
|
||||
* @param world Target world
|
||||
* @return Collection of all user objects belonging to the world.
|
||||
*/
|
||||
public abstract Collection<User> getUsers(String world);
|
||||
/**
|
||||
* Returns all the group objects in the world.
|
||||
* Will return null if world does not exist.
|
||||
* @param world Target world
|
||||
* @return Collection of all group objects belonging to the world.
|
||||
*/
|
||||
public abstract Collection<Group> getGroups(String world);
|
||||
|
||||
//Parent-related methods
|
||||
public abstract Set<String> getTracks(String world);
|
||||
/**
|
||||
* Checks if user is in specified group. Includes inherited groups.
|
||||
* @param world World of both the user and the group
|
||||
* @param user User's name
|
||||
* @param group Parent group's name
|
||||
* @return Whether user is a child of the specified group
|
||||
*/
|
||||
public abstract boolean inGroup(String world, String user, String group);
|
||||
/**
|
||||
* Checks if user is in specified group. Includes inherited groups.
|
||||
* @param world User's world
|
||||
* @param user User's name
|
||||
* @param groupWorld Parent group's world
|
||||
* @param group Parent group's name
|
||||
* @return Whether user is a child of the specified group
|
||||
*/
|
||||
public abstract boolean inGroup(String world, String user, String groupWorld, String group);
|
||||
/**
|
||||
* Checks if user is in specified group, not counting inherited parents.
|
||||
* @param world World of both the user and the group
|
||||
* @param user User's name
|
||||
* @param group Parent group's name
|
||||
* @return Whether user is a child of the specified group
|
||||
*/
|
||||
public abstract boolean inSingleGroup(String world, String user, String group);
|
||||
/**
|
||||
* Checks if user is in specified group, not counting inherited parents.
|
||||
* @param world User's world
|
||||
* @param user User's name
|
||||
* @param groupWorld Parent group's world
|
||||
* @param group Parent group's name
|
||||
* @return Whether user is a child of the specified group
|
||||
*/
|
||||
public abstract boolean inSingleGroup(String world, String user, String groupWorld, String group);
|
||||
/**
|
||||
* Gets a array of the names of all parent groups in the same world.
|
||||
* @param world Target user's world
|
||||
* @param name Target user's name
|
||||
* @return An array containing the names of all parent groups (including ancestors) that are in the same world
|
||||
*/
|
||||
public abstract String[] getGroups(String world, String name);
|
||||
/**
|
||||
* Gets a map of world name to all parent groups of the target user in that world.
|
||||
* @param world Target user's world
|
||||
* @param name Target user's name
|
||||
* @return Map of world name to set of groups that the user inherits from in the world.
|
||||
*/
|
||||
public abstract Map<String, Set<String>> getAllGroups(String world, String name);
|
||||
|
||||
//Weight-related methods
|
||||
/**
|
||||
* Compare the weights of two users.
|
||||
* This method is for plugin devs to compare whether a user can do an action to another user.
|
||||
* For example, SlapPlugin can compare the weights of two users when one of them wants to /slap the other.
|
||||
* It can decide whether to allow the slap using the result of this function.
|
||||
* @param firstWorld First user's world
|
||||
* @param first First user's name
|
||||
* @param secondWorld Second user's world
|
||||
* @param second Second user's name
|
||||
* @return -1 if firstWeight < secondWeight, 0 if firstWeight == secondWeight, 1 if firstWeight > secondWeight
|
||||
*/
|
||||
public abstract int compareWeights(String firstWorld, String first, String secondWorld, String second);
|
||||
/**
|
||||
* Alias for compareWeights(world, first, world, second).
|
||||
* @param world World
|
||||
* @param first First user's name
|
||||
* @param second Second user's name
|
||||
* @return -1 if firstWeight < secondWeight, 0 if firstWeight == secondWeight, 1 if firstWeight > secondWeight
|
||||
*/
|
||||
public abstract int compareWeights(String world, String first, String second);
|
||||
|
||||
//Data-related methods
|
||||
public abstract String getRawInfoString(String world, String entryName, String path,boolean isGroup);
|
||||
|
||||
public abstract Integer getRawInfoInteger(String world, String entryName, String path, boolean isGroup);
|
||||
|
||||
public abstract Double getRawInfoDouble(String world, String entryName, String path, boolean isGroup);
|
||||
|
||||
public abstract Boolean getRawInfoBoolean(String world, String entryName, String path, boolean isGroup);
|
||||
|
||||
|
||||
public abstract String getInfoString(String world, String entryName, String path,boolean isGroup);
|
||||
public abstract String getInfoString(String world, String entryName, String path, boolean isGroup, Comparator<String> comparator);
|
||||
|
||||
public abstract Integer getInfoInteger(String world, String entryName, String path, boolean isGroup);
|
||||
public abstract Integer getInfoInteger(String world, String entryName, String path, boolean isGroup, Comparator<Integer> comparator);
|
||||
|
||||
public abstract Double getInfoDouble(String world, String entryName, String path, boolean isGroup);
|
||||
public abstract Double getInfoDouble(String world, String entryName, String path, boolean isGroup, Comparator<Double> comparator);
|
||||
|
||||
public abstract Boolean getInfoBoolean(String world, String entryName, String path, boolean isGroup);
|
||||
public abstract Boolean getInfoBoolean(String world, String entryName, String path, boolean isGroup, Comparator<Boolean> comparator);
|
||||
|
||||
|
||||
public abstract void addUserInfo(String world, String name, String path, Object data);
|
||||
public abstract void removeUserInfo(String world, String name, String path);
|
||||
public abstract void addGroupInfo(String world, String name, String path, Object data);
|
||||
public abstract void removeGroupInfo(String world, String name, String path);
|
||||
|
||||
//Legacy methods
|
||||
@Deprecated
|
||||
public abstract String getGroupPermissionString(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract int getGroupPermissionInteger(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract boolean getGroupPermissionBoolean(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract double getGroupPermissionDouble(String world, String group, String path);
|
||||
|
||||
@Deprecated
|
||||
public abstract String getUserPermissionString(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract int getUserPermissionInteger(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract boolean getUserPermissionBoolean(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract double getUserPermissionDouble(String world, String group, String path);
|
||||
|
||||
@Deprecated
|
||||
public abstract String getPermissionString(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract int getPermissionInteger(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract boolean getPermissionBoolean(String world, String group, String path);
|
||||
@Deprecated
|
||||
public abstract double getPermissionDouble(String world, String group, String path);
|
||||
|
||||
|
||||
@Deprecated
|
||||
public abstract String getGroup(String world, String group);
|
||||
|
||||
@Deprecated
|
||||
public abstract String getGroupPrefix(String world, String group);
|
||||
@Deprecated
|
||||
public abstract String getGroupSuffix(String world, String group);
|
||||
@Deprecated
|
||||
public abstract boolean canGroupBuild(String world, String group);
|
||||
|
||||
//Cache methods are no longer available
|
||||
// @Deprecated
|
||||
// public void setCache(String world, Map<String, Boolean> Cache) {
|
||||
// }
|
||||
// @Deprecated
|
||||
// public void setCacheItem(String world, String player, String permission, boolean data){
|
||||
// }
|
||||
// @Deprecated
|
||||
// public Map<String, Boolean> getCache(String world){
|
||||
// return null;
|
||||
// }
|
||||
// @Deprecated
|
||||
// public boolean getCacheItem(String world, String player, String permission){
|
||||
// return false;
|
||||
// }
|
||||
// @Deprecated
|
||||
// public void removeCachedItem(String world, String player, String permission){
|
||||
// }
|
||||
// @Deprecated
|
||||
// public void clearCache(String world){
|
||||
// }
|
||||
// @Deprecated
|
||||
// public void clearAllCache(){
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.nijiko.permissions;
|
||||
|
||||
public class User extends Entry {
|
||||
|
||||
}
|
||||
@@ -1,16 +1,11 @@
|
||||
package com.nijikokun.bukkit.Permissions;
|
||||
|
||||
import com.nijiko.Misc;
|
||||
import com.nijiko.configuration.DefaultConfiguration;
|
||||
import com.nijiko.permissions.PermissionHandler;
|
||||
import java.util.logging.Logger;
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
//import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@@ -19,110 +14,69 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Permissions extends JavaPlugin {
|
||||
|
||||
private class Listener extends PlayerListener {
|
||||
|
||||
private Permissions plugin;
|
||||
|
||||
public Listener(Permissions plugin) {
|
||||
//compiled code
|
||||
throw new RuntimeException("Compiled Code");
|
||||
}
|
||||
|
||||
public void onPlayerCommand(PlayerChatEvent event) {
|
||||
//compiled code
|
||||
throw new RuntimeException("Compiled Code");
|
||||
}
|
||||
}
|
||||
public static final Logger log = Logger.getLogger("Fake Permissions");
|
||||
public static String name = "Permissions";
|
||||
public static String codename = "Hacked Permissions by AnjoCaido";
|
||||
public static String version = "2.0";
|
||||
public static PermissionHandler Security = null;
|
||||
public static Misc Misc = new Misc();
|
||||
public static Server Server;
|
||||
private Listener Listener = null;
|
||||
private DefaultConfiguration config = null;
|
||||
private GroupManager groupManager;
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
//compiled code
|
||||
//throw new RuntimeException("Compiled Code");
|
||||
// EXAMPLE: Custom code, here we just output some info so we can check all is well
|
||||
PluginDescriptionFile pdfFile = this.getDescription();
|
||||
System.out.println("Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
Server = this.getServer();
|
||||
PluginDescriptionFile pdfFile = this.getDescription();
|
||||
|
||||
if (Security == null) {//make sure we have only one instance
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
|
||||
Plugin p = (this.getServer() == null) ? null : this.getServer().getPluginManager().getPlugin("GroupManager");
|
||||
if (p != null) {
|
||||
if (p.isEnabled()) {
|
||||
setGM(p);
|
||||
} else {
|
||||
if (this.getServer() != null) {
|
||||
this.getServer().getPluginManager().registerEvent(Type.PLUGIN_ENABLE, new ServerListener() {
|
||||
if (Security == null) {
|
||||
//make sure we have only one instance
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginEnable(PluginEnableEvent event)
|
||||
{
|
||||
if (event.getPlugin().getDescription().getName().equals("GroupManager")) {
|
||||
Permissions.this.setGM(event.getPlugin());
|
||||
}
|
||||
}
|
||||
|
||||
}, Priority.Normal, this);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("OOOPS! Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " couldn't find GroupManager!");
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
}
|
||||
// EXAMPLE: Custom code, here we just output some info so we can check all is well
|
||||
if (pdfFile != null)
|
||||
System.out.println("Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
Plugin p = (this.getServer() == null) ? null : this.getServer().getPluginManager().getPlugin("GroupManager");
|
||||
if (p != null) {
|
||||
if (p.isEnabled()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("OOOPS! Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " couldn't find GroupManager!");
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
}
|
||||
|
||||
if (pdfFile != null) {
|
||||
System.out.println("Fake " + pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
}
|
||||
}
|
||||
|
||||
private void registerEvents() {
|
||||
//compiled code
|
||||
//throw new RuntimeException("Compiled Code");
|
||||
private void setGM(final Plugin p) {
|
||||
//GroupManager groupManager = (GroupManager) p;
|
||||
((NijikoPermissionsProxy) Security).setGM(p);
|
||||
}
|
||||
|
||||
private void setGM(Plugin p) {
|
||||
groupManager = (GroupManager)p;
|
||||
((NijikoPermissionsProxy)Security).setGM(p);
|
||||
}
|
||||
|
||||
public PermissionHandler getHandler() {
|
||||
//compiled code
|
||||
//throw new RuntimeException("Compiled Code");
|
||||
//System.out.println("Alguem chamou o handler");
|
||||
if (Security == null)
|
||||
{
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
//checkEnable();
|
||||
if (Security == null) {
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
return Security;
|
||||
}
|
||||
|
||||
public void setupPermissions() {
|
||||
if (Security == null)
|
||||
{
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
//checkEnable();
|
||||
}
|
||||
|
||||
private void checkEnable() {
|
||||
if (!this.isEnabled() && Security == null && this.getServer() != null) {
|
||||
this.getServer().getPluginManager().enablePlugin(this);
|
||||
if (Security == null) {
|
||||
Security = new NijikoPermissionsProxy(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
+313
-159
@@ -4,26 +4,34 @@
|
||||
*/
|
||||
package org.anjocaido.groupmanager.permissions;
|
||||
|
||||
import com.nijiko.permissions.Control;
|
||||
import com.nijiko.permissions.Group;
|
||||
import com.nijiko.permissions.PermissionHandler;
|
||||
import com.nijiko.permissions.User;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.config.Configuration;
|
||||
|
||||
/**
|
||||
* Everything here maintains the model created by Nijikokun
|
||||
*
|
||||
* Everything here maintains the model created by Nijikokun
|
||||
*
|
||||
* But implemented to use GroupManager system. Which provides instant changes,
|
||||
* without file access.
|
||||
*
|
||||
* @author gabrielcouto
|
||||
*/
|
||||
public class NijikoPermissionsProxy extends Control {
|
||||
public class NijikoPermissionsProxy extends PermissionHandler {
|
||||
|
||||
GroupManager plugin;
|
||||
public NijikoPermissionsProxy(GroupManager plugin){
|
||||
super(null);
|
||||
|
||||
public NijikoPermissionsProxy(GroupManager plugin) {
|
||||
super();
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -39,12 +47,12 @@ public class NijikoPermissionsProxy extends Control {
|
||||
|
||||
@Override
|
||||
public void addGroupInfo(String world, String group, String node, Object data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().addGroupInfo(group, node, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeGroupInfo(String world, String group, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().removeGroupInfo(group, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,62 +67,62 @@ public class NijikoPermissionsProxy extends Control {
|
||||
|
||||
@Override
|
||||
public void addUserInfo(String world, String user, String node, Object data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().addUserInfo(user, node, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUserInfo(String world, String user, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().removeUserInfo(user, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void removeUserInfo(String user, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().removeUserInfo(user, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void addGroupPermission(String group, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void removeGroupPermission(String group, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void addGroupInfo(String group, String node, Object data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().addGroupInfo(group, node, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void removeGroupInfo(String group, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().removeGroupInfo(group, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void addUserPermission(String user, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void removeUserPermission(String user, String node) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void addUserInfo(String user, String node, Object data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().addUserInfo(user, node, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultWorld(String world) {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setDirectory(File directory) {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,7 +132,7 @@ public class NijikoPermissionsProxy extends Control {
|
||||
|
||||
@Override
|
||||
public void forceLoadWorld(String world) {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,91 +142,21 @@ public class NijikoPermissionsProxy extends Control {
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(String world, Configuration config) {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
plugin.getWorldsHolder().reloadAll();
|
||||
plugin.getWorldsHolder().reloadAll();
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reload(String world) {
|
||||
plugin.getWorldsHolder().reloadWorld(world);
|
||||
plugin.getWorldsHolder().reloadWorld(world);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCache(Map<String, Boolean> Cache) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCache(String world, Map<String, Boolean> Cache) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCacheItem(String player, String permission, boolean data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCacheItem(String world, String player, String permission, boolean data) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Boolean> getCache() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Boolean> getCache(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCacheItem(String player, String permission) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCacheItem(String world, String player, String permission) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCachedItem(String player, String permission) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCachedItem(String world, String player, String permission) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCache() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCache(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllCache() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(Player player, String permission) {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
@@ -228,27 +166,56 @@ public class NijikoPermissionsProxy extends Control {
|
||||
@Override
|
||||
public boolean permission(Player player, String permission) {
|
||||
//throw new UnsupportedOperationException("Not supported yet.");
|
||||
if(permission==null || permission.equals("")){
|
||||
if (permission == null || permission.equals("")) {
|
||||
return false;
|
||||
}
|
||||
if(player==null){
|
||||
GroupManager.logger.severe("A plugin is asking permission '"+permission+"' for a null player... Which plugin does that? Bastards!");
|
||||
if (player == null) {
|
||||
GroupManager.logger.severe("A plugin is asking permission '" + permission + "' for a null player... Which plugin does that? Bastards!");
|
||||
return false;
|
||||
}
|
||||
if(player.getWorld()==null){
|
||||
GroupManager.logger.warning("The player "+player.getName()+" has a null world? Treating as default world!");
|
||||
if (player.getWorld() == null) {
|
||||
GroupManager.logger.warning("The player " + player.getName() + " has a null world? Treating as default world!");
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().has(player, permission);
|
||||
}
|
||||
return plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getPermissionsHandler().has(player, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroup(String world, String name) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroup(name);
|
||||
public String getGroupRawPrefix(String world, String group) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPrefix(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupRawSuffix(String world, String group) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupSuffix(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserPrefix(String world, String user) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPrefix(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserSuffix(String world, String user) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserSuffix(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroup(String world, String user) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroup(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrimaryGroup(String world, String user) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroup(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUserBuild(String world, String user) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().canUserBuild(user);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public String getGroup(String name) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroup(name);
|
||||
}
|
||||
@@ -258,21 +225,14 @@ public class NijikoPermissionsProxy extends Control {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroups(name);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public String[] getGroups(String name) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroups(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inGroup(String world, String name, String group) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().inGroup(name,group);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().inGroup(name, group);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean inGroup(String name, String group) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().inGroup(name,group);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().inGroup(name, group);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -280,7 +240,7 @@ public class NijikoPermissionsProxy extends Control {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPrefix(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getGroupPrefix(String group) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPrefix(group);
|
||||
}
|
||||
@@ -290,7 +250,7 @@ public class NijikoPermissionsProxy extends Control {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupSuffix(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getGroupSuffix(String group) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupSuffix(group);
|
||||
}
|
||||
@@ -301,134 +261,328 @@ public class NijikoPermissionsProxy extends Control {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean canGroupBuild(String group) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().canGroupBuild(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupPermissionString(String world, String group, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionString(group,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionString(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getGroupPermissionString(String group, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionString(group,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionString(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGroupPermissionInteger(String world, String group, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionInteger(group,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionInteger(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getGroupPermissionInteger(String group, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionInteger(group,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionInteger(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getGroupPermissionBoolean(String world, String group, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionBoolean(group,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionBoolean(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean getGroupPermissionBoolean(String group, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionBoolean(group,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionBoolean(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getGroupPermissionDouble(String world, String group, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionDouble(group,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getGroupPermissionDouble(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public double getGroupPermissionDouble(String group, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionDouble(group,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getGroupPermissionDouble(group, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserPermissionString(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionString(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionString(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getUserPermissionString(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionString(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionString(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUserPermissionInteger(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionInteger(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionInteger(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getUserPermissionInteger(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionInteger(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionInteger(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getUserPermissionBoolean(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionBoolean(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionBoolean(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean getUserPermissionBoolean(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionBoolean(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionBoolean(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getUserPermissionDouble(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionDouble(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getUserPermissionDouble(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public double getUserPermissionDouble(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionDouble(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getUserPermissionDouble(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermissionString(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionString(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionString(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getPermissionString(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionString(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionString(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPermissionInteger(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionInteger(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionInteger(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getPermissionInteger(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionInteger(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionInteger(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getPermissionBoolean(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionBoolean(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionBoolean(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean getPermissionBoolean(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionBoolean(name,permission);
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionBoolean(name, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPermissionDouble(String world, String name, String permission) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionDouble(name,permission);
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getPermissionDouble(name, permission);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public double getPermissionDouble(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionDouble(name, permission);
|
||||
}
|
||||
|
||||
public void setGM(Plugin p) {
|
||||
this.plugin = (GroupManager) p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getPermissionDouble(String name, String permission) {
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().getPermissionDouble(name,permission);
|
||||
public boolean canGroupRawBuild(String world, String group) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().canGroupBuild(group);
|
||||
}
|
||||
|
||||
public void setGM(Plugin p)
|
||||
{
|
||||
this.plugin = (GroupManager)p;
|
||||
@Override
|
||||
public void closeAll() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareWeights(String firstWorld, String first, String secondWorld, String second) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareWeights(String world, String first, String second) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Set<String>> getAllGroups(String world, String name) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getDefaultGroup(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroupObject(String world, String group) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupProperName(String world, String group) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getInfoBoolean(String world, String entryName, String path,
|
||||
boolean isGroup) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getInfoBoolean(entryName, path, isGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getInfoBoolean(String world, String entryName, String path,
|
||||
boolean isGroup, Comparator<Boolean> comparator) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getInfoDouble(String world, String entryName, String path, boolean isGroup) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getInfoDouble(entryName, path, isGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getInfoDouble(String world, String entryName, String path,
|
||||
boolean isGroup, Comparator<Double> comparator) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getInfoInteger(String world, String entryName, String path,
|
||||
boolean isGroup) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getInfoInteger(entryName, path, isGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getInfoInteger(String world, String entryName, String path,
|
||||
boolean isGroup, Comparator<Integer> comparator) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoString(String world, String entryName, String path, boolean isGroup) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().getInfoString(entryName, path, isGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoString(String world, String entryName, String path,
|
||||
boolean isGroup, Comparator<String> comparator) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getRawInfoBoolean(String world, String entryName, String path,
|
||||
boolean isGroup) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getRawInfoDouble(String world, String entryName, String path,
|
||||
boolean isGroup) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getRawInfoInteger(String world, String entryName, String path,
|
||||
boolean isGroup) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRawInfoString(String world, String entryName, String path,
|
||||
boolean isGroup) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getTracks(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getUserObject(String world, String name) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<User> getUsers(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getWorlds() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String world, String playerName, String permission) {
|
||||
if (permission == null || permission.equals("")) {
|
||||
return false;
|
||||
}
|
||||
if (playerName == null || playerName == "") {
|
||||
GroupManager.logger.severe("A plugin is asking permission '" + permission + "' for a null player... Which plugin does that? Bastards!");
|
||||
return false;
|
||||
}
|
||||
if (world == null) {
|
||||
GroupManager.logger.warning("The player " + playerName + " has a null world? Treating as default world!");
|
||||
return plugin.getWorldsHolder().getDefaultWorld().getPermissionsHandler().permission(playerName, permission);
|
||||
}
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().permission(playerName, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inGroup(String world, String user, String groupWorld, String group) {
|
||||
return plugin.getWorldsHolder().getWorldData(world).getPermissionsHandler().inGroup(user, group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inSingleGroup(String world, String user, String group) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inSingleGroup(String world, String user, String groupWorld, String group) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean permission(String world, String name, String node) {
|
||||
return has(world, name, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group safeGetGroup(String world, String name) throws Exception {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public User safeGetUser(String world, String name) throws Exception {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAll() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Group> getGroups(String world) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
//@Override
|
||||
public Group getPrimaryGroupObject(String arg0, String arg1) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Permissions
|
||||
version: 2.7.2
|
||||
version: 3.1.6
|
||||
main: com.nijikokun.bukkit.Permissions.Permissions
|
||||
depend: [GroupManager]
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-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"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>EssentialsGroupManager</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -4,6 +4,19 @@ annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=EssentialsGroupManager
|
||||
application.vendor=gabrielcouto
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
|
||||
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=true
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width=120
|
||||
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap=none
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
Changelog
|
||||
|
||||
v 1.1:
|
||||
- Fixed users being able to use 'manuadd' to add users to higher groups than their own.
|
||||
- Added SuperPerms support so GM will update and provide the permissions to plugins which only support Bukkit Perms.
|
||||
- Added more helpful output to errors on argument lengths.
|
||||
- GroupManager will now attempt to select the default world when using commands instead of failing and telling you to use '/manselect <world>'.
|
||||
- Invalid groups assigned to players in users.yml will no longer cause a crash. GM will now set them to the default group instead.
|
||||
- Fix for Users.yml containing only 'users:' causing a crash.
|
||||
- GroupManager will now generate a fresh Users and Groups yml if either file is empty.
|
||||
- Fix for an infinite loop bug with the new Bukkit Perms during a new user creation.
|
||||
- Fixed BukkitPerms population. Wasn't correctly setting superperms.
|
||||
- Push updates to superperms for all valid GM commands.
|
||||
- All GroupManager commands issued by players are now echoed in the console.
|
||||
- Reverted WorldHolder static change to maintain backward plugin compatibility.
|
||||
- Update to handle 'getDescription().getPermissions(') returning a list (CB 1172).
|
||||
- Fix for null in PLAYER_TELEPORT for bukkit perms.
|
||||
- Fixed wasteful updating of perms on a manload.
|
||||
- manulistp now accepts an additional + to list ALL Superperms effective permissions (/manulistp <name> +).
|
||||
- manucheckp also outputs superperms results.
|
||||
- Removed superperms update on plugins unloading. Unneeded and created undesired lag on shutdown.
|
||||
- Added a BukkitPermsUpdateTask to only update superperms once on a load/reload.
|
||||
- Fix for GM not checking inheritance for known superperms nodes.
|
||||
- Optimized getAllPlayersPermissions and fixed pushing unknown perms to superperms.
|
||||
v 1.2:
|
||||
@@ -7,7 +7,8 @@ settings:
|
||||
permission:
|
||||
world:
|
||||
mirror:
|
||||
world1:
|
||||
world:
|
||||
- world_nether
|
||||
- world2
|
||||
- world3
|
||||
world4:
|
||||
|
||||
Regular → Executable
+1
-1
@@ -117,4 +117,4 @@ public class GMConfiguration {
|
||||
}
|
||||
GroupManager.logger.setLevel(Level.INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@
|
||||
package org.anjocaido.groupmanager;
|
||||
|
||||
import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
|
||||
import org.anjocaido.groupmanager.permissions.BukkitPermissions;
|
||||
import org.anjocaido.groupmanager.utils.GroupManagerPermissions;
|
||||
import org.anjocaido.groupmanager.Tasks.BukkitPermsUpdateTask;
|
||||
import org.anjocaido.groupmanager.data.Variables;
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
import org.anjocaido.groupmanager.data.Group;
|
||||
@@ -24,6 +26,7 @@ import java.util.logging.Logger;
|
||||
import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder;
|
||||
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
|
||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
import org.anjocaido.groupmanager.utils.Tasks;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -32,6 +35,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
/**
|
||||
*
|
||||
* @author gabrielcouto
|
||||
@@ -47,12 +51,20 @@ public class GroupManager extends JavaPlugin {
|
||||
private WorldsHolder worldsHolder;
|
||||
private boolean validateOnlinePlayer = true;
|
||||
private boolean isReady = false;
|
||||
private static boolean isLoaded = false;
|
||||
private GMConfiguration config;
|
||||
private GMLoggerHandler ch;
|
||||
private GMLoggerHandler ch;
|
||||
public static BukkitPermissions BukkitPermissions;
|
||||
public static final Logger logger = Logger.getLogger(GroupManager.class.getName());
|
||||
|
||||
//PERMISSIONS FOR COMMAND BEING LOADED
|
||||
OverloadedWorldHolder dataHolder = null;
|
||||
AnjoPermissionsHandler permissionHandler = null;
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
setLoaded(false);
|
||||
|
||||
if (worldsHolder != null) {
|
||||
worldsHolder.saveChanges();
|
||||
}
|
||||
@@ -60,7 +72,7 @@ public class GroupManager extends JavaPlugin {
|
||||
// EXAMPLE: Custom code, here we just output some info so we can check all is well
|
||||
PluginDescriptionFile pdfFile = this.getDescription();
|
||||
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled!");
|
||||
GroupManager.logger.removeHandler(ch);
|
||||
GroupManager.logger.removeHandler(ch);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,12 +93,34 @@ public class GroupManager extends JavaPlugin {
|
||||
this.getServer().getPluginManager().disablePlugin(this);
|
||||
throw new IllegalStateException("An error ocurred while loading GroupManager");
|
||||
}
|
||||
|
||||
BukkitPermissions = new BukkitPermissions(this);
|
||||
|
||||
enableScheduler();
|
||||
|
||||
/*
|
||||
* Schedule a Bukiit Permissions update for 1 tick later.
|
||||
* All plugins will be loaded by then
|
||||
*/
|
||||
|
||||
if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(),1) == -1) {
|
||||
GroupManager.logger.severe("Could not schedule superperms Update.");
|
||||
setLoaded(true);
|
||||
}
|
||||
|
||||
//setLoaded(true);
|
||||
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
}
|
||||
|
||||
public InputStream getResourceAsStream(String fileName) {
|
||||
public static boolean isLoaded() {
|
||||
return isLoaded;
|
||||
}
|
||||
|
||||
public static void setLoaded(boolean isLoaded) {
|
||||
GroupManager.isLoaded = isLoaded;
|
||||
}
|
||||
|
||||
public InputStream getResourceAsStream(String fileName) {
|
||||
return this.getClassLoader().getResourceAsStream(fileName);
|
||||
}
|
||||
|
||||
@@ -109,7 +143,7 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
GroupManager.this.worldsHolder.saveChanges();
|
||||
worldsHolder.saveChanges();
|
||||
}
|
||||
};
|
||||
scheduler = new ScheduledThreadPoolExecutor(1);
|
||||
@@ -166,7 +200,7 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple interface, for ones that don't want to mess with overloading.
|
||||
* A simple interface, for ones that don't want to mess with overloading.
|
||||
* Yet it is affected by overloading. But seamless.
|
||||
* @return the dataholder with all information
|
||||
*/
|
||||
@@ -176,8 +210,8 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this if you want to play with overloading.
|
||||
* @return a dataholder with overloading interface
|
||||
* Use this if you want to play with overloading.
|
||||
* @return a dataholder with overloading interface
|
||||
*/
|
||||
@Deprecated
|
||||
public OverloadedWorldHolder getOverloadedClassData() {
|
||||
@@ -186,15 +220,16 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
/**
|
||||
* Called when a command registered by this plugin is received.
|
||||
* @param sender
|
||||
* @param cmd
|
||||
* @param sender
|
||||
* @param cmd
|
||||
* @param args
|
||||
*/
|
||||
@SuppressWarnings({"null", "deprecation"})
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
|
||||
boolean playerCanDo = false;
|
||||
boolean isConsole = false;
|
||||
Player senderPlayer = null;
|
||||
Player senderPlayer = null, targetPlayer = null;
|
||||
Group senderGroup = null;
|
||||
User senderUser = null;
|
||||
|
||||
@@ -204,6 +239,7 @@ public class GroupManager extends JavaPlugin {
|
||||
senderPlayer = (Player) sender;
|
||||
senderUser = worldsHolder.getWorldData(senderPlayer).getUser(senderPlayer.getName());
|
||||
senderGroup = senderUser.getGroup();
|
||||
System.out.println("[PLAYER_COMMAND] " + senderPlayer.getName() + ": /" + commandLabel + " " + Tasks.join(args, " "));
|
||||
if (senderPlayer.isOp() || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) {
|
||||
playerCanDo = true;
|
||||
}
|
||||
@@ -212,8 +248,8 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
|
||||
//PERMISSIONS FOR COMMAND BEING LOADED
|
||||
OverloadedWorldHolder dataHolder = null;
|
||||
AnjoPermissionsHandler permissionHandler = null;
|
||||
dataHolder = null;
|
||||
permissionHandler = null;
|
||||
|
||||
if (senderPlayer != null) {
|
||||
dataHolder = worldsHolder.getWorldData(senderPlayer);
|
||||
@@ -246,9 +282,9 @@ public class GroupManager extends JavaPlugin {
|
||||
} catch (Exception e) {
|
||||
//this error happened once with someone. now im prepared... i think
|
||||
GroupManager.logger.severe("===================================================");
|
||||
GroupManager.logger.severe("= ERROR REPORT START =");
|
||||
GroupManager.logger.severe("= ERROR REPORT START =");
|
||||
GroupManager.logger.severe("===================================================");
|
||||
GroupManager.logger.severe("= COPY AND PASTE THIS TO GROUPMANAGER DEVELOPER =");
|
||||
GroupManager.logger.severe("= COPY AND PASTE THIS TO GROUPMANAGER DEVELOPER =");
|
||||
GroupManager.logger.severe("===================================================");
|
||||
GroupManager.logger.severe(this.getDescription().getName());
|
||||
GroupManager.logger.severe(this.getDescription().getVersion());
|
||||
@@ -265,7 +301,7 @@ public class GroupManager extends JavaPlugin {
|
||||
GroupManager.logger.severe(val.name());
|
||||
}
|
||||
GroupManager.logger.severe("===================================================");
|
||||
GroupManager.logger.severe("= ERROR REPORT ENDED =");
|
||||
GroupManager.logger.severe("= ERROR REPORT ENDED =");
|
||||
GroupManager.logger.severe("===================================================");
|
||||
sender.sendMessage("An error occurred. Ask the admin to take a look at the console.");
|
||||
}
|
||||
@@ -275,13 +311,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manuadd:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -301,27 +336,47 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
||||
return false;
|
||||
}
|
||||
|
||||
//VALIDANDO PERMISSAO
|
||||
if (!isConsole && !senderPlayer.isOp() && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
|
||||
return false;
|
||||
}
|
||||
if (!isConsole && !senderPlayer.isOp() && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
||||
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
||||
return false;
|
||||
}
|
||||
if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
||||
sender.sendMessage(ChatColor.RED + "Can't modify player involving a group that you don't inherit.");
|
||||
return false;
|
||||
}
|
||||
if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
||||
sender.sendMessage(ChatColor.RED + "Can't modify player using groups with different heritage line.");
|
||||
return false;
|
||||
}
|
||||
if (!isConsole && !senderPlayer.isOp() && (!permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
||||
sender.sendMessage(ChatColor.RED + "The new group must be a higher rank.");
|
||||
return false;
|
||||
}
|
||||
|
||||
//PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
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);
|
||||
|
||||
return true;
|
||||
//break;
|
||||
case manudel:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -344,18 +399,23 @@ public class GroupManager extends JavaPlugin {
|
||||
//PARECE OK
|
||||
dataHolder.removeUser(auxUser.getName());
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' to default settings.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null) BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
case manuaddsub:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender)) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -384,17 +444,19 @@ public class GroupManager extends JavaPlugin {
|
||||
auxUser.addSubGroup(auxGroup);
|
||||
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);
|
||||
|
||||
return true;
|
||||
case manudelsub:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub <user> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -418,17 +480,19 @@ 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);
|
||||
|
||||
return true;
|
||||
case mangadd:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -444,13 +508,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case mangdel:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -462,17 +525,18 @@ public class GroupManager extends JavaPlugin {
|
||||
dataHolder.removeGroup(auxGroup.getName());
|
||||
sender.sendMessage(ChatColor.YELLOW + "You deleted a group named " + auxGroup.getName() + ", it's users are default group now.");
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
case manuaddp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -526,18 +590,21 @@ public class GroupManager extends JavaPlugin {
|
||||
//PARECE OK
|
||||
auxUser.addPermission(args[1]);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You added '" + args[1] + "' to player '" + auxUser.getName() + "' permissions.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null) BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
//break;
|
||||
case manudelp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -577,27 +644,31 @@ public class GroupManager extends JavaPlugin {
|
||||
//PARECE OK
|
||||
auxUser.removePermission(args[1]);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You removed '" + args[1] + "' from player '" + auxUser.getName() + "' permissions.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null) BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
//break;
|
||||
case manulistp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
if ((args.length == 0) || (args.length > 2)) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> (+))");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
targetPlayer = this.getServer().getPlayer(match.get(0).getName());
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
@@ -634,25 +705,38 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.YELLOW + "And all permissions from subgroups: " + auxString);
|
||||
}
|
||||
}
|
||||
|
||||
//bukkit perms
|
||||
if ((args.length == 2) && (args[1].equalsIgnoreCase("+"))) {
|
||||
if (targetPlayer != null) {
|
||||
sender.sendMessage(ChatColor.YELLOW + "Superperms reports: ");
|
||||
for(String line: BukkitPermissions.listPerms(targetPlayer))
|
||||
sender.sendMessage(ChatColor.YELLOW + line);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
case manucheckp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateOnlinePlayer) {
|
||||
match = this.getServer().matchPlayer(args[0]);
|
||||
if (match.size() != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
targetPlayer = this.getServer().getPlayer(match.get(0).getName());
|
||||
}
|
||||
if (match != null) {
|
||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
||||
@@ -682,17 +766,23 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
}
|
||||
|
||||
// superperms
|
||||
if (targetPlayer != null) {
|
||||
sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]));
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
case mangaddp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -735,17 +825,19 @@ public class GroupManager extends JavaPlugin {
|
||||
//PARECE OK
|
||||
auxGroup.addPermission(args[1]);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You added '" + args[1] + "' to group '" + auxGroup.getName() + "' permissions.");
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
case mangdelp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -775,17 +867,18 @@ public class GroupManager extends JavaPlugin {
|
||||
auxGroup.removePermission(args[1]);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You removed '" + args[1] + "' from group '" + auxGroup.getName() + "' permissions.");
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
case manglistp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -828,13 +921,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case mangcheckp:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -863,13 +955,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case mangaddi:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group1> <group2>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -889,19 +980,20 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
//PARECE OK
|
||||
auxGroup.addInherits(auxGroup2);
|
||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup2.getName() + " is now in " + auxGroup.getName() + " inheritance list.");
|
||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup2.getName() + " is now in " + auxGroup.getName() + " inheritance list.");
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
case mangdeli:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group1> <group2>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -925,19 +1017,20 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
//PARECE OK
|
||||
auxGroup.removeInherits(auxGroup2.getName());
|
||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup2.getName() + " was removed from " + auxGroup.getName() + " inheritance list.");
|
||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup2.getName() + " was removed from " + auxGroup.getName() + " inheritance list.");
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
case manuaddv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length < 3) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable> <value>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -967,13 +1060,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manudelv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -999,13 +1091,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manulistv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1037,13 +1128,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manucheckv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1080,13 +1170,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case mangaddv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length < 3) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <variable> <value>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -1110,13 +1199,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case mangdelv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <variable>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -1136,13 +1224,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manglistv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -1174,13 +1261,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case mangcheckv:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <variable>)");
|
||||
return false;
|
||||
}
|
||||
auxGroup = dataHolder.getGroup(args[0]);
|
||||
@@ -1202,13 +1288,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manwhois:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1237,13 +1322,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case tempadd:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1276,13 +1360,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case tempdel:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1317,9 +1400,8 @@ public class GroupManager extends JavaPlugin {
|
||||
case templist:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//WORKING
|
||||
auxString = "";
|
||||
@@ -1347,9 +1429,8 @@ public class GroupManager extends JavaPlugin {
|
||||
case tempdelall:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//WORKING
|
||||
removeList = new ArrayList<User>();
|
||||
@@ -1385,18 +1466,28 @@ public class GroupManager extends JavaPlugin {
|
||||
auxString += " ";
|
||||
}
|
||||
}
|
||||
|
||||
isLoaded = false; // Disable Bukkit Perms update
|
||||
|
||||
worldsHolder.loadWorld(auxString);
|
||||
sender.sendMessage("The request to world '" + auxString + "' was sent.");
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//WORKING
|
||||
config.load();
|
||||
|
||||
isLoaded = false;
|
||||
|
||||
if (args.length > 0) {
|
||||
auxString = "";
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
@@ -1412,13 +1503,17 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.YELLOW + " The current world was reloaded.");
|
||||
}
|
||||
worldsHolder.mirrorSetUp();
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
BukkitPermissions.updateAllPlayers();
|
||||
|
||||
return true;
|
||||
case listgroups:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//WORKING
|
||||
auxString = "";
|
||||
@@ -1433,13 +1528,12 @@ public class GroupManager extends JavaPlugin {
|
||||
case manpromote:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1483,19 +1577,21 @@ public class GroupManager extends JavaPlugin {
|
||||
//PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + ".");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null) BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
//break;
|
||||
case mandemote:
|
||||
//VALIDANDO ESTADO DO SENDER
|
||||
if (dataHolder == null || permissionHandler == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return true;
|
||||
if (!setDefaultWorldHandler(sender))
|
||||
return true;
|
||||
}
|
||||
//VALIDANDO ARGUMENTOS
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||
return false;
|
||||
}
|
||||
if (validateOnlinePlayer) {
|
||||
@@ -1539,6 +1635,9 @@ public class GroupManager extends JavaPlugin {
|
||||
//PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + ".");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
if (targetPlayer != null) BukkitPermissions.updatePermissions(targetPlayer);
|
||||
|
||||
return true;
|
||||
//break;
|
||||
@@ -1575,7 +1674,7 @@ public class GroupManager extends JavaPlugin {
|
||||
return true;
|
||||
case manselect:
|
||||
if (args.length < 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count!");
|
||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <world>)");
|
||||
sender.sendMessage(ChatColor.YELLOW + "Worlds available: ");
|
||||
ArrayList<OverloadedWorldHolder> worlds = worldsHolder.allWorldsDataList();
|
||||
auxString = "";
|
||||
@@ -1619,6 +1718,26 @@ public class GroupManager extends JavaPlugin {
|
||||
sender.sendMessage(ChatColor.RED + "You are not allowed to use that command.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the default world for use.
|
||||
*/
|
||||
private boolean setDefaultWorldHandler(CommandSender sender) {
|
||||
|
||||
dataHolder = worldsHolder.getWorldData(worldsHolder.getDefaultWorld().getName());
|
||||
permissionHandler = dataHolder.getPermissionsHandler();
|
||||
selectedWorlds.put(sender, dataHolder.getName());
|
||||
|
||||
if ((dataHolder != null) && (permissionHandler != null)) {
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. Default world '" + worldsHolder.getDefaultWorld().getName() + "' selected.");
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed.");
|
||||
sender.sendMessage(ChatColor.RED + "Use /manselect <world>");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the config
|
||||
@@ -1633,4 +1752,4 @@ public class GroupManager extends JavaPlugin {
|
||||
public File getBackupFolder() {
|
||||
return backupFolder;
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package org.anjocaido.groupmanager.Tasks;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
|
||||
/*
|
||||
*
|
||||
* Created by ElgarL
|
||||
*
|
||||
*/
|
||||
|
||||
public class BukkitPermsUpdateTask implements Runnable {
|
||||
|
||||
public BukkitPermsUpdateTask() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Signal loaded and update BukkitPermissions.
|
||||
GroupManager.setLoaded(true);
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
|
||||
GroupManager.logger.info("Bukkit Permissions Updated!");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Regular → Executable
+8
-11
@@ -27,7 +27,7 @@ public abstract class DataUnit {
|
||||
}
|
||||
|
||||
/**
|
||||
* Every group is matched only by their names and DataSources names.
|
||||
* Every group is matched only by their names and DataSources names.
|
||||
* @param o
|
||||
* @return true if they are equal. false if not.
|
||||
*/
|
||||
@@ -49,9 +49,6 @@ public abstract class DataUnit {
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the dataSource
|
||||
*/
|
||||
@@ -67,10 +64,10 @@ public abstract class DataUnit {
|
||||
}
|
||||
|
||||
public void flagAsChanged() {
|
||||
GroupManager.logger.finest("DataSource: "+getDataSource().getName()+" - DataUnit: "+getName()+" flagged as changed!");
|
||||
// for(StackTraceElement st: Thread.currentThread().getStackTrace()){
|
||||
// GroupManager.logger.finest(st.toString());
|
||||
// }
|
||||
GroupManager.logger.finest("DataSource: " + getDataSource().getName() + " - DataUnit: " + getName() + " flagged as changed!");
|
||||
// for(StackTraceElement st: Thread.currentThread().getStackTrace()){
|
||||
// GroupManager.logger.finest(st.toString());
|
||||
// }
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -79,7 +76,7 @@ public abstract class DataUnit {
|
||||
}
|
||||
|
||||
public void flagAsSaved() {
|
||||
GroupManager.logger.finest("DataSource: "+getDataSource().getName()+" - DataUnit: "+getName()+" flagged as saved!");
|
||||
GroupManager.logger.finest("DataSource: " + getDataSource().getName() + " - DataUnit: " + getName() + " flagged as saved!");
|
||||
changed = false;
|
||||
}
|
||||
|
||||
@@ -108,7 +105,7 @@ public abstract class DataUnit {
|
||||
return (ArrayList<String>) permissions.clone();
|
||||
}
|
||||
|
||||
public void sortPermissions(){
|
||||
public void sortPermissions() {
|
||||
Collections.sort(permissions, StringPermissionComparator.getInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
package org.anjocaido.groupmanager.data;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
@@ -30,18 +31,18 @@ public class Group extends DataUnit implements Cloneable {
|
||||
* @param name
|
||||
*/
|
||||
public Group(WorldDataHolder source, String name) {
|
||||
super(source,name);
|
||||
super(source, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone this group
|
||||
* Clone this group
|
||||
* @return a clone of this group
|
||||
*/
|
||||
@Override
|
||||
public Group clone() {
|
||||
Group clone = new Group(getDataSource(), this.getName());
|
||||
clone.inherits = ((ArrayList<String>) this.getInherits().clone());
|
||||
for(String perm: this.getPermissionList()){
|
||||
for (String perm : this.getPermissionList()) {
|
||||
clone.addPermission(perm);
|
||||
}
|
||||
clone.variables = ((GroupVariables) variables).clone(clone);
|
||||
@@ -52,7 +53,7 @@ public class Group extends DataUnit implements Cloneable {
|
||||
/**
|
||||
* Use this to deliver a group from a different dataSource to another
|
||||
* @param dataSource
|
||||
* @return
|
||||
* @return Null or Clone
|
||||
*/
|
||||
public Group clone(WorldDataHolder dataSource) {
|
||||
if (dataSource.groupExists(this.getName())) {
|
||||
@@ -60,7 +61,7 @@ public class Group extends DataUnit implements Cloneable {
|
||||
}
|
||||
Group clone = getDataSource().createGroup(this.getName());
|
||||
clone.inherits = ((ArrayList<String>) this.getInherits().clone());
|
||||
for(String perm: this.getPermissionList()){
|
||||
for (String perm : this.getPermissionList()) {
|
||||
clone.addPermission(perm);
|
||||
}
|
||||
clone.variables = variables.clone(clone);
|
||||
@@ -79,7 +80,7 @@ public class Group extends DataUnit implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param inherits the inherits to set
|
||||
* @param inherit the inherits to set
|
||||
*/
|
||||
public void addInherits(Group inherit) {
|
||||
if (!this.getDataSource().groupExists(inherit.getName())) {
|
||||
@@ -89,6 +90,8 @@ public class Group extends DataUnit implements Cloneable {
|
||||
inherits.add(inherit.getName().toLowerCase());
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
}
|
||||
|
||||
public boolean removeInherits(String inherit) {
|
||||
@@ -108,15 +111,17 @@ public class Group extends DataUnit implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param varList
|
||||
*/
|
||||
public void setVariables(Map<String, Object> varList) {
|
||||
GroupVariables temp = new GroupVariables(this, varList);
|
||||
variables.clearVars();
|
||||
for(String key: temp.getVarKeyList()){
|
||||
for (String key : temp.getVarKeyList()) {
|
||||
variables.addVar(key, temp.getVarObject(key));
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
}
|
||||
}
|
||||
Regular → Executable
+1
-1
@@ -45,7 +45,7 @@ public class GroupVariables extends Variables implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
* A clone of all vars here.
|
||||
* A clone of all vars here.
|
||||
* @return
|
||||
*/
|
||||
protected GroupVariables clone(Group newOwner) {
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
*/
|
||||
package org.anjocaido.groupmanager.data;
|
||||
|
||||
import com.sun.org.apache.bcel.internal.generic.AALOAD;
|
||||
//import com.sun.org.apache.bcel.internal.generic.AALOAD;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -27,13 +29,12 @@ public class User extends DataUnit implements Cloneable {
|
||||
*/
|
||||
private UserVariables variables = new UserVariables(this);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
public User(WorldDataHolder source, String name) {
|
||||
super(source,name);
|
||||
super(source, name);
|
||||
this.group = source.getDefaultGroup().getName();
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ public class User extends DataUnit implements Cloneable {
|
||||
public User clone() {
|
||||
User clone = new User(getDataSource(), this.getName());
|
||||
clone.group = this.group;
|
||||
for(String perm: this.getPermissionList()){
|
||||
for (String perm : this.getPermissionList()) {
|
||||
clone.addPermission(perm);
|
||||
}
|
||||
//clone.variables = this.variables.clone();
|
||||
@@ -68,7 +69,7 @@ public class User extends DataUnit implements Cloneable {
|
||||
} else {
|
||||
clone.setGroup(this.getGroupName());
|
||||
}
|
||||
for(String perm: this.getPermissionList()){
|
||||
for (String perm : this.getPermissionList()) {
|
||||
clone.addPermission(perm);
|
||||
}
|
||||
//clone.variables = this.variables.clone();
|
||||
@@ -103,6 +104,9 @@ public class User extends DataUnit implements Cloneable {
|
||||
public void setGroup(String group) {
|
||||
this.group = group;
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
if(GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,45 +119,58 @@ public class User extends DataUnit implements Cloneable {
|
||||
group = getDataSource().getGroup(group.getName());
|
||||
this.group = group.getName();
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
}
|
||||
|
||||
public void addSubGroup(Group subGroup){
|
||||
if(this.group.equalsIgnoreCase(subGroup.getName())){
|
||||
public void addSubGroup(Group subGroup) {
|
||||
if (this.group.equalsIgnoreCase(subGroup.getName())) {
|
||||
return;
|
||||
}
|
||||
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();
|
||||
}
|
||||
public int subGroupsSize(){
|
||||
|
||||
public int subGroupsSize() {
|
||||
return subGroups.size();
|
||||
}
|
||||
public boolean isSubGroupsEmpty(){
|
||||
|
||||
public boolean isSubGroupsEmpty() {
|
||||
return subGroups.isEmpty();
|
||||
}
|
||||
public boolean containsSubGroup(Group subGroup){
|
||||
|
||||
public boolean containsSubGroup(Group subGroup) {
|
||||
return subGroups.contains(subGroup.getName());
|
||||
}
|
||||
public boolean removeSubGroup(Group subGroup){
|
||||
try{
|
||||
if(subGroups.remove(subGroup.getName())){
|
||||
|
||||
public boolean removeSubGroup(Group subGroup) {
|
||||
try {
|
||||
if (subGroups.remove(subGroup.getName())) {
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e){
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public ArrayList<Group> subGroupListCopy(){
|
||||
|
||||
public ArrayList<Group> subGroupListCopy() {
|
||||
ArrayList<Group> val = new ArrayList<Group>();
|
||||
for(String gstr: subGroups){
|
||||
for (String gstr : subGroups) {
|
||||
Group g = getDataSource().getGroup(gstr);
|
||||
if(g==null){
|
||||
if (g == null) {
|
||||
removeSubGroup(g);
|
||||
continue;
|
||||
}
|
||||
@@ -161,7 +178,8 @@ public class User extends DataUnit implements Cloneable {
|
||||
}
|
||||
return val;
|
||||
}
|
||||
public ArrayList<String> subGroupListStringCopy(){
|
||||
|
||||
public ArrayList<String> subGroupListStringCopy() {
|
||||
return (ArrayList<String>) subGroups.clone();
|
||||
}
|
||||
|
||||
@@ -179,9 +197,12 @@ public class User extends DataUnit implements Cloneable {
|
||||
public void setVariables(Map<String, Object> varList) {
|
||||
UserVariables temp = new UserVariables(this, varList);
|
||||
variables.clearVars();
|
||||
for(String key: temp.getVarKeyList()){
|
||||
for (String key : temp.getVarKeyList()) {
|
||||
variables.addVar(key, temp.getVarObject(key));
|
||||
}
|
||||
flagAsChanged();
|
||||
if (GroupManager.isLoaded())
|
||||
if (GroupManager.BukkitPermissions.player_join = false)
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
}
|
||||
}
|
||||
Regular → Executable
+8
-5
@@ -2,7 +2,6 @@
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package org.anjocaido.groupmanager.data;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -11,19 +10,23 @@ import java.util.Map;
|
||||
*
|
||||
* @author gabrielcouto
|
||||
*/
|
||||
public class UserVariables extends Variables{
|
||||
public class UserVariables extends Variables {
|
||||
|
||||
private User owner;
|
||||
public UserVariables(User owner){
|
||||
|
||||
public UserVariables(User owner) {
|
||||
super(owner);
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public UserVariables(User owner, Map<String, Object> varList) {
|
||||
super(owner);
|
||||
this.variables = varList;
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* A clone of all vars here.
|
||||
* A clone of all vars here.
|
||||
* @return
|
||||
*/
|
||||
protected UserVariables clone(User newOwner) {
|
||||
@@ -34,6 +37,7 @@ public class UserVariables extends Variables{
|
||||
newOwner.flagAsChanged();
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the owner
|
||||
*/
|
||||
@@ -41,5 +45,4 @@ public class UserVariables extends Variables{
|
||||
public User getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
}
|
||||
Regular → Executable
+8
-6
@@ -19,12 +19,14 @@ import java.util.Set;
|
||||
* @author gabrielcouto
|
||||
*/
|
||||
public abstract class Variables implements Cloneable {
|
||||
|
||||
private DataUnit owner;
|
||||
protected Map<String, Object> variables = new HashMap<String, Object>();
|
||||
|
||||
public Variables(DataUnit owner){
|
||||
public Variables(DataUnit owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add var to the the INFO node.
|
||||
* examples:
|
||||
@@ -45,7 +47,7 @@ public abstract class Variables implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the object inside the var
|
||||
* Returns the object inside the var
|
||||
* @param name
|
||||
* @return a Object if exists. null if doesn't exists
|
||||
*/
|
||||
@@ -112,7 +114,7 @@ public abstract class Variables implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
* All variable keys this is holding
|
||||
* All variable keys this is holding
|
||||
* @return
|
||||
*/
|
||||
public Set<String> getVarKeyList() {
|
||||
@@ -122,7 +124,7 @@ public abstract class Variables implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
* verify is a var exists
|
||||
* verify is a var exists
|
||||
* @param name the key name of the var
|
||||
* @return true if that var exists
|
||||
*/
|
||||
@@ -174,7 +176,7 @@ public abstract class Variables implements Cloneable {
|
||||
|
||||
}
|
||||
|
||||
public void clearVars(){
|
||||
public void clearVars() {
|
||||
variables.clear();
|
||||
owner.flagAsChanged();
|
||||
}
|
||||
@@ -186,7 +188,7 @@ public abstract class Variables implements Cloneable {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public boolean isEmpty(){
|
||||
public boolean isEmpty() {
|
||||
return variables.isEmpty();
|
||||
}
|
||||
}
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user