changed import function
This commit is contained in:
@@ -180,7 +180,7 @@ public class DimDoorsConfig
|
|||||||
|
|
||||||
|
|
||||||
bWorldGenRifts = config.get(Configuration.CATEGORY_GENERAL, "bWorldGenRifts", true);
|
bWorldGenRifts = config.get(Configuration.CATEGORY_GENERAL, "bWorldGenRifts", true);
|
||||||
bWorldGenRifts.comment = "Toggles the natrual generation of dungeon rifts other dimensions";
|
bWorldGenRifts.comment = "Toggles the natrual generation of dungeon rifts in other dimensions";
|
||||||
|
|
||||||
bLimboActive = config.get(Configuration.CATEGORY_GENERAL, "bLimboActive", true);
|
bLimboActive = config.get(Configuration.CATEGORY_GENERAL, "bLimboActive", true);
|
||||||
bLimboActive.comment="Toggles if dying in a pocket dim respawns the player in limbo";
|
bLimboActive.comment="Toggles if dying in a pocket dim respawns the player in limbo";
|
||||||
@@ -188,8 +188,8 @@ public class DimDoorsConfig
|
|||||||
riftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "riftSpreadModifier", 3);
|
riftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "riftSpreadModifier", 3);
|
||||||
riftSpreadModifier.comment = "How many times a rift can spread- 0 prevents rifts from spreading at all. I dont recommend putting it highter than 5, because its rather exponential. ";
|
riftSpreadModifier.comment = "How many times a rift can spread- 0 prevents rifts from spreading at all. I dont recommend putting it highter than 5, because its rather exponential. ";
|
||||||
|
|
||||||
limboBiomeID=config.get(Configuration.CATEGORY_GENERAL, "limboBiomeID", 217);
|
limboBiomeID=config.get(Configuration.CATEGORY_GENERAL, "limboBiomeID", 251);
|
||||||
pocketBiomeID=config.get(Configuration.CATEGORY_GENERAL, "pocketBiomeID", 218);
|
pocketBiomeID=config.get(Configuration.CATEGORY_GENERAL, "pocketBiomeID", 250);
|
||||||
|
|
||||||
|
|
||||||
config.save();
|
config.save();
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ public class DungeonGenerator implements Serializable
|
|||||||
// DungeonGenerator
|
// DungeonGenerator
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
int count=10;
|
int count=10;
|
||||||
|
try
|
||||||
|
{
|
||||||
if(incoming.destYCoord>15)
|
if(incoming.destYCoord>15)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@@ -178,6 +179,11 @@ public class DungeonGenerator implements Serializable
|
|||||||
{
|
{
|
||||||
dungeon= mod_pocketDim.defaultUp;
|
dungeon= mod_pocketDim.defaultUp;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
dungeon = mod_pocketDim.registeredDungeons.get(rand.nextInt(mod_pocketDim.registeredDungeons.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mod_pocketDim.loader.init(dungeon.schematicPath, incoming);
|
mod_pocketDim.loader.init(dungeon.schematicPath, incoming);
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockComparator;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.BlockDoor;
|
||||||
|
import net.minecraft.block.BlockRedstoneRepeater;
|
||||||
import net.minecraft.block.BlockStairs;
|
import net.minecraft.block.BlockStairs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -21,9 +22,9 @@ import net.minecraft.tileentity.TileEntityDispenser;
|
|||||||
import net.minecraft.util.WeightedRandomChestContent;
|
import net.minecraft.util.WeightedRandomChestContent;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraft.world.chunk.EmptyChunk;
|
|
||||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||||
import net.minecraftforge.common.ChestGenHooks;
|
import net.minecraftforge.common.ChestGenHooks;
|
||||||
|
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
||||||
|
|
||||||
public class SchematicLoader
|
public class SchematicLoader
|
||||||
|
|
||||||
@@ -32,8 +33,11 @@ public class SchematicLoader
|
|||||||
public short height;
|
public short height;
|
||||||
public short length;
|
public short length;
|
||||||
|
|
||||||
public byte[] blocks;
|
public short[] blocks;
|
||||||
public byte[] data;
|
public byte[] blockData;
|
||||||
|
public byte[] addId = new byte[0];
|
||||||
|
public byte[] blockId;
|
||||||
|
|
||||||
public NBTTagList entities;
|
public NBTTagList entities;
|
||||||
public NBTTagList tileentities;
|
public NBTTagList tileentities;
|
||||||
private Random rand = new Random();
|
private Random rand = new Random();
|
||||||
@@ -88,13 +92,33 @@ public class SchematicLoader
|
|||||||
height = nbtdata.getShort("Height");
|
height = nbtdata.getShort("Height");
|
||||||
length = nbtdata.getShort("Length");
|
length = nbtdata.getShort("Length");
|
||||||
|
|
||||||
blocks = nbtdata.getByteArray("Blocks");
|
|
||||||
data = nbtdata.getByteArray("Data");
|
|
||||||
|
|
||||||
entities = nbtdata.getTagList("Entities");
|
blockId = nbtdata.getByteArray("Blocks");
|
||||||
tileentities = nbtdata.getTagList("TileEntities");
|
blockData = nbtdata.getByteArray("Data");
|
||||||
this.didRead=true;
|
|
||||||
input.close();
|
blocks=new short[blockId.length];
|
||||||
|
|
||||||
|
this.addId = nbtdata.getByteArray("AddBlocks");
|
||||||
|
|
||||||
|
entities = nbtdata.getTagList("Entities");
|
||||||
|
tileentities = nbtdata.getTagList("TileEntities");
|
||||||
|
this.didRead=true;
|
||||||
|
input.close();
|
||||||
|
|
||||||
|
|
||||||
|
for (int index = 0; index < blockId.length; index++) {
|
||||||
|
if ((index >> 1) >= addId.length) { // No corresponding AddBlocks index
|
||||||
|
blocks[index] = (short) (blockId[index] & 0xFF);
|
||||||
|
} else {
|
||||||
|
if ((index & 1) == 0) {
|
||||||
|
blocks[index] = (short) (((addId[index >> 1] & 0x0F) << 8) + (blockId[index] & 0xFF));
|
||||||
|
} else {
|
||||||
|
blocks[index] = (short) (((addId[index >> 1] & 0xF0) << 4) + (blockId[index] & 0xFF));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -188,7 +212,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
|
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID||blockID==Block.dropper.blockID)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
@@ -224,7 +248,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID)
|
else if(Block.blocksList[blockID] instanceof BlockRedstoneRepeater ||Block.blocksList[blockID] instanceof BlockDoor ||blockID== Block.tripWireSource.blockID||Block.blocksList[blockID] instanceof BlockComparator)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
@@ -359,7 +383,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
|
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID||blockID==Block.dropper.blockID)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
@@ -394,7 +418,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID)
|
else if(Block.blocksList[blockID] instanceof BlockRedstoneRepeater ||Block.blocksList[blockID] instanceof BlockDoor ||blockID== Block.tripWireSource.blockID||Block.blocksList[blockID] instanceof BlockComparator)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
@@ -524,7 +548,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID)
|
else if(blockID== Block.pistonBase.blockID||blockID==Block.pistonStickyBase.blockID||blockID==Block.dispenser.blockID||blockID==Block.dropper.blockID)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
@@ -560,7 +584,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(blockID== Block.redstoneRepeaterActive.blockID||blockID==Block.redstoneRepeaterIdle.blockID||blockID== Block.tripWireSource.blockID||blockID== Block.doorIron.blockID||blockID==Block.doorWood.blockID)
|
else if(Block.blocksList[blockID] instanceof BlockRedstoneRepeater ||Block.blocksList[blockID] instanceof BlockDoor ||blockID== Block.tripWireSource.blockID||Block.blocksList[blockID] instanceof BlockComparator)
|
||||||
{
|
{
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
@@ -715,10 +739,10 @@ public class SchematicLoader
|
|||||||
zCooe=z-35;
|
zCooe=z-35;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = y * loader.width * loader.length + z * loader.width + x;
|
int index = y * width * length + z * width + x;
|
||||||
|
|
||||||
int blockToReplace=loader.blocks[index];
|
int blockToReplace=loader.blocks[index];
|
||||||
int blockMetaData=loader.data[index];
|
int blockMetaData=loader.blockData[index];
|
||||||
NBTTagList tileEntity = loader.tileentities;
|
NBTTagList tileEntity = loader.tileentities;
|
||||||
HashMap tileEntityMap= new HashMap();
|
HashMap tileEntityMap= new HashMap();
|
||||||
int size = tileEntity.tagCount();
|
int size = tileEntity.tagCount();
|
||||||
@@ -732,23 +756,12 @@ public class SchematicLoader
|
|||||||
{
|
{
|
||||||
this.exitLinks.add(new Point3D(i+xCooe, j+yCooe, k+zCooe));
|
this.exitLinks.add(new Point3D(i+xCooe, j+yCooe, k+zCooe));
|
||||||
}
|
}
|
||||||
if(blockToReplace==-124)
|
|
||||||
{
|
|
||||||
blockToReplace=Block.tripWire.blockID;
|
|
||||||
}
|
|
||||||
if(blockToReplace==-125)
|
|
||||||
{
|
|
||||||
blockToReplace=Block.tripWireSource.blockID;
|
|
||||||
}
|
|
||||||
if(blockToReplace<0&&blockToReplace!=-39)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
if(blockToReplace<0)
|
|
||||||
{
|
|
||||||
blockToReplace=mod_pocketDim.blockDimWallID;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(Block.blocksList[blockToReplace]==null&&blockToReplace!=0||blockToReplace>158)
|
||||||
|
{
|
||||||
|
blockToReplace=mod_pocketDim.blockDimWall.blockID;
|
||||||
|
}
|
||||||
|
|
||||||
if(blockToReplace>0)
|
if(blockToReplace>0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -951,6 +964,10 @@ public class SchematicLoader
|
|||||||
|
|
||||||
public void setBlockDirectly(World world, int x, int y, int z,int id, int metadata)
|
public void setBlockDirectly(World world, int x, int y, int z,int id, int metadata)
|
||||||
{
|
{
|
||||||
|
if(Block.blocksList[id]==null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
Chunk chunk;
|
Chunk chunk;
|
||||||
this.cX=x >>4;
|
this.cX=x >>4;
|
||||||
this.cZ=z >>4;
|
this.cZ=z >>4;
|
||||||
@@ -965,7 +982,8 @@ public class SchematicLoader
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
chunk=world.getChunkFromChunkCoords(cX, cZ);
|
chunk=world.getChunkFromChunkCoords(cX, cZ);
|
||||||
if (chunk.getBlockStorageArray()[cY] == null) {
|
if (chunk.getBlockStorageArray()[cY] == null)
|
||||||
|
{
|
||||||
chunk.getBlockStorageArray()[cY] = new ExtendedBlockStorage(cY << 4, !world.provider.hasNoSky);
|
chunk.getBlockStorageArray()[cY] = new ExtendedBlockStorage(cY << 4, !world.provider.hasNoSky);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ public class CommandStartDungeonCreation extends CommandBase
|
|||||||
|
|
||||||
dimHelper.instance.teleportToPocket(player.worldObj, link, player);
|
dimHelper.instance.teleportToPocket(player.worldObj, link, player);
|
||||||
|
|
||||||
|
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("DimID = "+ link.destDimID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ public class mod_pocketDim
|
|||||||
this.complexHalls.add(new DungeonGenerator(weight,path,open));
|
this.complexHalls.add(new DungeonGenerator(weight,path,open));
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(name[0].equals("pistonTrap"))
|
else if(name[0].equals("trap"))
|
||||||
{
|
{
|
||||||
this.pistonTraps.add(new DungeonGenerator(weight,path,open));
|
this.pistonTraps.add(new DungeonGenerator(weight,path,open));
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
|
|
||||||
DimensionManager.registerProviderType(this.providerID, pocketProvider.class, false);
|
DimensionManager.registerProviderType(this.providerID, pocketProvider.class, false);
|
||||||
DimensionManager.registerProviderType(this.limboProviderID, LimboProvider.class, false);
|
DimensionManager.registerProviderType(this.limboProviderID, LimboProvider.class, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -612,7 +612,7 @@ public class mod_pocketDim
|
|||||||
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
|
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
|
||||||
this.blocksImmuneToRift.add(Block.bedrock.blockID);
|
this.blocksImmuneToRift.add(Block.bedrock.blockID);
|
||||||
|
|
||||||
|
/**
|
||||||
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/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/doorTotemRuins.schematic", true));
|
||||||
@@ -690,7 +690,7 @@ public class mod_pocketDim
|
|||||||
this.registeredDungeons.addAll(this.hubs);
|
this.registeredDungeons.addAll(this.hubs);
|
||||||
|
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -708,6 +708,8 @@ public class mod_pocketDim
|
|||||||
this.metadataFlipList.add(Block.doorWood.blockID);
|
this.metadataFlipList.add(Block.doorWood.blockID);
|
||||||
this.metadataFlipList.add(Block.pistonBase.blockID);
|
this.metadataFlipList.add(Block.pistonBase.blockID);
|
||||||
this.metadataFlipList.add(Block.pistonStickyBase.blockID);
|
this.metadataFlipList.add(Block.pistonStickyBase.blockID);
|
||||||
|
this.metadataFlipList.add(Block.redstoneComparatorActive);
|
||||||
|
this.metadataFlipList.add(Block.redstoneComparatorIdle);
|
||||||
|
|
||||||
this.metadataFlipList.add(Block.stairsNetherBrick.blockID);
|
this.metadataFlipList.add(Block.stairsNetherBrick.blockID);
|
||||||
this.metadataFlipList.add(Block.stairsCobblestone.blockID);
|
this.metadataFlipList.add(Block.stairsCobblestone.blockID);
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ public class pocketGenerator extends ChunkProviderGenerate implements IChunkProv
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Chunk loadChunk(int var1, int var2) {
|
public Chunk loadChunk(int var1, int var2)
|
||||||
|
{
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return super.loadChunk(var1, var2);
|
return super.loadChunk(var1, var2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,13 +98,13 @@ public class pocketProvider extends WorldProvider
|
|||||||
{
|
{
|
||||||
int respawnDim;
|
int respawnDim;
|
||||||
|
|
||||||
// if(mod_pocketDim.isLimboActive)
|
if(mod_pocketDim.isLimboActive)
|
||||||
{
|
{
|
||||||
respawnDim= mod_pocketDim.limboDimID;
|
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)
|
if(dimHelper.getWorld(respawnDim)==null)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ To name it, use the following format-
|
|||||||
|
|
||||||
<dungeonType>_<yourDungeonName>_<isOpen>_<spawnWeight>.schematic
|
<dungeonType>_<yourDungeonName>_<isOpen>_<spawnWeight>.schematic
|
||||||
|
|
||||||
The dungeon types are <20>hub<75>, <20>simpleHall<6C>, <20>complexHall<6C>, <20>pistonTrap<EFBFBD>, <20>maze<7A>, <20>exit<69>, and <20>deadEnd<6E>.
|
The dungeon types are <20>hub<75>, <20>simpleHall<6C>, <20>complexHall<6C>, <20>trap', <20>maze<7A>, <20>exit<69>, and <20>deadEnd<6E>.
|
||||||
|
|
||||||
isOpen determines if the dungeon is an open-air style pocket, or a closed in/walled it pocket that will spawn Monoliths.
|
isOpen determines if the dungeon is an open-air style pocket, or a closed in/walled it pocket that will spawn Monoliths.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user