.schematic importer finished

This commit is contained in:
StevenRS11 2013-06-01 21:43:56 -04:00
parent 842216ee5e
commit 27c073f75d
21 changed files with 444 additions and 113 deletions

View file

@ -61,12 +61,14 @@ public class LinkData implements Serializable
}
public void printLinkData()
public String printLinkData()
{
System.out.println(String.valueOf(this.locDimID)+"locDimID "+String.valueOf(this.locXCoord)+"-locXCoord "+String.valueOf(this.locYCoord)+"-locYCoord "+String.valueOf(this.locZCoord)+"-locZCoord ");
System.out.println(String.valueOf(this.destDimID)+"DestDimID "+String.valueOf(this.destXCoord)+"-destXCoord "+String.valueOf(this.destYCoord)+"-destYCoord "+String.valueOf(this.destZCoord)+"-destZCoord ");
String linkInfo;
linkInfo=String.valueOf(this.locDimID)+"locDimID "+String.valueOf(this.locXCoord)+":locXCoord "+String.valueOf(this.locYCoord)+":locYCoord "+String.valueOf(this.locZCoord)+":locZCoord ";
linkInfo.concat("\n"+ String.valueOf(this.destDimID)+"DestDimID "+String.valueOf(this.destXCoord)+":destXCoord "+String.valueOf(this.destYCoord)+":destYCoord "+String.valueOf(this.destZCoord)+":destZCoord ");
return linkInfo;
}

View file

@ -1,4 +1,6 @@
package StevenDimDoors.mod_pocketDim;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
@ -59,15 +61,25 @@ public class SchematicLoader
public void init(String filePath, LinkData link)
{
this.schematic="/schematics/"+filePath;
this.schematic=filePath;
try
{
InputStream input;
String fname= schematic ;
InputStream input = this.getClass().getResourceAsStream(fname);
//FileInputStream fileinputstream = new FileInputStream(file);
if(!(new File(fname).exists()))
{
input = this.getClass().getResourceAsStream(fname);
}
else
{
System.out.println(new File(fname).exists());
input = new FileInputStream(fname);
}
//FileInputStream fileinputstream = new FileInputStream(file);
NBTTagCompound nbtdata = CompressedStreamTools.readCompressed(input);
@ -100,6 +112,11 @@ public class SchematicLoader
{
if(mod_pocketDim.metadataFlipList.contains(blockID))
{
switch (orientation)
{
case 0:
@ -137,7 +154,7 @@ public class SchematicLoader
}
}
else if(blockID== Block.lever.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
else if(blockID== Block.lever.blockID||blockID== Block.stoneButton.blockID||blockID== Block.woodenButton.blockID||blockID== Block.torchWood.blockID||blockID== Block.torchRedstoneIdle.blockID||blockID== Block.torchRedstoneActive.blockID)
{
switch (metadata)
{

View file

@ -1,8 +1,10 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.blocks;
import java.util.Random;
import StevenDimDoors.mod_pocketDim.blocks.dimDoor;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
@ -26,7 +28,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ChaosDoor extends dimDoor
{
private Icon blockIconBottom;
protected ChaosDoor(int par1, Material material)
public ChaosDoor(int par1, Material material)
{
super(par1, Material.iron);
// this.blockIndexInTexture = 18;

View file

@ -4,7 +4,7 @@ import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.pocketProvider;
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
import net.minecraft.block.BlockTrapDoor;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;

View file

@ -0,0 +1,45 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.copyfile;
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.MinecraftException;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class CommandEndDungeonCreation extends CommandBase
{
public String getCommandName()//the name of our command
{
return "end_dungeon_creation";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
// TODO Auto-generated method stub
}
}

View file

@ -61,34 +61,24 @@ public class CommandPrintDimData extends CommandBase
{
if(dimHelper.dimList.containsKey(targetDim))
{
for(DimData dimData :dimHelper.dimList.values())
{
DimData dimData = dimHelper.dimList.get(targetDim);
Collection<LinkData> links= new ArrayList();
links.addAll( dimData.printAllLinkData());
for(LinkData link : links)
{
if(link.destDimID==targetDim)
{
dimHelper.dimList.get(link.locDimID).removeLinkAtCoords(link);
linksRemoved++;
}
if(dimData.dimID==targetDim)
{
linksRemoved++;
}
this.getCommandSenderAsPlayer(var1).sendChatToPlayer( link.printLinkData());
}
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("DimID= "+dimData.dimID+"Dim depth = "+dimData.depth);
}
dimHelper.dimList.remove(targetDim);
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed dimension "+targetDim+" from DimDoors and deleted "+linksRemoved+" links");
}
else
{
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Error- dimension "+targetDim+" not registered with dimDoors");
}
}
@ -101,4 +91,3 @@ public class CommandPrintDimData extends CommandBase
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,52 @@
package StevenDimDoors.mod_pocketDim.commands;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLCommonHandler;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class CommandStartDungeonCreation extends CommandBase
{
public String getCommandName()//the name of our command
{
return "start_dungeon_creation";
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
EntityPlayer player = this.getCommandSenderAsPlayer(var1);
int x = (int) player.posX;
int y = (int) player.posY;
int z = (int) player.posZ;
LinkData link = new LinkData(player.worldObj.provider.dimensionId, 0, x, y+1, z, x, y+1, z, true, 3);
link = dimHelper.instance.createPocket(link,true, false);
dimHelper.instance.teleportToPocket(player.worldObj, link, player);
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer(String.valueOf(var2.length));
// this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Removed "+linksRemoved+" rifts.");
// TODO Auto-generated method stub
}
}

View file

@ -16,6 +16,9 @@ import java.util.Iterator;
import java.util.Random;
import java.util.Set;
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
@ -667,7 +670,7 @@ public class dimHelper extends DimensionManager
int blockToReplace= this.getWorld(destinationID).getBlockId(destX, destY, destZ);
if(blockToReplace!=mod_pocketDim.dimDoorID&&blockToReplace!=mod_pocketDim.linkExitDoorID&&blockToReplace!=mod_pocketDim.linkDimDoorID&&blockToReplace!=mod_pocketDim.ExitDoorID&&blockToReplace!=mod_pocketDim.transientDoorID)
if(blockToReplace!=mod_pocketDim.dimDoorID&&blockToReplace!=mod_pocketDim.ExitDoorID&&blockToReplace!=mod_pocketDim.transientDoorID)
{
this.getWorld(destinationID).setBlock(destX, destY-1, destZ, doorTypeToPlace,destOrientation,2);
this.getWorld(destinationID).setBlock(destX, destY, destZ, doorTypeToPlace,8,2);
@ -1023,7 +1026,7 @@ public class dimHelper extends DimensionManager
return link;
return linkData;
}
@ -1052,8 +1055,8 @@ public class dimHelper extends DimensionManager
FileOutputStream saveFile = null;
try
{
World world=FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
String saveFileName=world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsDataTEMP";
//World world=FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
String saveFileName=this.getCurrentSaveRootDirectory()+"/DimensionalDoorsDataTEMP";
saveFile = new FileOutputStream(saveFileName);
ObjectOutputStream save = new ObjectOutputStream(saveFile);
@ -1061,13 +1064,13 @@ public class dimHelper extends DimensionManager
save.close();
saveFile.close();
if(new File(world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsDataOLD").exists())
if(new File(this.getCurrentSaveRootDirectory()+"/DimensionalDoorsDataOLD").exists())
{
new File(world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsDataOLD").delete();
new File(this.getCurrentSaveRootDirectory()+"/DimensionalDoorsDataOLD").delete();
}
new File(world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsData").renameTo(new File(world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsDataOLD"));
new File(this.getCurrentSaveRootDirectory()+"/DimensionalDoorsData").renameTo(new File(this.getCurrentSaveRootDirectory()+"/DimensionalDoorsDataOLD"));
new File(saveFileName).renameTo( new File(world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsData"));
new File(saveFileName).renameTo( new File(this.getCurrentSaveRootDirectory()+"/DimensionalDoorsData"));
// System.out.println(String.valueOf(this.dimensionList));
}
catch(Exception e)
@ -1102,13 +1105,13 @@ public class dimHelper extends DimensionManager
World world=FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
File dataStore =new File( world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsData");
File dataStore =new File( this.getCurrentSaveRootDirectory()+"/DimensionalDoorsData");
if(!dataStore.exists())
{
if(!new File( world.getSaveHandler().getMapFileFromName("idcounts").getParentFile().getParent()+"/DimensionalDoorsDataOLD").exists())
if(!new File( this.getCurrentSaveRootDirectory()+"/DimensionalDoorsDataOLD").exists())
{
firstRun=true;
}

View file

@ -0,0 +1,37 @@
package StevenDimDoors.mod_pocketDim.helpers;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
public class copyfile
{
public static boolean copyFile(String ori, String dest)
{
try
{
InputStream in = (mod_pocketDim.class.getClass().getResourceAsStream(ori));
OutputStream out = new FileOutputStream(dest);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
return true;
}
}

View file

@ -4,6 +4,7 @@ import java.util.List;
import StevenDimDoors.mod_pocketDim.CommonTickHandler;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.SchematicLoader;
import StevenDimDoors.mod_pocketDim.Spells;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
@ -21,6 +22,8 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.RotationHelper;
public class ItemStableFabric extends Item
{
@ -38,6 +41,7 @@ public class ItemStableFabric extends Item
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
}
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
@ -46,6 +50,13 @@ public class ItemStableFabric extends Item
System.out.println("Block metadata is "+par3World.getBlockMetadata(par4, par5, par6));
System.out.println(par3World.getBiomeGenForCoords(par4, par6).biomeName);
this.onItemRightClick(par1ItemStack, par3World, par2EntityPlayer);
Block block = Block.blocksList[par3World.getBlockId(par4, par5, par6)];
}
//System.out.println("Block texture data is "+Block.blocksList[par3World.getBlockId(par4, par5, par6)].getBlockTexture(par3World,par4, par5, par6,par7).getIconName());
//System.out.println("Block name is is "+Block.blocksList[par3World.getBlockId(par4, par5, par6)].getUnlocalizedName2());

View file

@ -2,6 +2,8 @@ package StevenDimDoors.mod_pocketDim;
import java.io.File;
import java.net.URL;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.HashMap;
@ -44,6 +46,7 @@ import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWallPerm;
import StevenDimDoors.mod_pocketDim.blocks.BlockLimbo;
import StevenDimDoors.mod_pocketDim.blocks.BlockRift;
import StevenDimDoors.mod_pocketDim.blocks.ChaosDoor;
import StevenDimDoors.mod_pocketDim.blocks.ExitDoor;
import StevenDimDoors.mod_pocketDim.blocks.dimDoor;
import StevenDimDoors.mod_pocketDim.blocks.dimHatch;
@ -53,7 +56,11 @@ import StevenDimDoors.mod_pocketDim.commands.CommandAddDungeonRift;
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteAllLinks;
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteDimData;
import StevenDimDoors.mod_pocketDim.commands.CommandDeleteRifts;
import StevenDimDoors.mod_pocketDim.commands.CommandEndDungeonCreation;
import StevenDimDoors.mod_pocketDim.commands.CommandPrintDimData;
import StevenDimDoors.mod_pocketDim.commands.CommandPruneDims;
import StevenDimDoors.mod_pocketDim.commands.CommandStartDungeonCreation;
import StevenDimDoors.mod_pocketDim.helpers.copyfile;
import StevenDimDoors.mod_pocketDim.items.ItemChaosDoor;
import StevenDimDoors.mod_pocketDim.items.ItemRiftBlade;
import StevenDimDoors.mod_pocketDim.items.ItemStabilizedRiftSignature;
@ -63,6 +70,10 @@ import StevenDimDoors.mod_pocketDim.items.itemExitDoor;
import StevenDimDoors.mod_pocketDim.items.itemLinkSignature;
import StevenDimDoors.mod_pocketDim.items.itemRiftRemover;
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
import StevenDimDoors.mod_pocketDim.world.BiomeGenLimbo;
import StevenDimDoors.mod_pocketDim.world.BiomeGenPocket;
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
@Mod(modid = mod_pocketDim.modid, name = "Dimensional Doors", version = mod_pocketDim.version)
@ -91,18 +102,23 @@ public class mod_pocketDim
public static mod_pocketDim instance = new mod_pocketDim();
public static SchematicLoader loader = new SchematicLoader();
public static pocketTeleporter teleporter = new pocketTeleporter();
public static final ICommand printDimData = new CommandPrintDimData();
public static final ICommand removeRiftsCommand = new CommandDeleteRifts();
public static final ICommand pruneDimsCommand = new CommandPruneDims();
public static final ICommand removeAllLinksCommand = new CommandDeleteAllLinks();
public static final ICommand deleteDimDataCommand = new CommandDeleteDimData();
public static final ICommand addDungeonRift = new CommandAddDungeonRift();
//public static final ICommand endDungeonCreation = new CommandEndDungeonCreation();
public static final ICommand startDungeonCreation = new CommandStartDungeonCreation();
public static int providerID;
public static int dimDoorID;
public static int ExitDoorID;
public static int linkExitDoorID;
// public static int linkExitDoorID;
public static int itemLinkSignatureID;
public static int blockRiftID;
public static int transientDoorID;
@ -128,7 +144,7 @@ public class mod_pocketDim
public static int itemDimDoorID;
public static int linkDimDoorID;
///public static int linkDimDoorID;
public static int blockDimWallID;
public static int itemRiftRemoverID;
public static int blockDimWallPermID;
@ -193,7 +209,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", true);
public static DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
@ -264,6 +280,98 @@ public class mod_pocketDim
DimDoorsConfig.loadConfig(configFile);
String schematicDir = configFile.getParent()+"/DimDoors_Custom_schematics";
File file= new File(schematicDir);
file.mkdir();
String helpFile = "/mods/DimDoors/How_to_add_dungeons.txt";
copyfile.copyFile(helpFile, file+"/How_to_add_dungeons.txt");
File[] schematicNames=file.listFiles();
if(schematicNames!=null)
{
for(File schematicFile: schematicNames)
{
try
{
if(schematicFile.getName().contains("schematic"))
{
String[] name = schematicFile.getName().split("_");
boolean open= name[2].equals("open");
int weight = Integer.parseInt(name[3].replace(".schematic", ""));
String path = schematicFile.getAbsolutePath();
if(name[0].equals("hub"))
{
this.hubs.add(new DungeonGenerator(weight,path,open));
}
else if(name[0].equals("simpleHall"))
{
this.simpleHalls.add(new DungeonGenerator(weight,path,open));
}
else if(name[0].equals("complexHall"))
{
this.complexHalls.add(new DungeonGenerator(weight,path,open));
}
else if(name[0].equals("pistonTrap"))
{
this.pistonTraps.add(new DungeonGenerator(weight,path,open));
}
else if(name[0].equals("deadEnd"))
{
this.deadEnds.add(new DungeonGenerator(weight,path,open));
}
else if(name[0].equals("exit"))
{
this.exits.add(new DungeonGenerator(weight,path,open));
}
else if(name[0].equals("mazes"))
{
this.mazes.add(new DungeonGenerator(weight,path,open));
}
this.registeredDungeons.add(new DungeonGenerator(weight,path,open));
System.out.println("Imported "+schematicFile.getName());
}
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Importing custom dungeon failed");
}
}
}
@ -491,8 +599,8 @@ public class mod_pocketDim
this.blocksImmuneToRift.add(this.blockDimWallPermID);
this.blocksImmuneToRift.add(this.dimDoorID);
this.blocksImmuneToRift.add(this.ExitDoorID);
this.blocksImmuneToRift.add(this.linkDimDoorID);
this.blocksImmuneToRift.add(this.linkExitDoorID);
// this.blocksImmuneToRift.add(this.linkDimDoorID);
// this.blocksImmuneToRift.add(this.linkExitDoorID);
this.blocksImmuneToRift.add(this.dimHatchID);
this.blocksImmuneToRift.add(this.chaosDoorID);
this.blocksImmuneToRift.add(this.blockRiftID);
@ -505,73 +613,73 @@ public class mod_pocketDim
this.blocksImmuneToRift.add(Block.bedrock.blockID);
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.hubs.add(new DungeonGenerator(0, "/schematics/4WayBasicHall.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/4WayBasicHall.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/doorTotemRuins.schematic", true));
this.hubs.add(new DungeonGenerator(0, "/schematics/hallwayTrapRooms1.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/longDoorHallway.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/smallRotundaWithExit.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/fortRuins.schematic", true));
this.hubs.add(new DungeonGenerator(0, "/schematics/4WayHallExit.schematic", false));
this.hubs.add(new DungeonGenerator(0, "/schematics/4WayHallExit.schematic", false));
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.simpleHalls.add(new DungeonGenerator(0, "/schematics/collapsedSingleTunnel1.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/singleStraightHall1.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/smallBranchWithExit.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/smallSimpleLeft.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/smallSimpleRight.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/simpleStairsUp.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/simpleStairsDown.schematic", false));
this.simpleHalls.add(new DungeonGenerator(0, "/schematics/simpleSmallT1.schematic", false));
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", false));
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.complexHalls.add(new DungeonGenerator(0, "/schematics/brokenPillarsO.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "/schematics/buggyTopEntry1.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "/schematics/exitRuinsWithHiddenDoor.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "/schematics/hallwayHiddenTreasure.schematic", false));
this.complexHalls.add(new DungeonGenerator(0, "/schematics/mediumPillarStairs.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "/schematics/ruinsO.schematic", true));
this.complexHalls.add(new DungeonGenerator(0, "/schematics/pitStairs.schematic", true));
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.deadEnds.add(new DungeonGenerator(0, "/schematics/azersDungeonO.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/diamondTowerTemple1.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/fallingTrapO.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/hiddenStaircaseO.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/lavaTrapO.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/smallSilverfishRoom.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/tntTrapO.schematic", false));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallDesert.schematic", true));
this.deadEnds.add(new DungeonGenerator(0, "/schematics/smallPond.schematic", true));
// 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", 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.pistonTraps.add(new DungeonGenerator(0, "/schematics/fakeTNTTrap.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/hallwayPitFallTrap.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/hallwayPitFallTrap.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/pistonFallRuins.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/pistonFloorHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/pistonFloorHall.schematic", false));
// this.pistonTraps.add(new DungeonGenerator(0, "/schematics/pistonHallway.schematic", null));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/pistonSmasherHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/raceTheTNTHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/simpleDropHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/wallFallcomboPistonHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/wallFallcomboPistonHall.schematic", false));
this.pistonTraps.add(new DungeonGenerator(0, "/schematics/lavaPyramid.schematic", true));
this.mazes.add(new DungeonGenerator(0, "smallMaze1.schematic", false));
this.mazes.add(new DungeonGenerator(0, "smallMultilevelMaze.schematic", false));
this.mazes.add(new DungeonGenerator(0, "/schematics/smallMaze1.schematic", false));
this.mazes.add(new DungeonGenerator(0, "/schematics/smallMultilevelMaze.schematic", false));
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.exits.add(new DungeonGenerator(0, "/schematics/exitCube.schematic", true));
this.exits.add(new DungeonGenerator(0, "/schematics/lockingExitHall.schematic", false));
this.exits.add(new DungeonGenerator(0, "/schematics/smallExitPrison.schematic", true));
this.exits.add(new DungeonGenerator(0, "/schematics/lockingExitHall.schematic", false));
this.registeredDungeons.addAll(this.simpleHalls);
this.registeredDungeons.addAll(this.exits);
@ -656,6 +764,8 @@ public class mod_pocketDim
event.registerServerCommand(removeAllLinksCommand);
event.registerServerCommand(deleteDimDataCommand);
event.registerServerCommand(addDungeonRift);
event.registerServerCommand(this.startDungeonCreation);
event.registerServerCommand(this.printDimData);
dimHelper.instance.load();
if(!dimHelper.dimList.containsKey(this.limboDimID))

View file

@ -13,11 +13,11 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import StevenDimDoors.mod_pocketDim.LimboProvider;
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.pocketProvider;
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.network.PacketDispatcher;

View file

@ -1,4 +1,4 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
import net.minecraft.entity.monster.EntitySpider;
@ -7,7 +7,7 @@ import net.minecraft.world.biome.SpawnListEntry;
public class BiomeGenLimbo extends BiomeGenBase
{
protected BiomeGenLimbo(int par1)
public BiomeGenLimbo(int par1)
{
super(par1);
this.theBiomeDecorator.treesPerChunk = 0;

View file

@ -1,4 +1,4 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
import net.minecraft.world.biome.BiomeGenBase;
@ -6,7 +6,7 @@ import net.minecraft.world.biome.SpawnListEntry;
public class BiomeGenPocket extends BiomeGenBase
{
protected BiomeGenPocket(int par1)
public BiomeGenPocket(int par1)
{
super(par1);
this.theBiomeDecorator.treesPerChunk = 0;

View file

@ -1,8 +1,11 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import java.util.List;
import java.util.Random;
import StevenDimDoors.mod_pocketDim.CustomCaveGen;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.IProgressUpdate;

View file

@ -1,5 +1,8 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
import StevenDimDoors.mod_pocketDim.limboSkyProvider;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ChunkCoordinates;

View file

@ -1,5 +1,6 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;

View file

@ -1,4 +1,4 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -1,8 +1,10 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import java.util.ArrayList;
import java.util.List;
import StevenDimDoors.mod_pocketDim.DimData;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
import net.minecraft.entity.EnumCreatureType;

View file

@ -1,5 +1,8 @@
package StevenDimDoors.mod_pocketDim;
package StevenDimDoors.mod_pocketDim.world;
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
import StevenDimDoors.mod_pocketDim.dimHelper;
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.Vec3;
@ -18,6 +21,9 @@ public class pocketProvider extends WorldProvider
public int exitZCoord;
public int exitDimID;
public boolean hasNoSky = true;
public boolean isSavingSchematic= false;
public int dimToSave;
public pocketProvider()
{
this.hasNoSky=true;
@ -36,6 +42,14 @@ public class pocketProvider extends WorldProvider
{
return (dimensionId == 0 ? null : "DimensionalDoors/pocketDimID" + dimensionId);
}
public void saveAsSchematic(int id)
{
this.isSavingSchematic=true;
this.dimensionId=id;
}
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
{
setCloudRenderer( new CloudRenderBlank());
@ -84,13 +98,13 @@ public class pocketProvider extends WorldProvider
{
int respawnDim;
if(mod_pocketDim.isLimboActive)
// if(mod_pocketDim.isLimboActive)
{
respawnDim= mod_pocketDim.limboDimID;
}
else
// else
{
respawnDim= dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
// respawnDim= dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
}
if(dimHelper.getWorld(respawnDim)==null)

View file

@ -0,0 +1,40 @@
Adding dungeons is pretty simple, but you have to know the various flags and stuff I use to read them in and build them. Ill walk you through the process here, and provide all the flags and a breif description of what they mean here.
You will also need a copy of mcEdit to export your custom dungeons.
To get started, run minecraft with DimDoors installed and type the following command-
/start_dungeon_creation
This will generate an empty pocket dim for you to build with that is in the proper orientation (north). If you do not use this command, you WILL run into issues later.
So on to the building- You can ONLY use vanilla blocks in the dungeons. Everything that is not vanilla MC will be turned into fabric of reality when I gen them, or it will crash horribly. The only exceptions to this are DimDoors blocks, which will always be turned into fabric of reality.
The first step is to make your entrance door. This is where the player will appear when they teleport in for the first time. It is marked by a vanilla wooden door. It will be replaced by a wooden warp door on generation.
As you build your dungeon, there are a few restrictions. Any chests you place will get filled with random loot, and not what you place in them. Any dispensers will get a few stacks of arrows. Other than that, any vanilla mechanics should work fine, except rails. Im working on that now.
Any vanilla iron doors you place will become iron dim doors, and link to more dungeon pockets, so use these to make your dungeon lead farther into a dungeon chain.
If you want your dungeon to link back the overworld, place a vanilla wooden door on top of a sandstone block. This will mark it as an exit door, and it will gen as a wooden Dim door leading to the overworld (or whatever dim this chain started in)
Once you have finished creating your dungeon, close minecraft Close minecraft while you are STILL IN THE POCKET and open your pocketDimension save folder. Inside, find the pocket dimension you where building in by its ID. Copy this folder up one level (into your main world data save folder and rename it to DIM<id>.
Now using mcEdit, open the main world save and use the find player function to warp to that dimension. Select your pocket with mcEdit, and export this as an .schematic file.
Congratulations! You have finished the hard part. Now all you need to do is name you .schematic and drop it into the DimDoors_Custom_schematics folder thats in the same directory as all your config files.
To name it, use the following format-
<dungeonType>_<yourDungeonName>_<isOpen>_<spawnWeight>.schematic
The dungeon types are hub, simpleHall, complexHall, pistonTrap, maze, exit, and deadEnd.
isOpen determines if the dungeon is an open-air style pocket, or a closed in/walled it pocket that will spawn Monoliths.
Spawn weight determines how frequently you want it to appear. The default is one, and it will have the same relative weight as all the others.
For example- hub_hallWith5Doors_1.schematic