Signed-off-by: StevenRS11 <stevenrs11@aol.com>
This commit is contained in:
parent
815dfdc15d
commit
b10751460d
3 changed files with 32 additions and 13 deletions
|
@ -5,6 +5,7 @@ import java.util.Random;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
|
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
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
|
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;
|
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
|
//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),
|
dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0),
|
||||||
|
|
|
@ -274,12 +274,12 @@ public class dimHelper extends DimensionManager
|
||||||
if ((entity != null) && (cart != null))
|
if ((entity != null) && (cart != null))
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((entity instanceof EntityPlayerMP))
|
if ((entity instanceof EntityPlayerMP))
|
||||||
{
|
{
|
||||||
EntityPlayerMP playerMP = (EntityPlayerMP)entity;
|
EntityPlayerMP playerMP = (EntityPlayerMP)entity;
|
||||||
entity.worldObj.updateEntityWithOptionalForce(entity, true);
|
entity.worldObj.updateEntityWithOptionalForce(entity, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
entity.mountEntity(cart);
|
entity.mountEntity(cart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,8 +351,7 @@ public class dimHelper extends DimensionManager
|
||||||
|
|
||||||
if(entity instanceof EntityPlayerMP)
|
if(entity instanceof EntityPlayerMP)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if(world.provider.dimensionId!=linkData.destDimID)
|
if(world.provider.dimensionId!=linkData.destDimID)
|
||||||
{
|
{
|
||||||
GameRegistry.onPlayerChangedDimension((EntityPlayer)entity);
|
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);
|
this.generateDoor(world,linkData);
|
||||||
|
|
||||||
|
|
|
@ -89,26 +89,40 @@ public class itemLinkSignature extends Item
|
||||||
{
|
{
|
||||||
offset = 1;
|
offset = 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.ExitDoorID)
|
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.ExitDoorID)
|
||||||
{
|
{
|
||||||
offset = 1;
|
offset = 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.dimDoorID)
|
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.dimDoorID)
|
||||||
{
|
{
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.ExitDoorID)
|
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.ExitDoorID)
|
||||||
{
|
{
|
||||||
offset = 0;
|
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()!=null)
|
||||||
{
|
{
|
||||||
if(par1ItemStack.getTagCompound().getBoolean("isCreated"))
|
if(par1ItemStack.getTagCompound().getBoolean("isCreated"))
|
||||||
{
|
{
|
||||||
// checks to see if the item has a link stored, if so, it creates it
|
// 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(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);
|
dimHelper.instance.createLink(linkCoords[3], par3World.provider.dimensionId, linkCoords[0], linkCoords[1], linkCoords[2],par4, par5+offset, par6,orientation);
|
||||||
|
@ -117,7 +131,7 @@ public class itemLinkSignature extends Item
|
||||||
|
|
||||||
--par1ItemStack.stackSize;
|
--par1ItemStack.stackSize;
|
||||||
par2EntityPlayer.sendChatToPlayer("Rift Created");
|
par2EntityPlayer.sendChatToPlayer("Rift Created");
|
||||||
par1ItemStack.stackTagCompound=null;
|
par1ItemStack.stackTagCompound=null;
|
||||||
/**
|
/**
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -125,11 +139,10 @@ public class itemLinkSignature extends Item
|
||||||
|
|
||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
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.
|
//otherwise, it creates the first half of the link. Next click will complete it.
|
||||||
|
|
Loading…
Reference in a new issue