Minor optimizations to expire manager

#469
This commit is contained in:
boy0001 2015-08-08 02:09:55 +10:00
parent ef59c833e3
commit b88c6d8d26
3 changed files with 52 additions and 3 deletions

43
pom.xml
View File

@ -40,7 +40,48 @@
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>bukkit</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>PlotSquared-Bukkit</finalName>
<excludes>
<exclude>**/com/plotsquared/sponge/**</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>sponge</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>PlotSquared-Sponge</finalName>
<excludes>
<exclude>**/com/plotsquared/bukkit/**</exclude>
<exclude>**/com/intellectualcrafters/plot/api/*</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>api</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>PlotSquared-Null</finalName>
<excludes>
<exclude>**/com/plotsquared/bukkit/**</exclude>
<exclude>**/com/plotsquared/sponge/**</exclude>
<exclude>**/com/intellectualcrafters/plot/api/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>

View File

@ -188,7 +188,13 @@ public class ExpireManager {
last = dates.get(uuid);
}
else {
final OfflinePlayer op = Bukkit.getOfflinePlayer(name);
OfflinePlayer op;
if (Settings.TWIN_MODE_UUID) {
op = Bukkit.getOfflinePlayer(uuid);
}
else {
op = Bukkit.getOfflinePlayer(name);
}
if (op.hasPlayedBefore()) {
last = op.getLastPlayed();
dates.put(uuid, last);

View File

@ -174,11 +174,13 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
if (getUUIDMap().size() == 0) {
for (OfflinePlotPlayer op : uuidWrapper.getOfflinePlayers()) {
if (op.getLastPlayed() != 0) {
long last = op.getLastPlayed();
if (last != 0) {
String name = op.getName();
StringWrapper wrap = new StringWrapper(name);
UUID uuid = uuidWrapper.getUUID(op);
toAdd.put(wrap, uuid);
ExpireManager.dates.put(uuid, last);
}
}
}