Fixed a server crash and issues with UUIDTypeAdapter
This commit is contained in:
parent
68cc87d03b
commit
ea98ed002d
3 changed files with 26 additions and 5 deletions
|
@ -18,6 +18,7 @@ import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandle
|
|||
import biomesoplenty.common.eventhandler.world.MapGenEventHandler;
|
||||
import biomesoplenty.common.eventhandler.world.VillageMaterialEventHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class BOPEventHandlers
|
||||
{
|
||||
|
@ -27,9 +28,13 @@ public class BOPEventHandlers
|
|||
registerWorldEventHandlers();
|
||||
registerEntityEventHandlers();
|
||||
registerPotionEventHandlers();
|
||||
registerGUIEventHandlers();
|
||||
registerMiscEventHandlers();
|
||||
registerClientEventHandlers();
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||
{
|
||||
registerGUIEventHandlers();
|
||||
registerClientEventHandlers();
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerNetworkEventHandlers()
|
||||
|
|
16
src/main/java/biomesoplenty/common/utils/UUIDUtils.java
Normal file
16
src/main/java/biomesoplenty/common/utils/UUIDUtils.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package biomesoplenty.common.utils;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class UUIDUtils
|
||||
{
|
||||
public static String fromUUID(UUID value)
|
||||
{
|
||||
return value.toString().replace("-", "");
|
||||
}
|
||||
|
||||
public static UUID fromString(String input)
|
||||
{
|
||||
return UUID.fromString(input.replaceFirst("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5"));
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package biomesoplenty.common.utils.remote;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.mojang.util.UUIDTypeAdapter;
|
||||
import biomesoplenty.common.utils.UUIDUtils;
|
||||
|
||||
public class FlowerTrailManager extends RemoteIdentifierManager
|
||||
{
|
||||
|
@ -15,12 +15,12 @@ public class FlowerTrailManager extends RemoteIdentifierManager
|
|||
|
||||
public boolean hasTrail(UUID uuid)
|
||||
{
|
||||
return this.identifierMap.containsKey(UUIDTypeAdapter.fromUUID(uuid));
|
||||
return this.identifierMap.containsKey(UUIDUtils.fromUUID(uuid));
|
||||
}
|
||||
|
||||
public String getTrailType(UUID uuid)
|
||||
{
|
||||
return this.identifierMap.get(UUIDTypeAdapter.fromUUID(uuid));
|
||||
return this.identifierMap.get(UUIDUtils.fromUUID(uuid));
|
||||
}
|
||||
|
||||
public static FlowerTrailManager getInstance()
|
||||
|
|
Loading…
Reference in a new issue