Progress on Rewrite #86
@@ -27,6 +27,7 @@ import StevenDimDoors.mod_pocketDim.schematic.InvalidSchematicException;
|
|||||||
import StevenDimDoors.mod_pocketDim.schematic.ReplacementFilter;
|
import StevenDimDoors.mod_pocketDim.schematic.ReplacementFilter;
|
||||||
import StevenDimDoors.mod_pocketDim.schematic.Schematic;
|
import StevenDimDoors.mod_pocketDim.schematic.Schematic;
|
||||||
import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
|
import StevenDimDoors.mod_pocketDim.ticking.MobMonolith;
|
||||||
|
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
||||||
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
import StevenDimDoors.mod_pocketDim.util.Point4D;
|
||||||
|
|
||||||
public class DungeonSchematic extends Schematic {
|
public class DungeonSchematic extends Schematic {
|
||||||
@@ -251,10 +252,11 @@ public class DungeonSchematic extends Schematic {
|
|||||||
createExitDoorLink(world, dimension, location, entranceDoorLocation, turnAngle, pocketCenter);
|
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)
|
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);
|
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
|
//Transform the frame block's location to the pocket coordinate system
|
||||||
Point3D location = point.clone();
|
Point3D location = point.clone();
|
||||||
@@ -325,8 +327,11 @@ public class DungeonSchematic extends Schematic {
|
|||||||
//Remove frame block
|
//Remove frame block
|
||||||
setBlockDirectly(world, location.getX(), location.getY(), location.getZ(), 0, 0);
|
setBlockDirectly(world, location.getX(), location.getY(), location.getZ(), 0, 0);
|
||||||
//Spawn Monolith
|
//Spawn Monolith
|
||||||
|
if (canSpawn)
|
||||||
|
{
|
||||||
Entity mob = new MobMonolith(world);
|
Entity mob = new MobMonolith(world);
|
||||||
mob.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), 1, 1);
|
mob.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), 1, 1);
|
||||||
world.spawnEntityInWorld(mob);
|
world.spawnEntityInWorld(mob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import net.minecraft.block.BlockRedstoneRepeater;
|
|||||||
import net.minecraft.block.BlockStairs;
|
import net.minecraft.block.BlockStairs;
|
||||||
import StevenDimDoors.mod_pocketDim.Point3D;
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.DimensionalDoor;
|
import StevenDimDoors.mod_pocketDim.blocks.BaseDimDoor;
|
||||||
|
|
||||||
public class BlockRotator
|
public class BlockRotator
|
||||||
{
|
{
|
||||||
@@ -379,7 +379,7 @@ public class BlockRotator
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(Block.blocksList[blockID] instanceof BlockRedstoneRepeater || Block.blocksList[blockID] instanceof BlockDoor || Block.blocksList[blockID] instanceof DimensionalDoor || blockID== Block.tripWireSource.blockID || Block.blocksList[blockID] instanceof BlockComparator)
|
else if(Block.blocksList[blockID] instanceof BlockRedstoneRepeater || Block.blocksList[blockID] instanceof BlockDoor || Block.blocksList[blockID] instanceof BaseDimDoor || blockID== Block.tripWireSource.blockID || Block.blocksList[blockID] instanceof BlockComparator)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class MonolithSpawner implements IRegularTickReceiver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isMobSpawningAllowed()
|
public static boolean isMobSpawningAllowed()
|
||||||
{
|
{
|
||||||
//This function is used to retrieve the value of doMobSpawning. The code is the same
|
//This function is used to retrieve the value of doMobSpawning. The code is the same
|
||||||
//as the code used by Minecraft. Jaitsu requested this to make testing easier. ~SenseiKiwi
|
//as the code used by Minecraft. Jaitsu requested this to make testing easier. ~SenseiKiwi
|
||||||
|
|||||||
Reference in New Issue
Block a user