Reformat code

This commit is contained in:
sauilitired
2018-08-10 17:01:10 +02:00
parent 02ee1e8fa1
commit 1646cd0f5a
437 changed files with 12795 additions and 14203 deletions

View File

@ -6,17 +6,17 @@ import com.intellectualcrafters.plot.util.TaskManager;
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
import com.plotsquared.sponge.SpongeMain;
import java.util.UUID;
import org.spongepowered.api.profile.GameProfile;
import java.util.UUID;
public class SpongeUUIDHandler extends UUIDHandlerImplementation {
public SpongeUUIDHandler(UUIDWrapper wrapper) {
super(wrapper);
}
@Override
public boolean startCaching(Runnable whenDone) {
@Override public boolean startCaching(Runnable whenDone) {
if (!super.startCaching(whenDone)) {
return false;
}
@ -24,7 +24,8 @@ public class SpongeUUIDHandler extends UUIDHandlerImplementation {
}
public boolean cache(Runnable whenDone) {
for (GameProfile profile : SpongeMain.THIS.getServer().getGameProfileManager().getCache().getProfiles()) {
for (GameProfile profile : SpongeMain.THIS.getServer().getGameProfileManager().getCache()
.getProfiles()) {
String name = profile.getName().orElse(null);
if (name != null) {
add(new StringWrapper(name), profile.getUniqueId());
@ -32,16 +33,14 @@ public class SpongeUUIDHandler extends UUIDHandlerImplementation {
}
return true;
}
@Override
public void fetchUUID(String name, RunnableVal<UUID> ifFetch) {
@Override public void fetchUUID(String name, RunnableVal<UUID> ifFetch) {
TaskManager.runTaskAsync(new Runnable() {
@Override
public void run() {
@Override public void run() {
ifFetch.value = SpongeUUIDHandler.this.uuidWrapper.getUUID(name);
TaskManager.runTask(ifFetch);
}
});
}
}