Offline uuid from flat file.

This commit is contained in:
boy0001
2015-08-26 14:21:48 +10:00
parent 1872e147cb
commit 3229705012
9 changed files with 225 additions and 125 deletions

View File

@ -2,6 +2,7 @@ package com.intellectualcrafters.plot.util;
import java.util.ArrayDeque;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import com.intellectualcrafters.plot.PS;
@ -89,7 +90,11 @@ public class SetBlockQueue {
if (locked) {
return;
}
Entry<ChunkWrapper, PlotBlock[][]> n = blocks.entrySet().iterator().next();
Iterator<Entry<ChunkWrapper, PlotBlock[][]>> iter = blocks.entrySet().iterator();
if (!iter.hasNext()) {
return;
}
Entry<ChunkWrapper, PlotBlock[][]> n = iter.next();
ChunkWrapper chunk = n.getKey();
PlotBlock[][] blocks = n.getValue();
int X = chunk.x << 4;

View File

@ -113,6 +113,16 @@ public class StringMan {
return true;
}
public static boolean isAlphanumericUnd(String str) {
for (int i=0; i<str.length(); i++) {
char c = str.charAt(i);
if (c < 0x30 || (c >= 0x3a && c <= 0x40) || (c > 0x5a && c <= 0x60) || c > 0x7a || c == '_') {
return false;
}
}
return true;
}
public static boolean isAlpha(String str) {
for (int i=0; i<str.length(); i++) {
char c = str.charAt(i);

View File

@ -90,15 +90,20 @@ public abstract class UUIDHandlerImplementation {
if ((uuid == null) || (name == null)) {
return false;
}
BiMap<UUID, StringWrapper> inverse = uuidMap.inverse();
if (inverse.containsKey(uuid)) {
if (uuidMap.containsKey(name)) {
try {
uuidMap.put(name, uuid);
}
catch (Exception e) {
BiMap<UUID, StringWrapper> inverse = uuidMap.inverse();
if (inverse.containsKey(uuid)) {
if (uuidMap.containsKey(name)) {
return false;
}
rename(uuid, name);
return false;
}
rename(uuid, name);
return false;
uuidMap.put(name, uuid);
}
uuidMap.put(name, uuid);
return true;
}