Fixed Doors and Minor Dungeon Change

Fixed the regression bug that caused some of our doors to get placed in
the wrong direction. Changing doors to inherit from BaseDimDoor caused
BlockRotator to assume they weren't dimensional doors because it used
"instanceof DimensionalDoor" to check. Thanks for figuring it out,
Steven! ^_^

Also made a minor change to dungeon generation. We now check the game
rule doMobSpawning and don't spawn Monoliths from DungeonSchematic if
the value is false. This is useful for testing without Monoliths around.
We still do work to remove the portal frame blocks even if the mobs
aren't spawned.
This commit is contained in:
SenseiKiwi
2013-09-07 20:14:14 -04:00
parent 921b6e88af
commit 1d1d0a767c
3 changed files with 14 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ import StevenDimDoors.mod_pocketDim.schematic.InvalidSchematicException;
import StevenDimDoors.mod_pocketDim.schematic.ReplacementFilter;
import StevenDimDoors.mod_pocketDim.schematic.Schematic;
import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
import StevenDimDoors.mod_pocketDim.util.Point4D;
public class DungeonSchematic extends Schematic {
@@ -251,10 +252,11 @@ public class DungeonSchematic extends Schematic {
createExitDoorLink(world, dimension, location, entranceDoorLocation, turnAngle, pocketCenter);
}
//Remove end portal frames and spawn Monoliths
//Remove end portal frames and spawn Monoliths, if allowed
boolean canSpawn = MonolithSpawner.isMobSpawningAllowed();
for (Point3D location : monolithSpawnLocations)
{
spawnMonolith(world, location, entranceDoorLocation, turnAngle, pocketCenter);
spawnMonolith(world, location, entranceDoorLocation, turnAngle, pocketCenter, canSpawn);
}
}
@@ -317,7 +319,7 @@ public class DungeonSchematic extends Schematic {
dimension.createLink(location.getX(), location.getY(), location.getZ(), LinkTypes.DUNGEON);
}
private static void spawnMonolith(World world, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter)
private static void spawnMonolith(World world, Point3D point, Point3D entrance, int rotation, Point3D pocketCenter, boolean canSpawn)
{
//Transform the frame block's location to the pocket coordinate system
Point3D location = point.clone();
@@ -325,8 +327,11 @@ public class DungeonSchematic extends Schematic {
//Remove frame block
setBlockDirectly(world, location.getX(), location.getY(), location.getZ(), 0, 0);
//Spawn Monolith
Entity mob = new MobMonolith(world);
mob.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), 1, 1);
world.spawnEntityInWorld(mob);
if (canSpawn)
{
Entity mob = new MobMonolith(world);
mob.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), 1, 1);
world.spawnEntityInWorld(mob);
}
}
}