mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-22 16:11:22 +01:00
Merge branch 'master' into release
~ GM needs testing before release ~
This commit is contained in:
commit
d16fef9f7f
@ -922,6 +922,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -933,6 +941,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=51b33957
|
||||
nbproject/build-impl.xml.script.CRC32=c8376938
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=c5170bed
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,8 +4,8 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=a830bc14
|
||||
nbproject/build-impl.xml.script.CRC32=40df7eaf
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=a9f8842a
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15
|
||||
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
|
||||
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1
|
||||
|
@ -54,6 +54,10 @@ public class Enchantments
|
||||
ENCHANTMENTS.put("silktouch", Enchantment.SILK_TOUCH);
|
||||
ENCHANTMENTS.put("waterworker", Enchantment.WATER_WORKER);
|
||||
ENCHANTMENTS.put("aquaaffinity", Enchantment.WATER_WORKER);
|
||||
ENCHANTMENTS.put("firearrow", Enchantment.ARROW_FIRE);
|
||||
ENCHANTMENTS.put("arrowdamage", Enchantment.ARROW_DAMAGE);
|
||||
ENCHANTMENTS.put("arrowknockback", Enchantment.ARROW_KNOCKBACK);
|
||||
ENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE);
|
||||
}
|
||||
|
||||
public static Enchantment getByName(String name) {
|
||||
|
@ -36,7 +36,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -61,7 +60,7 @@ import org.yaml.snakeyaml.error.YAMLException;
|
||||
|
||||
public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
public static final int BUKKIT_VERSION = 1597;
|
||||
public static final int BUKKIT_VERSION = 1713;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient ISettings settings;
|
||||
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
||||
@ -440,7 +439,12 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
}
|
||||
if (base instanceof String)
|
||||
{
|
||||
return userMap.getUser((String)base);
|
||||
final User user = userMap.getUser((String)base);
|
||||
if (user != null && user.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
((OfflinePlayer)user.getBase()).setName((String)base);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -472,7 +476,12 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||
@Override
|
||||
public User getOfflineUser(final String name)
|
||||
{
|
||||
return userMap.getUser(name);
|
||||
final User user = userMap.getUser(name);
|
||||
if (user != null && user.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
((OfflinePlayer)user.getBase()).setName(name);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,11 +26,11 @@ import org.bukkit.util.Vector;
|
||||
public class OfflinePlayer implements Player
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
private Location location = new Location(null, 0, 0, 0, 0, 0);
|
||||
private World world;
|
||||
private UUID uniqueId = UUID.randomUUID();
|
||||
private transient Location location = new Location(null, 0, 0, 0, 0, 0);
|
||||
private transient World world;
|
||||
private final transient UUID uniqueId = UUID.randomUUID();
|
||||
@Delegate(types = org.bukkit.OfflinePlayer.class)
|
||||
private final org.bukkit.OfflinePlayer base;
|
||||
private transient org.bukkit.OfflinePlayer base;
|
||||
|
||||
public OfflinePlayer(final String name, final IEssentials ess)
|
||||
{
|
||||
@ -822,4 +822,11 @@ public class OfflinePlayer implements Player
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
void setName(final String name)
|
||||
{
|
||||
if (!this.base.getName().equalsIgnoreCase(name)) {
|
||||
this.base = ess.getServer().getOfflinePlayer(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
lastLogout = _getLastLogout();
|
||||
lastLoginAddress = _getLastLoginAddress();
|
||||
afk = getAfk();
|
||||
newplayer = getNew();
|
||||
geolocation = _getGeoLocation();
|
||||
isSocialSpyEnabled = _isSocialSpyEnabled();
|
||||
isNPC = _isNPC();
|
||||
@ -736,22 +735,6 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
}
|
||||
private boolean newplayer;
|
||||
|
||||
private boolean getNew()
|
||||
{
|
||||
return config.getBoolean("newplayer", true);
|
||||
}
|
||||
|
||||
public boolean isNew()
|
||||
{
|
||||
return newplayer;
|
||||
}
|
||||
|
||||
public void setNew(boolean set)
|
||||
{
|
||||
newplayer = set;
|
||||
config.setProperty("newplayer", set);
|
||||
config.save();
|
||||
}
|
||||
private String geolocation;
|
||||
|
||||
private String _getGeoLocation()
|
||||
|
@ -47,7 +47,7 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
continue;
|
||||
}
|
||||
final String name = string.substring(0, string.length() - 4);
|
||||
keys.add(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.add(Util.sanitizeFileName(name));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -55,14 +55,14 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
|
||||
public boolean userExists(final String name)
|
||||
{
|
||||
return keys.contains(name.toLowerCase(Locale.ENGLISH));
|
||||
return keys.contains(Util.sanitizeFileName(name));
|
||||
}
|
||||
|
||||
public User getUser(final String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
return users.get(name.toLowerCase(Locale.ENGLISH));
|
||||
return users.get(Util.sanitizeFileName(name));
|
||||
}
|
||||
catch (ExecutionException ex)
|
||||
{
|
||||
@ -81,14 +81,14 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
{
|
||||
if (player.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
keys.add(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.add(Util.sanitizeFileName(name));
|
||||
return new User(player, ess);
|
||||
}
|
||||
}
|
||||
final File userFile = getUserFile(name);
|
||||
if (userFile.exists())
|
||||
{
|
||||
keys.add(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.add(Util.sanitizeFileName(name));
|
||||
return new User(new OfflinePlayer(name, ess), ess);
|
||||
}
|
||||
throw new Exception("User not found!");
|
||||
@ -102,8 +102,8 @@ public class UserMap extends CacheLoader<String, User> implements IConf
|
||||
|
||||
public void removeUser(final String name)
|
||||
{
|
||||
keys.remove(name.toLowerCase(Locale.ENGLISH));
|
||||
users.invalidate(name.toLowerCase(Locale.ENGLISH));
|
||||
keys.remove(Util.sanitizeFileName(name));
|
||||
users.invalidate(Util.sanitizeFileName(name));
|
||||
}
|
||||
|
||||
public Set<String> getAllUniqueUsers()
|
||||
|
@ -112,7 +112,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
final User user = ess.getUserMap().getUser(u);
|
||||
if (user != null)
|
||||
{
|
||||
balances.put(u, user.getMoney());
|
||||
balances.put(user.getDisplayName(), user.getMoney());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,11 @@ public class Commandpay extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
if (args[0] == "")
|
||||
{
|
||||
throw new NotEnoughArgumentsException("You need to specify a player to pay.");
|
||||
}
|
||||
|
||||
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
|
||||
|
||||
|
@ -253,10 +253,7 @@ register-back-in-listener: false
|
||||
# +------------------------------------------------------+ #
|
||||
############################################################
|
||||
|
||||
# When users die, should they respawn at their first home, instead of the spawnpoint or bed?
|
||||
respawn-at-home: false
|
||||
|
||||
# If no home is set send you to bed or spawn when /home is used
|
||||
# If no home is set, send players to spawn when /home is used
|
||||
spawn-if-no-home: true
|
||||
|
||||
# Allows people to set their bed at daytime
|
||||
@ -532,8 +529,11 @@ newbies:
|
||||
spawnpoint: newbies
|
||||
|
||||
# Set this to lowest, if you want Multiverse to handle the respawning
|
||||
# Set this to normal, if you want EssentialsSpawn to handle the respawning
|
||||
# Set this to high, if you want EssentialsSpawn to handle the respawning
|
||||
# Set this to highest, if you want to force EssentialsSpawn to handle the respawning
|
||||
respawn-listener-priority: normal
|
||||
respawn-listener-priority: high
|
||||
|
||||
# When users die, should they respawn at their first home or bed, instead of the spawnpoint?
|
||||
respawn-at-home: false
|
||||
|
||||
# End of File <-- No seriously, you're done with configuration.
|
||||
|
@ -2429,6 +2429,30 @@ glisteringmelon,382,0
|
||||
shiningmelon,382,0
|
||||
gmelon,382,0
|
||||
smelon,382,0
|
||||
creeperegg,383,50
|
||||
skeletonegg,383,51
|
||||
spideregg,383,52
|
||||
giantegg,383,53
|
||||
zombieegg,383,54
|
||||
slimeegg,383,55
|
||||
ghastegg,383,56
|
||||
zombiepigmanegg,383,57
|
||||
pigmanegg,383,57
|
||||
endermanegg,383,58
|
||||
cavespideregg,383,59
|
||||
silverfishegg,383,60
|
||||
blazeegg,383,61
|
||||
lavaslimeegg,383,62
|
||||
magmacubeegg,383,63
|
||||
pigegg,383,90
|
||||
sheepegg,383,91
|
||||
cowegg,383,92
|
||||
chickenegg,383,93
|
||||
squidegg,383,94
|
||||
wolfegg,383,95
|
||||
mooshroomegg,383,96
|
||||
mushroomcowegg,383,96
|
||||
villageregg,383,120
|
||||
goldmusicrecord,2256,0
|
||||
goldmusicdisk,2256,0
|
||||
goldmusiccd,2256,0
|
||||
|
|
@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=7c7f517b
|
||||
nbproject/build-impl.xml.script.CRC32=4e36cf00
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=52184b61
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=cbf94f59
|
||||
nbproject/build-impl.xml.script.CRC32=ae9285d7
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=db2bb7a7
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -848,6 +848,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -859,6 +867,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=475c8f4d
|
||||
nbproject/build-impl.xml.script.CRC32=aa68bcd9
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=c7581402
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -841,6 +841,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -852,6 +860,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=a6709b83
|
||||
nbproject/build-impl.xml.script.CRC32=142d30c4
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=fe0fea25
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -85,4 +85,16 @@ v 1.7:
|
||||
- Offline player checks now support partial name matches.
|
||||
- Added custom events so plugins can now be notified of changes within GroupManager.
|
||||
- GM now registers with Bukkits ServicesManager.
|
||||
- deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException.
|
||||
- deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException.
|
||||
- Removed op permissions from admins in the default GloblaGroups.yml.
|
||||
v 1.8:
|
||||
- Changed ServicesManager registration to lowest from normal.
|
||||
- Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup.
|
||||
- manpromote and mandemote now correctly send the notification to the console if the command was issued there.
|
||||
- Expanded GlobalGroups.yml and Groups.yml to include Towny permissions.
|
||||
- Delayed GroupManager events so Superperms will be fully updated before plugins receive the events.
|
||||
- Changed the way events are raised to prevent variable corruption.
|
||||
- Reload GlobalGroups when you perform a world load.
|
||||
- Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading
|
||||
- Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit.
|
||||
- Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time.
|
@ -4,9 +4,9 @@ settings:
|
||||
# The user will be able to promote players to the same group or even above.
|
||||
opOverrides: true
|
||||
|
||||
# If enabled any plugins bukkit permissions which default to true will be left enabled.
|
||||
# If enabled any bukkit permissiosn which default to true will be left enabled.
|
||||
# If the player is op any permissions set to Op will follow suit.
|
||||
bukkit_perms_override: false
|
||||
bukkit_perms_override: true
|
||||
|
||||
# Default setting for 'mantoglevalidate'
|
||||
# true will cause GroupManager to attempt name matching by default.
|
||||
|
@ -1,9 +1,5 @@
|
||||
groups:
|
||||
|
||||
g:bukkit_default:
|
||||
permissions:
|
||||
- bukkit.broadcast.user
|
||||
|
||||
g:essentials_default:
|
||||
permissions:
|
||||
- essentials.help
|
||||
@ -129,6 +125,11 @@ groups:
|
||||
- groupmanager.manucheckp
|
||||
- groupmanager.manulistp
|
||||
|
||||
g:bukkit_default:
|
||||
permissions:
|
||||
- bukkit.broadcast.user
|
||||
- -bukkit.command.plugins
|
||||
|
||||
g:bukkit_moderator:
|
||||
permissions:
|
||||
- bukkit.command.ban
|
||||
@ -150,9 +151,9 @@ groups:
|
||||
- bukkit.command.kill
|
||||
- bukkit.command.list
|
||||
- bukkit.command.me
|
||||
- bukkit.command.op
|
||||
- bukkit.command.op.give
|
||||
- bukkit.command.op.take
|
||||
- -bukkit.command.op
|
||||
- -bukkit.command.op.give
|
||||
- -bukkit.command.op.take
|
||||
- bukkit.command.plugins
|
||||
- bukkit.command.reload
|
||||
- bukkit.command.save
|
||||
@ -174,3 +175,52 @@ groups:
|
||||
- bukkit.command.whitelist.list
|
||||
- bukkit.command.whitelist.reload
|
||||
- bukkit.command.whitelist.remove
|
||||
|
||||
g:towny_builder:
|
||||
permissions:
|
||||
- towny.town.*
|
||||
- towny.nation.*
|
||||
- towny.chat.tc
|
||||
- towny.chat.nc
|
||||
- towny.wild.block.6.*
|
||||
- towny.wild.block.14.destroy
|
||||
- towny.wild.block.15.destroy
|
||||
- towny.wild.block.16.destroy
|
||||
- towny.wild.block.17.*
|
||||
- towny.wild.block.18.destroy
|
||||
- towny.wild.block.21.destroy
|
||||
- towny.wild.block.31.destroy
|
||||
- towny.wild.block.37.destroy
|
||||
- towny.wild.block.38.destroy
|
||||
- towny.wild.block.39.destroy
|
||||
- towny.wild.block.40.destroy
|
||||
- towny.wild.block.50.destroy
|
||||
- towny.wild.block.56.destroy
|
||||
- towny.wild.block.73.destroy
|
||||
- towny.wild.block.74.destroy
|
||||
- towny.wild.block.78.destroy
|
||||
- towny.wild.block.81.destroy
|
||||
- towny.wild.block.82.destroy
|
||||
- towny.wild.block.83.destroy
|
||||
- towny.wild.block.86.destroy
|
||||
- towny.wild.block.103.destroy
|
||||
- towny.wild.block.106.destroy
|
||||
- towny.wild.block.111.destroy
|
||||
- towny.wild.block.115.destroy
|
||||
|
||||
g:towny_moderator:
|
||||
permissions:
|
||||
- towny.chat.mod
|
||||
- towny.wild.block.64.switch
|
||||
- towny.wild.block.83.build
|
||||
- towny.wild.block.86.build
|
||||
- towny.wild.block.103.build
|
||||
- towny.wild.block.111.build
|
||||
- towny.wild.block.115.build
|
||||
|
||||
g:towny_admin:
|
||||
permissions:
|
||||
- towny.admin
|
||||
- -towny.wild.block.119.destroy
|
||||
- -towny.wild.block.120.destroy
|
||||
- towny.chat.admin
|
@ -24,6 +24,7 @@ groups:
|
||||
inheritance:
|
||||
- default
|
||||
- g:essentials_builder
|
||||
- g:towny_moderator
|
||||
info:
|
||||
prefix: '&2'
|
||||
build: true
|
||||
@ -35,6 +36,7 @@ groups:
|
||||
- builder
|
||||
- g:essentials_moderator
|
||||
- g:bukkit_moderator
|
||||
- g:towny_moderator
|
||||
info:
|
||||
prefix: '&5'
|
||||
build: true
|
||||
@ -46,6 +48,7 @@ groups:
|
||||
- moderator
|
||||
- g:essentials_admin
|
||||
- g:bukkit_admin
|
||||
- g:towny_admin
|
||||
info:
|
||||
prefix: '&c'
|
||||
build: true
|
||||
|
@ -161,7 +161,7 @@ public class GroupManager extends JavaPlugin {
|
||||
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
|
||||
// Register as a service
|
||||
this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Normal);
|
||||
this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Lowest);
|
||||
}
|
||||
|
||||
public static boolean isLoaded() {
|
||||
@ -415,7 +415,7 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
// PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
if (!sender.hasPermission("groupmanager.notify.other"))
|
||||
if (!sender.hasPermission("groupmanager.notify.other") || (isConsole))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "'.");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
@ -787,29 +787,29 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
// VALIDANDO PERMISSAO
|
||||
permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]);
|
||||
permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false);
|
||||
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||
//No permissions found in GM so fall through and check Bukkit.
|
||||
sender.sendMessage(ChatColor.RED + "The player doesn't have access to that permission");
|
||||
sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]));
|
||||
return false;
|
||||
}
|
||||
// PARECE OK
|
||||
// auxString =
|
||||
// permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
||||
if (permissionResult.owner instanceof User) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
|
||||
|
||||
} else {
|
||||
// This permission was found in groupmanager.
|
||||
if (permissionResult.owner instanceof User) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
} else if (permissionResult.owner instanceof Group) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName());
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
} else if (permissionResult.owner instanceof Group) {
|
||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||
sender.sendMessage(ChatColor.RED + "The user inherits the a negation permission from group: " + permissionResult.owner.getName());
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
||||
}
|
||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||
}
|
||||
|
||||
// superperms
|
||||
@ -1504,7 +1504,9 @@ public class GroupManager extends JavaPlugin {
|
||||
|
||||
isLoaded = false; // Disable Bukkit Perms update
|
||||
|
||||
globalGroups.load();
|
||||
worldsHolder.loadWorld(auxString);
|
||||
|
||||
sender.sendMessage("The request to world '" + auxString + "' was sent.");
|
||||
|
||||
isLoaded = true;
|
||||
@ -1610,7 +1612,7 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
// PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
if (!sender.hasPermission("groupmanager.notify.other"))
|
||||
if (!sender.hasPermission("groupmanager.notify.other") || (isConsole))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + ".");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
@ -1666,7 +1668,7 @@ public class GroupManager extends JavaPlugin {
|
||||
}
|
||||
// PARECE OK
|
||||
auxUser.setGroup(auxGroup);
|
||||
if (!sender.hasPermission("groupmanager.notify.other"))
|
||||
if (!sender.hasPermission("groupmanager.notify.other") || (isConsole))
|
||||
sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + ".");
|
||||
|
||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||
@ -1837,15 +1839,6 @@ public class GroupManager extends JavaPlugin {
|
||||
return match;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers all GroupManager events for other plugins to see.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public static void callEvent(GroupManagerEvent event) {
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the config
|
||||
|
@ -18,7 +18,7 @@ public class BukkitPermsUpdateTask implements Runnable {
|
||||
public void run() {
|
||||
// Signal loaded and update BukkitPermissions.
|
||||
GroupManager.setLoaded(true);
|
||||
GroupManager.BukkitPermissions.collectPermissions();
|
||||
//GroupManager.BukkitPermissions.collectPermissions();
|
||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||
|
||||
GroupManager.logger.info("Bukkit Permissions Updated!");
|
||||
|
@ -176,6 +176,16 @@ public class WorldsHolder {
|
||||
ArrayList<WorldDataHolder> alreadyDone = new ArrayList<WorldDataHolder>();
|
||||
Tasks.removeOldFiles(plugin, plugin.getBackupFolder());
|
||||
|
||||
// Write Global Groups
|
||||
if (GroupManager.getGlobalGroups().haveGroupsChanged()) {
|
||||
GroupManager.getGlobalGroups().writeGroups(overwrite);
|
||||
} else {
|
||||
if (GroupManager.getGlobalGroups().getTimeStampGroups() < GroupManager.getGlobalGroups().getGlobalGroupsFile().lastModified()) {
|
||||
System.out.print("Newer GlobalGroups file found (Loading changes)!");
|
||||
GroupManager.getGlobalGroups().load();
|
||||
}
|
||||
}
|
||||
|
||||
for (OverloadedWorldHolder w : worldsData.values()) {
|
||||
if (alreadyDone.contains(w)) {
|
||||
continue;
|
||||
@ -228,15 +238,6 @@ public class WorldsHolder {
|
||||
}
|
||||
alreadyDone.add(w);
|
||||
}
|
||||
// Write Global Groups
|
||||
if (GroupManager.getGlobalGroups().haveGroupsChanged()) {
|
||||
GroupManager.getGlobalGroups().writeGroups(overwrite);
|
||||
} else {
|
||||
if (GroupManager.getGlobalGroups().getTimeStampGroups() < GroupManager.getGlobalGroups().getGlobalGroupsFile().lastModified()) {
|
||||
System.out.print("Newer GlobalGroups file found (Loading changes)!");
|
||||
GroupManager.getGlobalGroups().load();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,8 @@
|
||||
package org.anjocaido.groupmanager.events;
|
||||
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
@ -13,10 +15,28 @@ public abstract class GroupManagerEvent extends Event {
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8790362185329926951L;
|
||||
|
||||
|
||||
protected GroupManagerEvent(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers all GroupManager events for other plugins to see.
|
||||
* Schedules events for 1 tick later to allow GM to finish populating super perms.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void schedule(final GroupManagerEvent event) {
|
||||
|
||||
if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
}, 1) == -1)
|
||||
GroupManager.logger.warning("Could not schedule GM Event.");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
package org.anjocaido.groupmanager.events;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.data.Group;
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author ElgarL
|
||||
*
|
||||
@ -13,13 +11,13 @@ import org.anjocaido.groupmanager.data.User;
|
||||
public class GroupManagerEventHandler {
|
||||
|
||||
protected static void callEvent(GMGroupEvent event) {
|
||||
GroupManager.callEvent(event);
|
||||
event.schedule(event);
|
||||
}
|
||||
protected static void callEvent(GMUserEvent event) {
|
||||
GroupManager.callEvent(event);
|
||||
event.schedule(event);
|
||||
}
|
||||
protected static void callEvent(GMSystemEvent event) {
|
||||
GroupManager.callEvent(event);
|
||||
event.schedule(event);
|
||||
}
|
||||
|
||||
public static void callEvent(Group group, GMGroupEvent.Action action) {
|
||||
|
@ -711,12 +711,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
||||
|
||||
PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission);
|
||||
if (resultUser.resultType != PermissionCheckResult.Type.NOTFOUND) {
|
||||
resultUser.accessLevel = targetPermission;
|
||||
return resultUser;
|
||||
}
|
||||
|
||||
// IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT FOUND
|
||||
PermissionCheckResult resultGroup = checkGroupPermissionWithInheritance(user.getGroup(), targetPermission);
|
||||
if (resultGroup.resultType != PermissionCheckResult.Type.NOTFOUND) {
|
||||
resultGroup.accessLevel = targetPermission;
|
||||
return resultGroup;
|
||||
}
|
||||
|
||||
@ -724,6 +726,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
||||
for (Group subGroup : user.subGroupListCopy()) {
|
||||
PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission);
|
||||
if (resultSubGroup.resultType != PermissionCheckResult.Type.NOTFOUND) {
|
||||
resultSubGroup.accessLevel = targetPermission;
|
||||
return resultSubGroup;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.anjocaido.groupmanager.permissions;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
@ -23,9 +24,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
//import org.anjocaido.groupmanager.data.User;
|
||||
import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder;
|
||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
//import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -43,8 +44,7 @@ import org.bukkit.event.server.ServerListener;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
//import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ import org.bukkit.plugin.PluginManager;
|
||||
*
|
||||
* BukkitPermissions overrides to force GM reponses to Superperms
|
||||
*
|
||||
* @author ElgarL, based upon PermissionsEX implementation
|
||||
* @author ElgarL, originally based upon PermissionsEX implementation
|
||||
*/
|
||||
public class BukkitPermissions {
|
||||
|
||||
@ -62,13 +62,25 @@ public class BukkitPermissions {
|
||||
protected boolean dumpAllPermissions = true;
|
||||
protected boolean dumpMatchedPermissions = true;
|
||||
public boolean player_join = false;
|
||||
|
||||
private static Field permissions;
|
||||
|
||||
// Setup reflection (Thanks to Codename_B for the reflection source)
|
||||
static {
|
||||
try {
|
||||
permissions = PermissionAttachment.class.getDeclaredField("permissions");
|
||||
permissions.setAccessible(true);
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public BukkitPermissions(GroupManager plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
this.collectPermissions();
|
||||
//this.collectPermissions();
|
||||
this.registerEvents();
|
||||
|
||||
this.updateAllPlayers();
|
||||
|
||||
GroupManager.logger.info("Superperms support enabled.");
|
||||
@ -93,6 +105,7 @@ public class BukkitPermissions {
|
||||
manager.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, plugin);
|
||||
}
|
||||
|
||||
/*
|
||||
public void collectPermissions() {
|
||||
registeredPermissions.clear();
|
||||
for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) {
|
||||
@ -100,43 +113,56 @@ public class BukkitPermissions {
|
||||
registeredPermissions.push(permission);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public void updatePermissions(Player player) {
|
||||
this.updatePermissions(player, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Push all permissions which are registered with GM for this player, on this world to Bukkit
|
||||
* and make it update for the child nodes.
|
||||
*
|
||||
* @param player
|
||||
* @param world
|
||||
*/
|
||||
public void updatePermissions(Player player, String world) {
|
||||
if (player == null || !GroupManager.isLoaded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.attachments.containsKey(player)) {
|
||||
this.attachments.put(player, player.addAttachment(plugin));
|
||||
PermissionAttachment attachment;
|
||||
// Find the players current attachment, or add a new one.
|
||||
if (this.attachments.containsKey(player)) {
|
||||
attachment = this.attachments.get(player);
|
||||
} else {
|
||||
attachment = player.addAttachment(plugin);
|
||||
this.attachments.put(player, attachment);;
|
||||
}
|
||||
|
||||
if (world == null) {
|
||||
world = player.getWorld().getName();
|
||||
}
|
||||
|
||||
// All permissions registered with Bukkit for this player
|
||||
PermissionAttachment attachment = this.attachments.get(player);
|
||||
|
||||
OverloadedWorldHolder worldData = plugin.getWorldsHolder().getWorldData(world);
|
||||
Boolean value = false;
|
||||
//User user = worldData.getUser(player.getName());
|
||||
|
||||
User user = worldData.getUser(player.getName());
|
||||
|
||||
/*
|
||||
// clear permissions
|
||||
for (String permission : attachment.getPermissions().keySet())
|
||||
attachment.unsetPermission(permission);
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* find matching permissions
|
||||
*
|
||||
* and base bukkit perms if we are set to allow bukkit permissions to
|
||||
* override.
|
||||
*/
|
||||
Boolean value = false;
|
||||
|
||||
|
||||
/*
|
||||
for (Permission permission : registeredPermissions) {
|
||||
|
||||
PermissionCheckResult result = worldData.getPermissionsHandler().checkFullGMPermission(user, permission.getName(), false);
|
||||
@ -163,35 +189,47 @@ public class BukkitPermissions {
|
||||
if ((value == true) || (result.resultType == PermissionCheckResult.Type.NEGATION)) {
|
||||
attachment.setPermission(permission, value);
|
||||
}
|
||||
/*
|
||||
if ((value == true) || (result.resultType == PermissionCheckResult.Type.NOTFOUND)) {
|
||||
// fetch and set all children of this permission node
|
||||
Map<String, Boolean> children = permission.getChildren();
|
||||
if (children != null) {
|
||||
for (String child : children.keySet()) {
|
||||
if (children.get(child))
|
||||
attachment.setPermission(child, value);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
// Add any missing permissions for this player (non bukkit plugins and child nodes)
|
||||
// Add all permissions for this player (GM only)
|
||||
// child nodes will be calculated by Bukkit.
|
||||
List<String> playerPermArray = worldData.getPermissionsHandler().getAllPlayersPermissions(player.getName());
|
||||
|
||||
Map<String, Boolean> newPerms = new HashMap<String, Boolean>();
|
||||
|
||||
for (String permission : playerPermArray) {
|
||||
value = true;
|
||||
if (permission.startsWith("-")) {
|
||||
permission = permission.substring(1); // cut off -
|
||||
value = false;
|
||||
}
|
||||
|
||||
/*
|
||||
if (!attachment.getPermissions().containsKey(permission)) {
|
||||
attachment.setPermission(permission, value);
|
||||
}
|
||||
*/
|
||||
newPerms.put(permission, value);
|
||||
}
|
||||
//player.recalculatePermissions();
|
||||
|
||||
/**
|
||||
* This is put in place until such a time as Bukkit pull 466 is implemented
|
||||
* https://github.com/Bukkit/Bukkit/pull/466
|
||||
*/
|
||||
try { // Codename_B source
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Boolean> orig = (Map<String, Boolean>) permissions.get(attachment);
|
||||
// Clear the map (faster than removing the attachment and recalculating)
|
||||
orig.clear();
|
||||
// Then whack our map into there
|
||||
orig.putAll(newPerms);
|
||||
// That's all folks!
|
||||
attachment.getPermissible().recalculatePermissions();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
player.recalculatePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -245,6 +283,12 @@ public class BukkitPermissions {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* List all effective permissions for this player.
|
||||
*
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
public List<String> listPerms(Player player) {
|
||||
List<String> perms = new ArrayList<String>();
|
||||
|
||||
@ -266,6 +310,9 @@ public class BukkitPermissions {
|
||||
return perms;
|
||||
}
|
||||
|
||||
/**
|
||||
* force Bukkit to update every OnlinePlayers permissions.
|
||||
*/
|
||||
public void updateAllPlayers() {
|
||||
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
|
||||
updatePermissions(player);
|
||||
@ -326,7 +373,7 @@ public class BukkitPermissions {
|
||||
if (!GroupManager.isLoaded())
|
||||
return;
|
||||
|
||||
collectPermissions();
|
||||
//collectPermissions();
|
||||
updateAllPlayers();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: GroupManager
|
||||
version: "1.7 (Phoenix)"
|
||||
version: "1.8 (Phoenix)"
|
||||
main: org.anjocaido.groupmanager.GroupManager
|
||||
website: http://www.anjocaido.info/
|
||||
description: Provides on-the-fly system for permissions system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
||||
|
@ -3,7 +3,7 @@ users:
|
||||
snowleo:
|
||||
subgroups: []
|
||||
permissions: []
|
||||
group: Admin
|
||||
group: Builder
|
||||
KHobbits:
|
||||
subgroups: []
|
||||
permissions: []
|
||||
@ -11,5 +11,5 @@ users:
|
||||
ElgarL:
|
||||
subgroups: []
|
||||
permissions: []
|
||||
group: Owner
|
||||
group: Moderator
|
||||
|
||||
|
@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.3.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=40644caa
|
||||
nbproject/build-impl.xml.script.CRC32=a451c39a
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=cdb3fc6f
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=e7b96939
|
||||
nbproject/build-impl.xml.script.CRC32=2b257042
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=f45f4172
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -39,7 +39,7 @@ public class EssentialsSpawn extends JavaPlugin
|
||||
|
||||
final EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener(ess, spawns);
|
||||
pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, ess.getSettings().getRespawnPriority(), this);
|
||||
pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Low, this);
|
||||
pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, ess.getSettings().getRespawnPriority(), this);
|
||||
|
||||
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.User;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
@ -16,6 +17,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
private final transient SpawnStorage spawns;
|
||||
private static final Logger LOGGER = Bukkit.getLogger();
|
||||
|
||||
public EssentialsSpawnPlayerListener(final IEssentials ess, final SpawnStorage spawns)
|
||||
{
|
||||
@ -26,7 +28,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
|
||||
@Override
|
||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||
{
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (ess.getSettings().getRespawnAtHome())
|
||||
@ -54,20 +56,22 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
{
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (!user.isNew() || user.getBedSpawnLocation() != null)
|
||||
if (user.hasPlayedBefore())
|
||||
{
|
||||
LOGGER.log(Level.FINE, "Old player join");
|
||||
return;
|
||||
}
|
||||
user.setNew(false);
|
||||
}
|
||||
if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn()))
|
||||
{
|
||||
ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user));
|
||||
ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L);
|
||||
}
|
||||
|
||||
if (ess.getSettings().getAnnounceNewPlayers())
|
||||
{
|
||||
ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user));
|
||||
}
|
||||
|
||||
LOGGER.log(Level.FINE, "New player join");
|
||||
}
|
||||
|
||||
|
||||
|
@ -866,6 +866,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -877,6 +885,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=fd4b98a9
|
||||
nbproject/build-impl.xml.script.CRC32=6c5a1616
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=94e69885
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
@ -873,6 +873,14 @@ is divided into following sections:
|
||||
-->
|
||||
<target depends="init" if="have.sources" name="-javadoc-build">
|
||||
<mkdir dir="${dist.javadoc.dir}"/>
|
||||
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
|
||||
<and>
|
||||
<isset property="endorsed.classpath.cmd.line.arg"/>
|
||||
<not>
|
||||
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
||||
<classpath>
|
||||
<path path="${javac.classpath}"/>
|
||||
@ -884,6 +892,7 @@ is divided into following sections:
|
||||
<include name="**/*.java"/>
|
||||
<exclude name="*.java"/>
|
||||
</fileset>
|
||||
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
|
||||
</javadoc>
|
||||
<copy todir="${dist.javadoc.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
||||
|
@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.42.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=1012a5dd
|
||||
nbproject/build-impl.xml.script.CRC32=4ece3e29
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46
|
||||
nbproject/build-impl.xml.script.CRC32=8cccbe45
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
|
||||
|
BIN
lib/bukkit.jar
BIN
lib/bukkit.jar
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user