Signed-off-by: StevenRS11 <stevenrs11@aol.com>

This commit is contained in:
StevenRS11 2013-05-09 15:28:32 -04:00
parent 815dfdc15d
commit b10751460d
3 changed files with 32 additions and 13 deletions

View file

@ -5,6 +5,7 @@ import java.util.Random;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@ -73,9 +74,9 @@ public class BlockDimWallPerm extends Block
x=x+(x>> 4)+1; //make sure I am in the middle of a chunk, andnot on a boundry, so it doesnt load the chunk next to me
z=z+(z>> 4)+1;
dimHelper.getWorld(0).getChunkProvider().loadChunk(x >> 4, z >> 4);
int y = dimHelper.getWorld(0).getHeightValue(x, z);
int y = yCoordHelper.getFirstUncovered(0, x, 63, z);
//this complicated chunk teleports the player back to the overworld at some random location. Looks funky becaue it has to load the chunk
dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0),

View file

@ -352,7 +352,6 @@ public class dimHelper extends DimensionManager
if(entity instanceof EntityPlayerMP)
{
if(world.provider.dimensionId!=linkData.destDimID)
{
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
@ -386,6 +385,12 @@ public class dimHelper extends DimensionManager
}
}
if(entity.worldObj.getBlockId(playerXCoord, playerYCoord-1,playerZCoord )==Block.lavaStill.blockID)
{
entity.worldObj.setBlock(playerXCoord, playerYCoord-1, playerZCoord, mod_pocketDim.blockDimWallID);
}
this.generateDoor(world,linkData);

View file

@ -89,26 +89,40 @@ public class itemLinkSignature extends Item
{
offset = 1;
}
else
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.ExitDoorID)
{
offset = 1;
}
else
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.dimDoorID)
{
offset = 0;
}
else
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.ExitDoorID)
{
offset = 0;
}
int orientation = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
for(int count = 0;count<3;count++)
{
if(dimHelper.instance.getLinkDataFromCoords(par4, par5+count, par6,par3World)!=null)
{
orientation = dimHelper.instance.getLinkDataFromCoords(par4, par5+count, par6,par3World).linkOrientation;
}
}
if(par1ItemStack.getTagCompound()!=null)
{
if(par1ItemStack.getTagCompound().getBoolean("isCreated"))
{
// 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);
@ -129,7 +143,6 @@ public class itemLinkSignature extends Item
}
else
{
int orientation = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
//otherwise, it creates the first half of the link. Next click will complete it.