Small fix

Made doors not continually crash servers, now they close if something
breaks.
This commit is contained in:
StevenRS11
2014-01-09 13:25:14 -05:00
parent 6a0cf4706a
commit 3369352143
2 changed files with 14 additions and 1 deletions

View File

@@ -392,15 +392,28 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
} }
if (canUse) if (canUse)
{ {
// Teleport the entity through the link, if it exists // Teleport the entity through the link, if it exists
DimLink link = PocketManager.getLink(x, y, z, world.provider.dimensionId); DimLink link = PocketManager.getLink(x, y, z, world.provider.dimensionId);
if (link != null) if (link != null)
{ {
DDTeleporter.traverseDimDoor(world, link, entity, this); try
{
DDTeleporter.traverseDimDoor(world, link, entity, this);
}
catch(Exception e)
{
System.err.println("Something when wrong teleporting to a dim:");
e.printStackTrace();
}
} }
// Close the door only after the entity goes through // Close the door only after the entity goes through
// so players don't have it slam in their faces. // so players don't have it slam in their faces.
this.onPoweredBlockChange(world, x, y, z, false); this.onPoweredBlockChange(world, x, y, z, false);
} }
} }
else if (world.getBlockId(x, y + 1, z) == this.blockID) else if (world.getBlockId(x, y + 1, z) == this.blockID)