sponge changes / documentation / cleanup / event tweak
This commit is contained in:
Jesse Boyd
2016-03-13 03:57:24 +11:00
parent edc43bd53b
commit a8fd1b49ca
20 changed files with 562 additions and 240 deletions

View File

@ -1,9 +1,5 @@
package com.plotsquared.sponge.uuid;
import java.util.UUID;
import org.spongepowered.api.profile.GameProfile;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.object.StringWrapper;
@ -11,6 +7,9 @@ import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.sponge.SpongeMain;
import org.spongepowered.api.profile.GameProfile;
import java.util.UUID;
public class SpongeUUIDHandler extends UUIDHandlerImplementation {
@ -29,7 +28,10 @@ public class SpongeUUIDHandler extends UUIDHandlerImplementation {
public boolean cache(final Runnable whenDone) {
add(new StringWrapper("*"), DBFunc.everyone);
for (final GameProfile profile : SpongeMain.THIS.getResolver().getCachedProfiles()) {
add(new StringWrapper(profile.getName()), profile.getUniqueId());
String name = profile.getName().orElse(null);
if (name != null) {
add(new StringWrapper(name), profile.getUniqueId());
}
}
return true;
}