mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-01 13:14:43 +02:00
Offline uuid from flat file.
This commit is contained in:
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user