From 0deb4b89174bebd6384c81e2cdc33cf700cfe672 Mon Sep 17 00:00:00 2001 From: GreyMario Date: Sun, 18 Aug 2013 14:14:36 -0700 Subject: [PATCH] dimHelper: changed teleportEntity to public This enables use in BlockDimWallPerm for escaping Limbo quickly. --- .../mod_pocketDim/helpers/dimHelper.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/StevenDimDoors/mod_pocketDim/helpers/dimHelper.java b/StevenDimDoors/mod_pocketDim/helpers/dimHelper.java index 5b55199..10a6151 100644 --- a/StevenDimDoors/mod_pocketDim/helpers/dimHelper.java +++ b/StevenDimDoors/mod_pocketDim/helpers/dimHelper.java @@ -103,17 +103,28 @@ public class dimHelper extends DimensionManager } // GreyMaria: My god, what a mess. Here, let me clean it up a bit. - private Entity teleportEntity(World world, Entity entity, LinkData link) //this beautiful teleport method is based off of xCompWiz's teleport function. - { - // GreyMaria: Added to simplify some code further in. + public Entity teleportEntity(World world, Entity entity, LinkData link) //this beautiful teleport method is based off of xCompWiz's teleport function. + { WorldServer oldWorld = (WorldServer)world; + WorldServer newWorld; + EntityPlayerMP player = (entity instanceof EntityPlayerMP) ? (EntityPlayerMP)entity : null; - // Is something riding? Handle it first. + /*// SPECIAL CASE: Is our link null? If so, we've likely come from Limbo. Ensure this is the case. + if(link == null) + { + if(world.provider.dimensionId == DDProperties.instance().LimboDimensionID) + { + link = new LinkData(0, 0, 0, 0); + // Find destination point. + } + }*/ + + + // Is something riding? Handle it first. if(entity.riddenByEntity != null) { return this.teleportEntity(oldWorld,entity.riddenByEntity, link); } - // Are we riding something? Dismount and tell the mount to go first. Entity cart = entity.ridingEntity; if (cart != null) @@ -123,8 +134,6 @@ public class dimHelper extends DimensionManager // We keep track of both so we can remount them on the other side. } - WorldServer newWorld; - // Destination doesn't exist? We need to make it. if(DimensionManager.getWorld(link.destDimID)==null) { @@ -146,12 +155,7 @@ public class dimHelper extends DimensionManager // TODO Check to see if this is actually vital. mod_pocketDim.teleporter.placeInPortal(entity, newWorld, link); - // We'll need to know if we're teleporting a player entity. - // If this value is NULL, then we're not teleporting a player entity. - EntityPlayerMP player = null; - if (entity instanceof EntityPlayerMP) player = (EntityPlayerMP)entity; - - if (difDest) // Are we moving our target to a new dimension? + if (difDest) // Are we moving our target to a new dimension? { if(player != null) // Are we working with a player? {