Unload dimensions on discon, don't freak out on TE load if dimensions

aren't there
This commit is contained in:
CannibalVox 2015-03-12 11:33:33 -05:00
parent 6651559793
commit 7e8b682c23
2 changed files with 7 additions and 5 deletions

View file

@ -122,6 +122,7 @@ public class EventHookContainer
if (!PocketManager.isLoaded())
{
PocketManager.load();
PocketManager.isConnected = true;
}
}

View file

@ -63,7 +63,7 @@ public class PocketManager
{
Point4D source = link.point;
NewDimData dimension = getDimensionData(source.getDimension());
if (dimension.getLink(source.getX(), source.getY(), source.getZ()) == null)
if (dimension != null && dimension.getLink(source.getX(), source.getY(), source.getZ()) == null)
dimension.createLink(source, LinkType.CLIENT, 0, link.lock);
}
@ -72,7 +72,7 @@ public class PocketManager
{
Point4D source = link.point;
NewDimData dimension = getDimensionData(source.getDimension());
if (dimension.getLink(source.getX(),source.getY(),source.getZ()) != null)
if (dimension != null && dimension.getLink(source.getX(),source.getY(),source.getZ()) != null)
dimension.deleteLink(source.getX(), source.getY(), source.getZ());
}
@ -81,9 +81,10 @@ public class PocketManager
{
Point4D source = link.point;
NewDimData dimension = getDimensionData(source.getDimension());
DimLink dLink = dimension.getLink(source);
dLink.lock = link.lock;
if (dimension != null) {
DimLink dLink = dimension.getLink(source);
dLink.lock = link.lock;
}
}
}