From 815dfdc15d71e45abf134359c887fd49c212a615 Mon Sep 17 00:00:00 2001 From: StevenRS11 Date: Sat, 4 May 2013 18:58:51 -0400 Subject: [PATCH] Fixed doors on top of doors with rift sig Signed-off-by: StevenRS11 --- StevenDimDoors/mod_pocketDim/DimData.java | 2 +- StevenDimDoors/mod_pocketDim/dimHelper.java | 5 +++ .../items/itemLinkSignature.java | 38 +++++++++++++------ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/StevenDimDoors/mod_pocketDim/DimData.java b/StevenDimDoors/mod_pocketDim/DimData.java index 9dd1f3f..93ae4fa 100644 --- a/StevenDimDoors/mod_pocketDim/DimData.java +++ b/StevenDimDoors/mod_pocketDim/DimData.java @@ -25,7 +25,7 @@ public class DimData implements Serializable public boolean hasBeenFilled=false; public boolean hasDoor=false; public boolean isDimRandomRift=false; - + //public boolean isPrivatePocket = false; public HashMap>> linksInThisDim=new HashMap(); HashMap dimX; HashMap> dimY ; diff --git a/StevenDimDoors/mod_pocketDim/dimHelper.java b/StevenDimDoors/mod_pocketDim/dimHelper.java index 39ba16c..ad06b4a 100644 --- a/StevenDimDoors/mod_pocketDim/dimHelper.java +++ b/StevenDimDoors/mod_pocketDim/dimHelper.java @@ -46,6 +46,11 @@ import cpw.mods.fml.relauncher.Side; public class dimHelper extends DimensionManager { + /** + * hashMap for the private pocket dimensions + */ + + public static HashMap privatePockets = new HashMap(); /** * HashMap containing all the dims registered with DimDoors, sorted by dim ID. loaded on startup * @Return diff --git a/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java b/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java index f2aa267..2bd3b6e 100644 --- a/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java +++ b/StevenDimDoors/mod_pocketDim/items/itemLinkSignature.java @@ -80,16 +80,35 @@ public class itemLinkSignature extends Item //System.out.println(key); int offset = 2; + + if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID) + { + offset = 1; + } + if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.dimDoorID) + { + offset = 1; + } + if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.ExitDoorID) + { + offset = 1; + } + if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.dimDoorID) + { + offset = 0; + } + if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.ExitDoorID) + { + offset = 0; + } + if(par1ItemStack.getTagCompound()!=null) { - if(par1ItemStack.getTagCompound().getBoolean("isCreated")) - { - // checks to see if the item has a link stored, if so, it creates it - if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID) + if(par1ItemStack.getTagCompound().getBoolean("isCreated")) { - offset = 1; - } - int orientation = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; + // checks to see if the item has a link stored, if so, it creates it + + int orientation = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; dimHelper.instance.createLink(par3World.provider.dimensionId, linkCoords[3], par4, par5+offset, par6, linkCoords[0], linkCoords[1], linkCoords[2],linkCoords[4]); dimHelper.instance.createLink(linkCoords[3], par3World.provider.dimensionId, linkCoords[0], linkCoords[1], linkCoords[2],par4, par5+offset, par6,orientation); @@ -112,10 +131,7 @@ public class itemLinkSignature extends Item { int orientation = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; - if(par3World.getBlockId(par4, par5, par6)==Block.snow.blockID) - { - offset = 1; - } + //otherwise, it creates the first half of the link. Next click will complete it. key= dimHelper.instance.createUniqueInterDimLinkKey(); this.writeToNBT(par1ItemStack, par4, par5+offset, par6,par3World.provider.dimensionId,orientation);