added dungeon to dimData, spawn fixes for monolit

This commit is contained in:
StevenRS11 2013-05-28 17:15:40 -04:00
parent 9f7561e2fe
commit 8365d4353f
8 changed files with 100 additions and 71 deletions

View file

@ -25,6 +25,7 @@ public class DimData implements Serializable
public boolean hasBeenFilled=false;
public boolean hasDoor=false;
public boolean isDimRandomRift=false;
public DungeonGenerator dungeonGenerator = null;
//public boolean isPrivatePocket = false;
public HashMap<Integer, HashMap<Integer, HashMap<Integer, LinkData>>> linksInThisDim=new HashMap();
HashMap<Integer, LinkData> dimX;

View file

@ -16,14 +16,20 @@ public class DungeonGenerator
public ArrayList<HashMap> sideRifts = new ArrayList<HashMap>();
public LinkData exitLink;
public static Random rand = new Random();
public boolean isOpen;
public int sideDoorsSoFar=0;
public int exitDoorsSoFar=0;
public int deadEndsSoFar=0;
public DungeonGenerator(int weight, String schematicPath, ArrayList<HashMap> sideRifts)
public DungeonGenerator(int weight, String schematicPath, Boolean isOpen)
{
this.weight=weight;
this.schematicPath=schematicPath;
this.sideRifts=sideRifts;
this.isOpen=isOpen;
}
@ -173,7 +179,8 @@ public class DungeonGenerator
}
mod_pocketDim.loader.init(dungeon.schematicPath, incoming, 0,0,0);
mod_pocketDim.loader.init(dungeon.schematicPath, incoming);
dimHelper.dimList.get(incoming.destDimID).dungeonGenerator=dungeon;
//mod_pocketDim.loader.generateSchematic(incoming,0,0,0);

View file

@ -56,7 +56,7 @@ public class SchematicLoader
}
public void init(String filePath, LinkData link, int x, int y , int z)
public void init(String filePath, LinkData link)
{
this.schematic="/schematics/"+filePath;

View file

@ -326,7 +326,7 @@ public class dimHelper extends DimensionManager
int depth= this.getDimDepth(world.provider.dimensionId);
if(this.dimList.containsKey(destinationID))
if(this.dimList.containsKey(destinationID)&&this.dimList.containsKey(world.provider.dimensionId))
{
this.generatePocket(linkData);
@ -430,6 +430,13 @@ public class dimHelper extends DimensionManager
}
}
else if(!this.dimList.containsKey(world.provider.dimensionId))
{
if(!(world.provider instanceof pocketProvider ||world.provider instanceof LimboProvider))
{
DimData data = new DimData(world.provider.dimensionId, false, 0, 0, world.getSpawnPoint().posX, world.getSpawnPoint().posY, world.getSpawnPoint().posZ);
}
}
return;
}
@ -721,18 +728,26 @@ public class dimHelper extends DimensionManager
if(orientation==0)
{
x=x+15;
this.getWorld(incomingLink.destDimID).setSpawnLocation(x-1, y, z);
}
else if(orientation==1)
{
z=z+15;
this.getWorld(incomingLink.destDimID).setSpawnLocation(x, y, z-1);
}
else if(orientation==2)
{
x=x-15;
this.getWorld(incomingLink.destDimID).setSpawnLocation(x+1, y, z);
}
else if(orientation==3)
{
z=z-15;
this.getWorld(incomingLink.destDimID).setSpawnLocation(x, y, z+1);
}
int searchRadius=19;

View file

@ -192,7 +192,7 @@ public class mod_pocketDim
public static ArrayList metadataFlipList = new ArrayList();
public static ArrayList metadataNextList = new ArrayList();
public static DungeonGenerator defaultUp = new DungeonGenerator(0, "simpleStairsUp.schematic", null);
public static DungeonGenerator defaultUp = new DungeonGenerator(0, "simpleStairsUp.schematic", true);
@ -559,73 +559,73 @@ public class mod_pocketDim
this.blocksImmuneToRift.add(Block.bedrock.blockID);
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", null));
this.hubs.add(new DungeonGenerator(0, "doorTotemRuins.schematic", null));
this.hubs.add(new DungeonGenerator(0, "hallwayTrapRooms1.schematic", null));
this.hubs.add(new DungeonGenerator(0, "longDoorHallway.schematic", null));
this.hubs.add(new DungeonGenerator(0, "smallRotundaWithExit.schematic", null));
this.hubs.add(new DungeonGenerator(0, "fortRuins.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", null));
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", false));
this.hubs.add(new DungeonGenerator(0, "4WayBasicHall.schematic", false));
this.hubs.add(new DungeonGenerator(0, "doorTotemRuins.schematic", true));
this.hubs.add(new DungeonGenerator(0, "hallwayTrapRooms1.schematic", false));
this.hubs.add(new DungeonGenerator(0, "longDoorHallway.schematic", false));
this.hubs.add(new DungeonGenerator(0, "smallRotundaWithExit.schematic", false));
this.hubs.add(new DungeonGenerator(0, "fortRuins.schematic", true));
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", false));
this.hubs.add(new DungeonGenerator(0, "4WayHallExit.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "collapsedSingleTunnel1.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "singleStraightHall1.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "smallBranchWithExit.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleLeft.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleRight.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsUp.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsDown.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "simpleSmallT1.schematic", null));
this.simpleHalls.add(new DungeonGenerator(0, "collapsedSingleTunnel1.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "singleStraightHall1.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "smallBranchWithExit.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleLeft.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "smallSimpleRight.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsUp.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "simpleStairsDown.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "simpleSmallT1.schematic", false));
this.complexHalls.add(new DungeonGenerator(0, "brokenPillarsO.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "buggyTopEntry1.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "exitRuinsWithHiddenDoor.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "hallwayHiddenTreasure.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "mediumPillarStairs.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "ruinsO.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "pitStairs.schematic", null));
this.complexHalls.add(new DungeonGenerator(0, "brokenPillarsO.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "buggyTopEntry1.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "exitRuinsWithHiddenDoor.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "hallwayHiddenTreasure.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "mediumPillarStairs.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "ruinsO.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "pitStairs.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "azersDungeonO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "diamondTowerTemple1.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "fallingTrapO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "hiddenStaircaseO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "lavaTrapO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "randomTree.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallHiddenTowerO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallSilverfishRoom.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "tntTrapO.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallDesert.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "smallPond.schematic", null));
this.deadEnds.add(new DungeonGenerator(0, "azersDungeonO.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "diamondTowerTemple1.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "fallingTrapO.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "hiddenStaircaseO.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "lavaTrapO.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "randomTree.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "smallHiddenTowerO.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "smallSilverfishRoom.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "tntTrapO.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "smallDesert.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "smallPond.schematic", true));
this.pistonTraps.add(new DungeonGenerator(0, "fakeTNTTrap.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFallRuins.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "fakeTNTTrap.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "hallwayPitFallTrap.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFallRuins.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "pistonFloorHall.schematic", false));
// this.pistonTraps.add(new DungeonGenerator(0, "pistonHallway.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonSmasherHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "raceTheTNTHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "simpleDropHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "lavaPyramid.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "pistonSmasherHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "raceTheTNTHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "simpleDropHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "wallFallcomboPistonHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "lavaPyramid.schematic", true));
this.mazes.add(new DungeonGenerator(0, "smallMaze1.schematic", null));
this.mazes.add(new DungeonGenerator(0, "smallMultilevelMaze.schematic", null));
this.mazes.add(new DungeonGenerator(0, "smallMaze1.schematic", false));
this.mazes.add(new DungeonGenerator(0, "smallMultilevelMaze.schematic", false));
this.exits.add(new DungeonGenerator(0, "exitCube.schematic", null));
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", null));
this.exits.add(new DungeonGenerator(0, "smallExitPrison.schematic", null));
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", null));
this.exits.add(new DungeonGenerator(0, "exitCube.schematic", true));
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", false));
this.exits.add(new DungeonGenerator(0, "smallExitPrison.schematic", true));
this.exits.add(new DungeonGenerator(0, "lockingExitHall.schematic", false));
this.registeredDungeons.addAll(this.simpleHalls);
this.registeredDungeons.addAll(this.exits);
@ -655,9 +655,18 @@ public class mod_pocketDim
this.metadataFlipList.add(Block.pistonBase.blockID);
this.metadataFlipList.add(Block.pistonStickyBase.blockID);
this.metadataFlipList.add(Block.stairsNetherBrick.blockID);
this.metadataFlipList.add(Block.stairsCobblestone.blockID);
this.metadataFlipList.add(Block.stairsNetherBrick.blockID);
this.metadataFlipList.add(Block.stairsNetherQuartz.blockID);
this.metadataFlipList.add(Block.stairsSandStone.blockID);
this.metadataNextList.add(Block.redstoneRepeaterIdle.blockID);
this.metadataNextList.add(Block.redstoneRepeaterActive.blockID);
proxy.loadTextures();

View file

@ -69,7 +69,7 @@ public class pocketGenerator extends ChunkProviderGenerate implements IChunkProv
DimData data = dimHelper.dimList.get(this.worldObj.provider.dimensionId);
if(data!=null)
{
if(data.isDimRandomRift&&data.isPocket)
if(data.isDimRandomRift&&data.isPocket&&!data.dungeonGenerator.isOpen)
{
ArrayList list = new ArrayList();

View file

@ -123,7 +123,11 @@ public class MobObelisk extends EntityFlying implements IMob
if(entityPlayer != null)
{
if(this.soundTime<=0)
{
this.playSound("mods.DimensionalDoors.sounds.Monolith", 1F, 1F);
this.soundTime=100;
}
@ -131,11 +135,8 @@ public class MobObelisk extends EntityFlying implements IMob
if(shouldAttackPlayer(entityPlayer))
{
if(soundTime<=0)
{
this.playSound("mods.DimensionalDoors.sounds.Monolith", 1F, 1F);
soundTime=100;
}
if(aggro<470)
{
@ -181,7 +182,7 @@ public class MobObelisk extends EntityFlying implements IMob
}
else
else if(!this.worldObj.isRemote)
{
@ -191,7 +192,6 @@ public class MobObelisk extends EntityFlying implements IMob
LinkData link = new LinkData(this.worldObj.provider.dimensionId, mod_pocketDim.limboDimID, (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);
this.worldObj.playSound(link.destXCoord,link.destYCoord,link.destZCoord, "mods.DimensionalDoors.sounds.wylkermaxcrack", 13, 1, true);
entityPlayer.worldObj.playSoundAtEntity(entityPlayer,"mods.DimensionalDoors.sounds.wylkermaxcrack",13, 1);
@ -223,10 +223,7 @@ public class MobObelisk extends EntityFlying implements IMob
}
else
{
if(this.worldObj.isRemote)
{
FMLClientHandler.instance().getClient().sndManager.stopEntitySound(this);
}
if(aggro>0)
{
aggro--;
@ -237,7 +234,7 @@ public class MobObelisk extends EntityFlying implements IMob
}
}
}
if(soundTime>0)
if(soundTime>=0)
{
soundTime--;
}