Major Improvements to DungeonHelper, Minor Bug Fixes and Tweaks #25
46
StevenDimDoors/mod_pocketDim/BlankTeleporter.java
Normal file
46
StevenDimDoors/mod_pocketDim/BlankTeleporter.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.Teleporter;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.WorldServer;
|
||||||
|
|
||||||
|
public class BlankTeleporter extends Teleporter
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public BlankTeleporter(WorldServer par1WorldServer)
|
||||||
|
{
|
||||||
|
super(par1WorldServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new portal near an entity.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||||
|
{
|
||||||
|
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||||
|
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
||||||
|
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||||
|
entity.setPosition(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeStalePortalLocations(long par1)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,6 +99,8 @@ public class DDProperties
|
|||||||
|
|
||||||
public final int NonTntWeight;
|
public final int NonTntWeight;
|
||||||
public final int RiftSpreadModifier;
|
public final int RiftSpreadModifier;
|
||||||
|
public final int DungeonRiftGenDensity;
|
||||||
|
public final int MonolithSpawnDensity;
|
||||||
public final int LimboReturnRange;
|
public final int LimboReturnRange;
|
||||||
public final String CustomSchematicDirectory;
|
public final String CustomSchematicDirectory;
|
||||||
|
|
||||||
@@ -197,6 +199,12 @@ public class DDProperties
|
|||||||
|
|
||||||
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
|
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
|
||||||
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true);
|
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true);
|
||||||
|
|
||||||
|
MonolithSpawnDensity = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", 7,
|
||||||
|
"Sets the chance that monoliths will not spawn in a give Limbo chunk- higher values mean fewer monoliths, must be greater than 0, default is 7.").getInt();
|
||||||
|
|
||||||
|
DungeonRiftGenDensity = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", 250,
|
||||||
|
"Sets the dungeon rift density in the overworld, higher values mean less rifts, must be greater than 0. Default is 250.").getInt();
|
||||||
|
|
||||||
RiftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "Rift Spread Modifier", 3,
|
RiftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "Rift Spread Modifier", 3,
|
||||||
"Sets the number of times a rift can spread. 0 prevents rifts from spreading at all. " +
|
"Sets the number of times a rift can spread. 0 prevents rifts from spreading at all. " +
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.Teleporter;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldServer;
|
|
||||||
|
|
||||||
public class RailTeleporter extends Teleporter
|
|
||||||
{
|
|
||||||
int x,y,z;
|
|
||||||
World world;
|
|
||||||
LinkData sendingLink;
|
|
||||||
|
|
||||||
|
|
||||||
public RailTeleporter(WorldServer par1WorldServer, LinkData link)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
super(par1WorldServer);
|
|
||||||
this.x=link.destXCoord;
|
|
||||||
this.y=link.destYCoord;
|
|
||||||
this.z=link.destZCoord;
|
|
||||||
this.sendingLink=link;
|
|
||||||
world = par1WorldServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new portal near an entity.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
int id;
|
|
||||||
|
|
||||||
|
|
||||||
id=dimHelper.instance.getDestOrientation(sendingLink);
|
|
||||||
//System.out.println("Teleporting with link oreintation "+id);
|
|
||||||
|
|
||||||
|
|
||||||
par1Entity.rotationYaw=(id*90)+90;
|
|
||||||
if(id==2||id==6)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+2.5, y, z+.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==3||id==7)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity, x+.5, y, z+2.5 );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==0||id==4)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x-1.5, y, z+.5);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(id==1||id==5)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x+.5, y, z-1.5);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
this.setEntityPosition(par1Entity,x, y, z);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
par1Entity.worldObj.updateEntityWithOptionalForce(par1Entity, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
|
||||||
{
|
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
|
||||||
entity.setPosition(x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removeStalePortalLocations(long par1)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -51,8 +51,8 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
if(this.shouldGenHere)
|
if(this.shouldGenHere)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//TODO give this a clamp int type functionality
|
||||||
if(random.nextInt(3500)==0)
|
if(random.nextInt(3000+properties.DungeonRiftGenDensity*4)==0)
|
||||||
{
|
{
|
||||||
i=chunkX*16-random.nextInt(16);
|
i=chunkX*16-random.nextInt(16);
|
||||||
k=chunkZ*16-random.nextInt(16);
|
k=chunkZ*16-random.nextInt(16);
|
||||||
@@ -150,7 +150,7 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(random.nextInt(250)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote && properties.WorldRiftGenerationEnabled)
|
if(random.nextInt(properties.DungeonRiftGenDensity)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote && properties.WorldRiftGenerationEnabled)
|
||||||
{
|
{
|
||||||
// System.out.println("tryingToGen");
|
// System.out.println("tryingToGen");
|
||||||
int blockID=Block.stoneBrick.blockID;
|
int blockID=Block.stoneBrick.blockID;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class SchematicLoader
|
|||||||
public void init(LinkData link)
|
public void init(LinkData link)
|
||||||
{
|
{
|
||||||
//adding default pocket
|
//adding default pocket
|
||||||
String filePath=DungeonHelper.defaultBreak.schematicPath;
|
String filePath=DungeonHelper.instance().defaultBreak.schematicPath;
|
||||||
if(dimHelper.dimList.containsKey(link.destDimID))
|
if(dimHelper.dimList.containsKey(link.destDimID))
|
||||||
{
|
{
|
||||||
if(dimHelper.dimList.get(link.destDimID).dungeonGenerator!=null)
|
if(dimHelper.dimList.get(link.destDimID).dungeonGenerator!=null)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.Random;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.BlankTeleporter;
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -83,7 +84,7 @@ public class BlockDimWallPerm extends Block
|
|||||||
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z );
|
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, 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
|
||||||
|
|
||||||
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) par5Entity, 0);
|
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) par5Entity, 0,new BlankTeleporter((WorldServer)par5Entity.worldObj));
|
||||||
//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),
|
||||||
// EntityPlayer.class.cast(par5Entity));
|
// EntityPlayer.class.cast(par5Entity));
|
||||||
|
|
||||||
|
|||||||
@@ -71,8 +71,9 @@ public class DungeonHelper
|
|||||||
|
|
||||||
public ArrayList<Integer> metadataFlipList = new ArrayList<Integer>();
|
public ArrayList<Integer> metadataFlipList = new ArrayList<Integer>();
|
||||||
public ArrayList<Integer> metadataNextList = new ArrayList<Integer>();
|
public ArrayList<Integer> metadataNextList = new ArrayList<Integer>();
|
||||||
public static DungeonGenerator defaultBreak = new DungeonGenerator(0, "/schematic/somethingBroke.schematic", true);
|
public DungeonGenerator defaultBreak = new DungeonGenerator(0, "/schematic/somethingBroke.schematic", true);
|
||||||
public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
|
public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
|
||||||
|
|
||||||
private HashSet<String> dungeonTypeChecker;
|
private HashSet<String> dungeonTypeChecker;
|
||||||
private Hashtable<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;
|
private Hashtable<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;
|
||||||
|
|
||||||
@@ -309,7 +310,7 @@ public class DungeonHelper
|
|||||||
this.deadEnds.add(new DungeonGenerator(0, "/schematics/randomTree.schematic", true));
|
this.deadEnds.add(new DungeonGenerator(0, "/schematics/randomTree.schematic", true));
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallHiddenTowerO.schematic", true));
|
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallHiddenTowerO.schematic", true));
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallSilverfishRoom.schematic", false));
|
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallSilverfishRoom.schematic", false));
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "/schematics/tntTrapO.schematic", false));
|
this.deadEnds.add(new DungeonGenerator(0, "/schematics/tntTrapO.schematic", true));
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallDesert.schematic", true));
|
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallDesert.schematic", true));
|
||||||
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallPond.schematic", true));
|
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallPond.schematic", true));
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,11 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
@Override
|
@Override
|
||||||
public void onEntityUpdate()
|
public void onEntityUpdate()
|
||||||
{
|
{
|
||||||
|
if(!(this.worldObj.provider instanceof LimboProvider ||this.worldObj.provider instanceof pocketProvider))
|
||||||
|
{
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||||
|
|
||||||
this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png";
|
this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png";
|
||||||
@@ -199,10 +204,7 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
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);
|
||||||
if(!(this.worldObj.provider instanceof LimboProvider ||this.worldObj.provider instanceof pocketProvider))
|
|
||||||
{
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(rand.nextInt(7)>1)
|
if(rand.nextInt(properties.MonolithSpawnDensity)>1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user