Progress to Next Update #61
@@ -56,7 +56,7 @@ public class EventHookContainer
|
|||||||
//TODO added temporary Try/catch block to prevent a crash here, getLinksInDim needs to be looked at
|
//TODO added temporary Try/catch block to prevent a crash here, getLinksInDim needs to be looked at
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for (LinkData link:dimHelper.dimList.get(world.provider.dimensionId).getLinksInDim())
|
for (LinkData link:dimHelper.instance.getDimData(world.provider.dimensionId).getLinksInDim())
|
||||||
{
|
{
|
||||||
if(linkCount>100) //TODO: Wtf? wouldn't this cause some links to not load on servers with several links? Not sure what's going on here. ~SenseiKiwi
|
if(linkCount>100) //TODO: Wtf? wouldn't this cause some links to not load on servers with several links? Not sure what's going on here. ~SenseiKiwi
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class PacketHandler implements IPacketHandler
|
|||||||
int dimId = data.readInt();
|
int dimId = data.readInt();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DimData dimDataToAddLink= dimHelper.dimList.get(dimId);
|
DimData dimDataToAddLink= dimHelper.instance.getDimData(dimId);
|
||||||
|
|
||||||
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
||||||
linkToAdd.hasGennedDoor=data.readBoolean();
|
linkToAdd.hasGennedDoor=data.readBoolean();
|
||||||
@@ -128,7 +128,7 @@ public class PacketHandler implements IPacketHandler
|
|||||||
int dimId = data.readInt();
|
int dimId = data.readInt();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DimData dimDataToRemoveFrom= dimHelper.dimList.get(dimId);
|
DimData dimDataToRemoveFrom= dimHelper.instance.getDimData(dimId);
|
||||||
|
|
||||||
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
||||||
dimDataToRemoveFrom.removeLinkAtCoords(linkToAdd.locDimID, linkToAdd.locXCoord,linkToAdd.locYCoord, linkToAdd.locZCoord);
|
dimDataToRemoveFrom.removeLinkAtCoords(linkToAdd.locDimID, linkToAdd.locXCoord,linkToAdd.locYCoord, linkToAdd.locZCoord);
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ public class TileEntityRift extends TileEntity
|
|||||||
public void updateEntity()
|
public void updateEntity()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(count>200&&dimHelper.dimList.get(this.worldObj.provider.dimensionId)!=null)
|
if(count>200&&dimHelper.instance.getDimData(this.worldObj.provider.dimensionId)!=null)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
if(rand.nextBoolean())
|
if(rand.nextBoolean())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 5, xCoord, yCoord, zCoord);
|
nearestRiftData = dimHelper.instance.getDimData(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 5, xCoord, yCoord, zCoord);
|
||||||
if(nearestRiftData!=null)
|
if(nearestRiftData!=null)
|
||||||
{
|
{
|
||||||
this.xOffset=this.xCoord-nearestRiftData.locXCoord;
|
this.xOffset=this.xCoord-nearestRiftData.locXCoord;
|
||||||
@@ -88,9 +88,9 @@ public class TileEntityRift extends TileEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId)!=null)
|
if(dimHelper.instance.getDimData(this.worldObj.provider.dimensionId)!=null)
|
||||||
{
|
{
|
||||||
ArrayList rifts = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findRiftsInRange(worldObj, 6, this.xCoord, this.yCoord, this.zCoord);
|
ArrayList rifts = dimHelper.instance.getDimData(this.worldObj.provider.dimensionId).findRiftsInRange(worldObj, 6, this.xCoord, this.yCoord, this.zCoord);
|
||||||
if(rifts.size()>15)
|
if(rifts.size()>15)
|
||||||
{
|
{
|
||||||
MobObelisk creeper = new MobObelisk(worldObj);
|
MobObelisk creeper = new MobObelisk(worldObj);
|
||||||
@@ -124,7 +124,7 @@ public class TileEntityRift extends TileEntity
|
|||||||
// System.out.println(count2);
|
// System.out.println(count2);
|
||||||
if(count2>20&&count2<22)
|
if(count2>20&&count2<22)
|
||||||
{
|
{
|
||||||
nearestRiftData = dimHelper.dimList.get(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 10, xCoord, yCoord, zCoord);
|
nearestRiftData = dimHelper.instance.getDimData(this.worldObj.provider.dimensionId).findNearestRift(worldObj, 10, xCoord, yCoord, zCoord);
|
||||||
if(this.nearestRiftData!=null)
|
if(this.nearestRiftData!=null)
|
||||||
{
|
{
|
||||||
TileEntityRift rift = (TileEntityRift) this.worldObj.getBlockTileEntity(nearestRiftData.locXCoord, nearestRiftData.locYCoord, nearestRiftData.locZCoord);
|
TileEntityRift rift = (TileEntityRift) this.worldObj.getBlockTileEntity(nearestRiftData.locXCoord, nearestRiftData.locYCoord, nearestRiftData.locZCoord);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class TransientDoor extends ExitDoor
|
|||||||
{
|
{
|
||||||
par1World.setBlock(par2, par3-1, par4, 0);
|
par1World.setBlock(par2, par3-1, par4, 0);
|
||||||
par1World.setBlock(par2, par3, par4, properties.RiftBlockID);
|
par1World.setBlock(par2, par3, par4, properties.RiftBlockID);
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
dimHelper.instance.traverseDimDoor(par1World, linkData, par5Entity);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ public class TransientDoor extends ExitDoor
|
|||||||
{
|
{
|
||||||
par1World.setBlock(par2, par3, par4, 0);
|
par1World.setBlock(par2, par3, par4, 0);
|
||||||
par1World.setBlock(par2, par3+1, par4, properties.RiftBlockID);
|
par1World.setBlock(par2, par3+1, par4, properties.RiftBlockID);
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
dimHelper.instance.traverseDimDoor(par1World, linkData, par5Entity);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class ChaosDoor extends dimDoor
|
|||||||
{
|
{
|
||||||
foundRandomDest=true;
|
foundRandomDest=true;
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, new LinkData(link.destDimID,link.locDimID,link.destXCoord,link.destYCoord,link.destZCoord,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0), par5Entity);
|
dimHelper.instance.traverseDimDoor(par1World, new LinkData(link.destDimID,link.locDimID,link.destXCoord,link.destYCoord,link.destZCoord,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0), par5Entity);
|
||||||
|
|
||||||
if(dimHelper.getWorld(link.locDimID)!=null)
|
if(dimHelper.getWorld(link.locDimID)!=null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ public class ExitDoor extends dimDoor
|
|||||||
|
|
||||||
if(dimHelper.instance.dimList.containsKey(locDimID)&&dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
|
if(dimHelper.instance.dimList.containsKey(locDimID)&&dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)==null)
|
||||||
{
|
{
|
||||||
DimData dimData = dimHelper.dimList.get(locDimID);
|
DimData dimData = dimHelper.instance.getDimData(locDimID);
|
||||||
int ExitDimID = dimData.exitDimLink.destDimID;
|
int ExitDimID = dimData.exitDimLink.destDimID;
|
||||||
if(dimHelper.dimList.get(par1World.provider.dimensionId).isPocket)
|
if(dimHelper.instance.getDimData(par1World.provider.dimensionId).isPocket)
|
||||||
{
|
{
|
||||||
int yCoord=yCoordHelper.getFirstUncovered(ExitDimID, par2, par3, par4);
|
int yCoord=yCoordHelper.getFirstUncovered(ExitDimID, par2, par3, par4);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ public class ExitDoor extends dimDoor
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(dimHelper.dimList.get(par1World.provider.dimensionId).isPocket)
|
else if(dimHelper.instance.getDimData(par1World.provider.dimensionId).isPocket)
|
||||||
{
|
{
|
||||||
//System.out.println("Created new dim from "+String.valueOf(par1World.provider.dimensionId));
|
//System.out.println("Created new dim from "+String.valueOf(par1World.provider.dimensionId));
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class dimDoor extends BlockContainer
|
|||||||
if(!(par5Entity instanceof EntityPlayer)&&num>3)
|
if(!(par5Entity instanceof EntityPlayer)&&num>3)
|
||||||
{
|
{
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
dimHelper.instance.traverseDimDoor(par1World, linkData, par5Entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12)
|
else if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12)
|
||||||
@@ -116,7 +116,7 @@ public class dimDoor extends BlockContainer
|
|||||||
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
dimHelper.instance.traverseDimDoor(par1World, linkData, par5Entity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class dimHatch extends BlockTrapDoor
|
|||||||
exitLink.locDimID=par1World.provider.dimensionId;
|
exitLink.locDimID=par1World.provider.dimensionId;
|
||||||
|
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, exitLink, par5Entity);
|
dimHelper.instance.traverseDimDoor(par1World, exitLink, par5Entity);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class CommandCreateDungeonRift extends DDCommandBase
|
|||||||
{
|
{
|
||||||
//Create a rift to our selected dungeon and notify the player
|
//Create a rift to our selected dungeon and notify the player
|
||||||
link = dimHelper.instance.createPocket(link, true, true);
|
link = dimHelper.instance.createPocket(link, true, true);
|
||||||
dimHelper.dimList.get(link.destDimID).dungeonGenerator = result;
|
dimHelper.instance.getDimData(link.destDimID).dungeonGenerator = result;
|
||||||
sender.sendChatToPlayer("Created a rift to \"" + getSchematicName(result) + "\" dungeon (Dimension ID = " + link.destDimID + ").");
|
sender.sendChatToPlayer("Created a rift to \"" + getSchematicName(result) + "\" dungeon (Dimension ID = " + link.destDimID + ").");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class CommandDeleteAllLinks extends DDCommandBase
|
|||||||
{
|
{
|
||||||
if(dimHelper.dimList.containsKey(targetDim))
|
if(dimHelper.dimList.containsKey(targetDim))
|
||||||
{
|
{
|
||||||
DimData dim = dimHelper.dimList.get(targetDim);
|
DimData dim = dimHelper.instance.getDimData(targetDim);
|
||||||
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
|
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
|
||||||
|
|
||||||
for (LinkData link : linksInDim)
|
for (LinkData link : linksInDim)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class CommandDeleteDimensionData extends DDCommandBase
|
|||||||
{
|
{
|
||||||
if(link.destDimID==targetDim)
|
if(link.destDimID==targetDim)
|
||||||
{
|
{
|
||||||
dimHelper.dimList.get(link.locDimID).removeLinkAtCoords(link);
|
dimHelper.instance.getDimData(link.locDimID).removeLinkAtCoords(link);
|
||||||
linksRemoved++;
|
linksRemoved++;
|
||||||
}
|
}
|
||||||
if(dimData.dimID==targetDim)
|
if(dimData.dimID==targetDim)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class CommandDeleteRifts extends DDCommandBase
|
|||||||
{
|
{
|
||||||
if(dimHelper.dimList.containsKey(targetDim))
|
if(dimHelper.dimList.containsKey(targetDim))
|
||||||
{
|
{
|
||||||
DimData dim = dimHelper.dimList.get(targetDim);
|
DimData dim = dimHelper.instance.getDimData(targetDim);
|
||||||
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
|
ArrayList<LinkData> linksInDim = dim.getLinksInDim();
|
||||||
|
|
||||||
for(LinkData link : linksInDim)
|
for(LinkData link : linksInDim)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class CommandPrintDimensionData extends DDCommandBase
|
|||||||
return DDCommandResult.TOO_MANY_ARGUMENTS;
|
return DDCommandResult.TOO_MANY_ARGUMENTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
dimData = dimHelper.dimList.get(targetDim);
|
dimData = dimHelper.instance.getDimData(targetDim);
|
||||||
if (dimData == null)
|
if (dimData == null)
|
||||||
{
|
{
|
||||||
return DDCommandResult.UNREGISTERED_DIMENSION;
|
return DDCommandResult.UNREGISTERED_DIMENSION;
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ public class DungeonSchematic extends Schematic {
|
|||||||
|
|
||||||
LinkData randomLink = dimHelper.instance.getRandomLinkData(false);
|
LinkData randomLink = dimHelper.instance.getRandomLinkData(false);
|
||||||
LinkData sideLink = new LinkData(destDimID,
|
LinkData sideLink = new LinkData(destDimID,
|
||||||
dimHelper.dimList.get(originDimID).exitDimLink.destDimID,
|
dimHelper.instance.getDimData(originDimID).exitDimLink.destDimID,
|
||||||
location.getX(),
|
location.getX(),
|
||||||
location.getY(),
|
location.getY(),
|
||||||
location.getZ(),
|
location.getZ(),
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ public class DungeonHelper
|
|||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getDungeonDataInChain(dimHelper.dimList.get(incoming.locDimID)).contains(dungeon))
|
if(getDungeonDataInChain(dimHelper.instance.getDimData(incoming.locDimID)).contains(dungeon))
|
||||||
{
|
{
|
||||||
flag=false;
|
flag=false;
|
||||||
}
|
}
|
||||||
@@ -506,8 +506,8 @@ public class DungeonHelper
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dimHelper.dimList.get(incoming.destDimID).dungeonGenerator = dungeon;
|
dimHelper.instance.getDimData(incoming.destDimID).dungeonGenerator = dungeon;
|
||||||
//dimHelper.dimList.get(incoming.destDimID).dungeonGenerator = defaultUp;
|
//dimHelper.instance.getDimData(incoming.destDimID).dungeonGenerator = defaultUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<String> getDungeonNames() {
|
public Collection<String> getDungeonNames() {
|
||||||
@@ -558,7 +558,7 @@ public class DungeonHelper
|
|||||||
}
|
}
|
||||||
public static ArrayList<DungeonGenerator> getDungeonDataInChain(DimData dimData)
|
public static ArrayList<DungeonGenerator> getDungeonDataInChain(DimData dimData)
|
||||||
{
|
{
|
||||||
DimData startingDim = dimHelper.dimList.get(dimHelper.instance.getLinkDataFromCoords(dimData.exitDimLink.destXCoord, dimData.exitDimLink.destYCoord, dimData.exitDimLink.destZCoord, dimData.exitDimLink.destDimID).destDimID);
|
DimData startingDim = dimHelper.instance.getDimData(dimHelper.instance.getLinkDataFromCoords(dimData.exitDimLink.destXCoord, dimData.exitDimLink.destYCoord, dimData.exitDimLink.destZCoord, dimData.exitDimLink.destDimID).destDimID);
|
||||||
|
|
||||||
return getDungeonDataBelow(startingDim);
|
return getDungeonDataBelow(startingDim);
|
||||||
}
|
}
|
||||||
@@ -573,9 +573,9 @@ public class DungeonHelper
|
|||||||
{
|
{
|
||||||
if(dimHelper.dimList.containsKey(link.destDimID))
|
if(dimHelper.dimList.containsKey(link.destDimID))
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(link.destDimID).dungeonGenerator!=null&&dimHelper.instance.getDimDepth(link.destDimID)==dimData.depth+1)
|
if(dimHelper.instance.getDimData(link.destDimID).dungeonGenerator!=null&&dimHelper.instance.getDimDepth(link.destDimID)==dimData.depth+1)
|
||||||
{
|
{
|
||||||
for(DungeonGenerator dungeonGen :getDungeonDataBelow(dimHelper.dimList.get(link.destDimID)) )
|
for(DungeonGenerator dungeonGen :getDungeonDataBelow(dimHelper.instance.getDimData(link.destDimID)) )
|
||||||
{
|
{
|
||||||
if(!dungeonData.contains(dungeonGen))
|
if(!dungeonData.contains(dungeonGen))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class dimHelper extends DimensionManager
|
|||||||
* @param orientation- the orientation of the door used to teleport, determines player orientation and door placement on arrival
|
* @param orientation- the orientation of the door used to teleport, determines player orientation and door placement on arrival
|
||||||
* @Return
|
* @Return
|
||||||
*/
|
*/
|
||||||
public void teleportToPocket(World world,LinkData linkData, Entity entity)
|
public void traverseDimDoor(World world,LinkData linkData, Entity entity)
|
||||||
{
|
{
|
||||||
DDProperties properties = DDProperties.instance();
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ public class dimHelper extends DimensionManager
|
|||||||
int playerYCoord=MathHelper.floor_double(entity.posY);
|
int playerYCoord=MathHelper.floor_double(entity.posY);
|
||||||
int playerZCoord=MathHelper.floor_double(entity.posZ);
|
int playerZCoord=MathHelper.floor_double(entity.posZ);
|
||||||
|
|
||||||
if(!entity.worldObj.isBlockOpaqueCube(playerXCoord, playerYCoord-1,playerZCoord )&&dimHelper.dimList.get(linkData.locDimID).isDimRandomRift&&!linkData.hasGennedDoor)
|
if(!entity.worldObj.isBlockOpaqueCube(playerXCoord, playerYCoord-1,playerZCoord )&&dimHelper.instance.getDimData(linkData.locDimID).isDimRandomRift&&!linkData.hasGennedDoor)
|
||||||
{
|
{
|
||||||
for(int count=0;count<20;count++)
|
for(int count=0;count<20;count++)
|
||||||
{
|
{
|
||||||
@@ -391,7 +391,7 @@ public class dimHelper extends DimensionManager
|
|||||||
{
|
{
|
||||||
dimHelper.dimList.put(link.destDimID, new DimData(link.destDimID, false, 0, link.locDimID,link.locXCoord,link.locYCoord,link.locZCoord));
|
dimHelper.dimList.put(link.destDimID, new DimData(link.destDimID, false, 0, link.locDimID,link.locXCoord,link.locYCoord,link.locZCoord));
|
||||||
}
|
}
|
||||||
DimData locationDimData= dimHelper.dimList.get(link.locDimID);
|
DimData locationDimData= dimHelper.instance.getDimData(link.locDimID);
|
||||||
link.isLocPocket=locationDimData.isPocket;
|
link.isLocPocket=locationDimData.isPocket;
|
||||||
locationDimData.addLinkToDim(link);
|
locationDimData.addLinkToDim(link);
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ public class dimHelper extends DimensionManager
|
|||||||
dimHelper.dimList.put(locationDimID, locationDimData);
|
dimHelper.dimList.put(locationDimID, locationDimData);
|
||||||
}
|
}
|
||||||
LinkData link = this.getLinkDataFromCoords(locationXCoord, locationYCoord, locationZCoord, locationDimID);
|
LinkData link = this.getLinkDataFromCoords(locationXCoord, locationYCoord, locationZCoord, locationDimID);
|
||||||
dimHelper.dimList.get(locationDimID).removeLinkAtCoords(link);
|
dimHelper.instance.getDimData(locationDimID).removeLinkAtCoords(link);
|
||||||
//updates clients that a rift has been removed
|
//updates clients that a rift has been removed
|
||||||
if(FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
|
if(FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
|
||||||
{
|
{
|
||||||
@@ -463,7 +463,7 @@ public class dimHelper extends DimensionManager
|
|||||||
}
|
}
|
||||||
public LinkData findNearestRift(World world, int x, int y, int z, int range)
|
public LinkData findNearestRift(World world, int x, int y, int z, int range)
|
||||||
{
|
{
|
||||||
return dimHelper.dimList.get(world).findNearestRift(world, range, x, y, z);
|
return dimHelper.instance.getDimData(world).findNearestRift(world, range, x, y, z);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* generates a door based on what door was used to teleport. Only funtions once per linking.
|
* generates a door based on what door was used to teleport. Only funtions once per linking.
|
||||||
@@ -546,7 +546,7 @@ public class dimHelper extends DimensionManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// World world = this.getWorld(incomingLink.destDimID);
|
// World world = this.getWorld(incomingLink.destDimID);
|
||||||
DimData data = dimHelper.dimList.get(incomingLink.destDimID);
|
DimData data = dimHelper.instance.getDimData(incomingLink.destDimID);
|
||||||
|
|
||||||
if(!data.hasBeenFilled&&data.isPocket&&!data.isDimRandomRift)
|
if(!data.hasBeenFilled&&data.isPocket&&!data.isDimRandomRift)
|
||||||
{
|
{
|
||||||
@@ -1094,7 +1094,7 @@ public class dimHelper extends DimensionManager
|
|||||||
ArrayList<LinkData> linksInDim = new ArrayList<LinkData>();
|
ArrayList<LinkData> linksInDim = new ArrayList<LinkData>();
|
||||||
for(size--;size>0;)
|
for(size--;size>0;)
|
||||||
{
|
{
|
||||||
dimData = dimHelper.dimList.get(dimList.keySet().toArray()[rand.nextInt(dimList.keySet().size())]);
|
dimData = dimHelper.instance.getDimData((Integer)dimList.keySet().toArray()[rand.nextInt(dimList.keySet().size())]);
|
||||||
if(dimData==null)
|
if(dimData==null)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -1128,8 +1128,89 @@ public class dimHelper extends DimensionManager
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a link at the destination of the link provided. Returns null if none exists.
|
||||||
|
* @param link
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public LinkData getLinkDataAtDestination(LinkData link)
|
||||||
|
{
|
||||||
|
return this.getLinkDataFromCoords(link.destXCoord, link.destYCoord, link.destZCoord, link.destDimID);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Moves the location of the link passed in to the provided coords. Does not change the links destination coords.
|
||||||
|
* The boolean flag determines whether or not to update other links that point to this link- true causes all links that pointed to this link to be updated
|
||||||
|
* to point to the new link location.
|
||||||
|
*
|
||||||
|
* Return true if there was an actual link to be moved.
|
||||||
|
*
|
||||||
|
* @param link
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @param z
|
||||||
|
* @param dimID
|
||||||
|
* @param updateLinksPointingHere
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean moveLinkDataLocation(LinkData link, int x,int y, int z, int dimID, boolean updateLinksPointingHere)
|
||||||
|
{
|
||||||
|
LinkData linkToMove = this.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID);
|
||||||
|
if(linkToMove!=null)
|
||||||
|
{
|
||||||
|
if(updateLinksPointingHere)
|
||||||
|
{
|
||||||
|
ArrayList<LinkData> incomingLinks = new ArrayList<LinkData>();
|
||||||
|
for(DimData dimData : dimHelper.dimList.values())
|
||||||
|
{
|
||||||
|
for(LinkData allLink : dimData.getLinksInDim())
|
||||||
|
{
|
||||||
|
if(this.getLinkDataAtDestination(allLink)==linkToMove)
|
||||||
|
{
|
||||||
|
this.moveLinkDataDestination(allLink, x, y, z, dimID, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linkToMove.locDimID=dimID;
|
||||||
|
linkToMove.locXCoord=x;
|
||||||
|
linkToMove.locYCoord=y;
|
||||||
|
linkToMove.locZCoord=z;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Changes the destination coords of the link passed in if it exists to the provided coords.
|
||||||
|
* @param link
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @param z
|
||||||
|
* @param dimID
|
||||||
|
* @param updateLinksAtDestination
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean moveLinkDataDestination(LinkData link, int x, int y, int z, int dimID, boolean updateLinksAtDestination)
|
||||||
|
{
|
||||||
|
LinkData linkToMove = this.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID);
|
||||||
|
if(linkToMove!=null)
|
||||||
|
{
|
||||||
|
if(updateLinksAtDestination)
|
||||||
|
{
|
||||||
|
LinkData linkAtDestination = this.getLinkDataAtDestination(linkToMove);
|
||||||
|
if(linkAtDestination!=null)
|
||||||
|
{
|
||||||
|
this.moveLinkDataLocation(linkAtDestination, x, y, z, dimID, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linkToMove.destDimID=dimID;
|
||||||
|
linkToMove.destXCoord=x;
|
||||||
|
linkToMove.destYCoord=y;
|
||||||
|
linkToMove.destZCoord=z;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets a link based on coords and a world object
|
* gets a link based on coords and a world object
|
||||||
@@ -1155,7 +1236,7 @@ public class dimHelper extends DimensionManager
|
|||||||
{
|
{
|
||||||
if(dimHelper.dimList.containsKey(worldID))
|
if(dimHelper.dimList.containsKey(worldID))
|
||||||
{
|
{
|
||||||
DimData dimData=dimHelper.dimList.get(worldID);
|
DimData dimData=dimHelper.instance.getDimData(worldID);
|
||||||
|
|
||||||
return dimData.findLinkAtCoords(x, y, z);
|
return dimData.findLinkAtCoords(x, y, z);
|
||||||
|
|
||||||
@@ -1271,14 +1352,7 @@ public class dimHelper extends DimensionManager
|
|||||||
|
|
||||||
public DimData getDimData(World world)
|
public DimData getDimData(World world)
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.containsKey(world.provider.dimensionId))
|
return dimHelper.instance.getDimData(world.provider.dimensionId);
|
||||||
{
|
|
||||||
return dimHelper.dimList.get(world.provider.dimensionId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public DimData getDimData(int dimID)
|
public DimData getDimData(int dimID)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -188,9 +188,9 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
if(this.getMaxItemUseDuration(par1ItemStack)-par4>12&&!par2World.isRemote&&itemDimDoor.canPlace(par2World, x, y, z, rotation))
|
if(this.getMaxItemUseDuration(par1ItemStack)-par4>12&&!par2World.isRemote&&itemDimDoor.canPlace(par2World, x, y, z, rotation))
|
||||||
{
|
{
|
||||||
|
|
||||||
if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null)
|
if(dimHelper.instance.getDimData(par2World.provider.dimensionId)!=null)
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(par2World.provider.dimensionId).depth==0)
|
if(dimHelper.instance.getDimData(par2World.provider.dimensionId).depth==0)
|
||||||
{
|
{
|
||||||
dimHelper.instance.createPocket(link,true, false);
|
dimHelper.instance.createPocket(link,true, false);
|
||||||
}
|
}
|
||||||
@@ -285,7 +285,7 @@ public class ItemRiftBlade extends ItemSword
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// if(dimHelper.dimList.get(par2World.provider.dimensionId)!=null&&!par2World.isRemote&&!didFindThing)
|
// if(dimHelper.instance.getDimData(par2World.provider.dimensionId)!=null&&!par2World.isRemote&&!didFindThing)
|
||||||
{
|
{
|
||||||
|
|
||||||
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ public class ItemStableFabric extends Item
|
|||||||
|
|
||||||
if(dimHelper.dimList.containsKey(par3World.provider.dimensionId))
|
if(dimHelper.dimList.containsKey(par3World.provider.dimensionId))
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(par3World.provider.dimensionId).isPocket)
|
if(dimHelper.instance.getDimData(par3World.provider.dimensionId).isPocket)
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(par3World.provider.dimensionId).dungeonGenerator!=null)
|
if(dimHelper.instance.getDimData(par3World.provider.dimensionId).dungeonGenerator!=null)
|
||||||
{
|
{
|
||||||
System.out.println("Dungeon name "+dimHelper.dimList.get(par3World.provider.dimensionId).dungeonGenerator.schematicPath);
|
System.out.println("Dungeon name "+dimHelper.instance.getDimData(par3World.provider.dimensionId).dungeonGenerator.schematicPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public class MobMonolith extends EntityFlying implements IMob
|
|||||||
|
|
||||||
LinkData link = new LinkData(this.worldObj.provider.dimensionId, properties.LimboDimensionID, (int)this.posX, (int)this.posY, (int)this.posZ, (int)this.posX+rand.nextInt(500)-250, (int)this.posY+500, (int)this.posZ+rand.nextInt(500)-250, false,0);
|
LinkData link = new LinkData(this.worldObj.provider.dimensionId, properties.LimboDimensionID, (int)this.posX, (int)this.posY, (int)this.posZ, (int)this.posX+rand.nextInt(500)-250, (int)this.posY+500, (int)this.posZ+rand.nextInt(500)-250, false,0);
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(worldObj, link, entityPlayer);
|
dimHelper.instance.traverseDimDoor(worldObj, link, entityPlayer);
|
||||||
this.aggro=0;
|
this.aggro=0;
|
||||||
|
|
||||||
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1);
|
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimDoors.sfx.crack",13, 1);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class MonolithSpawner implements IRegularTickReceiver {
|
|||||||
private void placeMonolithsInPocket(int dimensionID, int chunkX, int chunkZ)
|
private void placeMonolithsInPocket(int dimensionID, int chunkX, int chunkZ)
|
||||||
{
|
{
|
||||||
World pocket = dimHelper.getWorld(dimensionID);
|
World pocket = dimHelper.getWorld(dimensionID);
|
||||||
DimData dimData = dimHelper.dimList.get(dimensionID);
|
DimData dimData = dimHelper.instance.getDimData(dimensionID);
|
||||||
int sanity = 0;
|
int sanity = 0;
|
||||||
int blockID = 0;
|
int blockID = 0;
|
||||||
boolean didSpawn = false;
|
boolean didSpawn = false;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class PocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
|||||||
@Override
|
@Override
|
||||||
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4)
|
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4)
|
||||||
{
|
{
|
||||||
DimData data = dimHelper.dimList.get(this.worldObj.provider.dimensionId);
|
DimData data = dimHelper.instance.getDimData(this.worldObj.provider.dimensionId);
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
if (data.dungeonGenerator != null)
|
if (data.dungeonGenerator != null)
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class PocketProvider extends WorldProvider
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
respawnDim = dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
|
respawnDim = dimHelper.instance.getDimData(this.dimensionId).exitDimLink.destDimID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dimHelper.getWorld(respawnDim) == null)
|
if (dimHelper.getWorld(respawnDim) == null)
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class ClosingRiftFX extends EntityFX
|
|||||||
float var16 = .8F;
|
float var16 = .8F;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
|
if(dimHelper.instance.getDimData(this.worldObj.provider.dimensionId).isPocket)
|
||||||
{
|
{
|
||||||
var16=.4F;
|
var16=.4F;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class GoggleRiftFX extends EntityFireworkSparkFX
|
|||||||
float var16 = .0F;
|
float var16 = .0F;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
|
if(dimHelper.instance.getDimData(this.worldObj.provider.dimensionId).isPocket)
|
||||||
{
|
{
|
||||||
var16=.7F;
|
var16=.7F;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class RiftFX extends EntityFX
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(this.worldObj.provider.dimensionId).isPocket)
|
if(dimHelper.instance.getDimData(this.worldObj.provider.dimensionId).isPocket)
|
||||||
{
|
{
|
||||||
f14=.7F;
|
f14=.7F;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user