last fixes to doors
Signed-off-by: StevenRS11 <stevenrs11@aol.com>
This commit is contained in:
parent
3439cce520
commit
64daa7165a
4 changed files with 28 additions and 21 deletions
|
@ -89,6 +89,8 @@ public class TransientDoor extends ExitDoor
|
|||
{
|
||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
||||
par1World.setBlock(par2, par3-1, par4, 0);
|
||||
par1World.setBlock(par2, par3, par4, mod_pocketDim.blockRiftID);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,6 +103,8 @@ public class TransientDoor extends ExitDoor
|
|||
{
|
||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
||||
par1World.setBlock(par2, par3, par4, 0);
|
||||
par1World.setBlock(par2, par3+1, par4, mod_pocketDim.blockRiftID);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -602,28 +602,28 @@ public class dimHelper extends DimensionManager
|
|||
/**
|
||||
* generates a door based on what door was used to teleport. Only funtions once per linking.
|
||||
* @param world- door
|
||||
* @param linkData
|
||||
* @param incLink
|
||||
*/
|
||||
public void generateDoor(World world, LinkData linkData)
|
||||
public void generateDoor(World world, LinkData incLink)
|
||||
{
|
||||
int locX = linkData.locXCoord;
|
||||
int locY = linkData.locYCoord;
|
||||
int locZ = linkData.locZCoord;
|
||||
int locX = incLink.locXCoord;
|
||||
int locY = incLink.locYCoord;
|
||||
int locZ = incLink.locZCoord;
|
||||
|
||||
int destX = linkData.destXCoord;
|
||||
int destY = linkData.destYCoord;
|
||||
int destZ = linkData.destZCoord;
|
||||
int destX = incLink.destXCoord;
|
||||
int destY = incLink.destYCoord;
|
||||
int destZ = incLink.destZCoord;
|
||||
|
||||
if(!linkData.hasGennedDoor)
|
||||
if(!incLink.hasGennedDoor)
|
||||
{
|
||||
|
||||
|
||||
int destinationID = linkData.destDimID;
|
||||
int destinationID = incLink.destDimID;
|
||||
|
||||
DimData data = this.dimList.get(destinationID);
|
||||
|
||||
int id =world.getBlockId(locX, locY, locZ);
|
||||
if(id==mod_pocketDim.ExitDoorID||id==mod_pocketDim.dimDoorID)
|
||||
if(id==mod_pocketDim.ExitDoorID||id==mod_pocketDim.dimDoorID||id==mod_pocketDim.transientDoorID)
|
||||
{
|
||||
int doorTypeToPlace=id;
|
||||
|
||||
|
@ -636,8 +636,15 @@ public class dimHelper extends DimensionManager
|
|||
{
|
||||
this.initDimension(destinationID);
|
||||
}
|
||||
int locOrientation = linkData.linkOrientation;
|
||||
int destOrientation = this.getLinkDataFromCoords(destX, destY, destZ, destinationID).linkOrientation;
|
||||
int locOrientation = incLink.linkOrientation;
|
||||
LinkData destLink = this.getLinkDataFromCoords(destX, destY, destZ, destinationID);
|
||||
int destOrientation=0 ;
|
||||
if(destLink!=null)
|
||||
{
|
||||
destOrientation = destLink.linkOrientation;
|
||||
destLink.hasGennedDoor=true;
|
||||
}
|
||||
|
||||
|
||||
int blockToReplace= this.getWorld(destinationID).getBlockId(destX, destY, destZ);
|
||||
if(blockToReplace!=mod_pocketDim.dimDoorID&&blockToReplace!=mod_pocketDim.linkExitDoorID&&blockToReplace!=mod_pocketDim.linkDimDoorID&&blockToReplace!=mod_pocketDim.ExitDoorID&&blockToReplace!=mod_pocketDim.transientDoorID)
|
||||
|
@ -647,13 +654,9 @@ public class dimHelper extends DimensionManager
|
|||
// System.out.println("Genned door");
|
||||
}
|
||||
|
||||
if(id==mod_pocketDim.transientDoorID&&!dimHelper.dimList.get((destinationID)).hasBeenFilled)
|
||||
{
|
||||
this.getWorld(destinationID).setBlock(destX, destY-1, destZ, id,destOrientation,2);
|
||||
this.getWorld(destinationID).setBlock(destX, destY, destZ, id,world.getBlockMetadata(locX, locY, locZ),2);
|
||||
}
|
||||
|
||||
|
||||
linkData.hasGennedDoor=true;
|
||||
incLink.hasGennedDoor=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ public class ItemRiftBlade extends itemDimDoor
|
|||
{
|
||||
int var12 = MathHelper.floor_double((double)((par3EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||
|
||||
if (!this.canPlace(par2World, par4, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par2World)==null)
|
||||
if (!this.canPlace(par2World, par4, par5, par6, var12)||!this.canPlace(par2World, par4+1, par5, par6, var12)||dimHelper.instance.getLinkDataFromCoords(par4, par5+1, par6, par2World)==null)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ public class itemDimDoor extends ItemDoor
|
|||
int id = world.getBlockId(i, j, k);
|
||||
|
||||
boolean flag = true;
|
||||
if(id==mod_pocketDim.blockDimWallID||id==mod_pocketDim.blockRiftID||id==mod_pocketDim.blockDimWallPermID)
|
||||
if(id==mod_pocketDim.blockDimWallID||id==mod_pocketDim.blockRiftID||id==mod_pocketDim.blockDimWallPermID||id==0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue