Fixed fallback plotme conversion

This commit is contained in:
boy0001 2015-08-24 00:17:17 +10:00
parent d52e9b4c8c
commit bd86caa818
2 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,9 @@
package com.plotsquared.bukkit.database.plotme;
import java.io.File;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
@ -102,7 +105,16 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
try {
byte[] bytes = r.getBytes("ownerid");
if (bytes != null) {
owner = UUID.nameUUIDFromBytes(bytes);
try {
ByteBuffer bb = ByteBuffer.wrap(bytes);
long high = bb.getLong();
long low = bb.getLong();
owner = new UUID(high, low);
}
catch (Exception e) {
e.printStackTrace();
owner = UUID.nameUUIDFromBytes(bytes);
}
if (owner != null) {
UUIDHandler.add(new StringWrapper(name), owner);
}

View File

@ -11,7 +11,6 @@ import org.spongepowered.api.entity.player.Player;
import org.spongepowered.api.entity.player.gamemode.GameMode;
import org.spongepowered.api.entity.player.gamemode.GameModes;
import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.chat.ChatType;
import org.spongepowered.api.text.chat.ChatTypes;
import com.flowpowered.math.vector.Vector3d;