Overhauled configuration properties
Moved all configuration variables from mod_pocketDim to DDProperties (formerly DimDoorsConfig). Changed property names to be clearer in config file, modified some comments, and generally cleaned up the config file. Fixed some missing properties and variables that were reading from the wrong properties. Modified the order in which mod_pocketDim instantiated some of its static fields so that they would load after properties are read. Almost all classes load after properties are read. Fixed indentation across various files and replaced references to properties in mod_pocketDim with references to DDProperties.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -11,17 +12,19 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
|||||||
import cpw.mods.fml.common.ITickHandler;
|
import cpw.mods.fml.common.ITickHandler;
|
||||||
import cpw.mods.fml.common.TickType;
|
import cpw.mods.fml.common.TickType;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
|
||||||
public class CommonTickHandler implements ITickHandler
|
public class CommonTickHandler implements ITickHandler
|
||||||
{
|
{
|
||||||
Random rand= new Random();
|
private Random rand = new Random();
|
||||||
public int tickCount=0;
|
public int tickCount=0;
|
||||||
public int tickCount2=0;
|
public int tickCount2=0;
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
public CommonTickHandler()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||||
@@ -82,14 +85,14 @@ public class CommonTickHandler implements ITickHandler
|
|||||||
|
|
||||||
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
||||||
|
|
||||||
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))//makes sure the rift doesnt replace a door or something
|
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))//makes sure the rift doesn't replace a door or something
|
||||||
{
|
{
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)
|
if(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, properties.RiftBlockID);
|
||||||
TileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;
|
TileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,7 +114,7 @@ public class CommonTickHandler implements ITickHandler
|
|||||||
if(tickCount2>10&&dimHelper.blocksToDecay!=null)
|
if(tickCount2>10&&dimHelper.blocksToDecay!=null)
|
||||||
{
|
{
|
||||||
tickCount2=0;
|
tickCount2=0;
|
||||||
if(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(mod_pocketDim.limboDimID)!=null)
|
if(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(properties.LimboDimensionID)!=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -120,10 +123,10 @@ public class CommonTickHandler implements ITickHandler
|
|||||||
int index = rand.nextInt(dimHelper.blocksToDecay.size());
|
int index = rand.nextInt(dimHelper.blocksToDecay.size());
|
||||||
Point3D point = (Point3D) dimHelper.blocksToDecay.get(index);
|
Point3D point = (Point3D) dimHelper.blocksToDecay.get(index);
|
||||||
|
|
||||||
int blockID = dimHelper.getWorld(mod_pocketDim.limboDimID).getBlockId(point.getX(), point.getY(), point.getZ());
|
int blockID = dimHelper.getWorld(properties.LimboDimensionID).getBlockId(point.getX(), point.getY(), point.getZ());
|
||||||
int idToSet=Block.stone.blockID;
|
int idToSet=Block.stone.blockID;
|
||||||
|
|
||||||
if(blockID==0||blockID==mod_pocketDim.blockLimboID)
|
if(blockID==0||blockID==properties.LimboBlockID)
|
||||||
{
|
{
|
||||||
dimHelper.blocksToDecay.remove(index);
|
dimHelper.blocksToDecay.remove(index);
|
||||||
}
|
}
|
||||||
@@ -146,10 +149,10 @@ public class CommonTickHandler implements ITickHandler
|
|||||||
idToSet=Block.cobblestone.blockID;
|
idToSet=Block.cobblestone.blockID;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(mod_pocketDim.limboDimID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
|
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(properties.LimboDimensionID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
|
||||||
{
|
{
|
||||||
idToSet=mod_pocketDim.blockLimboID;
|
idToSet=properties.LimboBlockID;
|
||||||
dimHelper.getWorld(mod_pocketDim.limboDimID).scheduleBlockUpdate(point.getX(), point.getY(), point.getZ(),10, idToSet);
|
dimHelper.getWorld(properties.LimboDimensionID).scheduleBlockUpdate(point.getX(), point.getY(), point.getZ(),10, idToSet);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(blockID==Block.gravel.blockID)
|
else if(blockID==Block.gravel.blockID)
|
||||||
@@ -162,7 +165,7 @@ public class CommonTickHandler implements ITickHandler
|
|||||||
if(idToSet!=-1)
|
if(idToSet!=-1)
|
||||||
{
|
{
|
||||||
|
|
||||||
dimHelper.getWorld(mod_pocketDim.limboDimID).setBlock(point.getX(), point.getY(), point.getZ(), idToSet);
|
dimHelper.getWorld(properties.LimboDimensionID).setBlock(point.getX(), point.getY(), point.getZ(), idToSet);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,15 +16,19 @@ import cpw.mods.fml.common.network.Player;
|
|||||||
public class ConnectionHandler implements IConnectionHandler
|
public class ConnectionHandler implements IConnectionHandler
|
||||||
{
|
{
|
||||||
private static boolean connected = false;
|
private static boolean connected = false;
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
//sends a packet to clients containing all the information about the dims and links. Lots of packets, actually.
|
//sends a packet to clients containing all the information about the dims and links. Lots of packets, actually.
|
||||||
@Override
|
@Override
|
||||||
public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager)
|
public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager)
|
||||||
{
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
Collection set = new ArrayList();
|
Collection set = new ArrayList();
|
||||||
set.addAll(dimHelper.dimList.keySet());
|
set.addAll(dimHelper.dimList.keySet());
|
||||||
PacketHandler.onClientJoinPacket(manager, dimHelper.dimList);
|
PacketHandler.onClientJoinPacket(manager, dimHelper.dimList);
|
||||||
PacketHandler.onDimCreatedPacket(new DimData(mod_pocketDim.limboDimID, false, 0, 0, 0, 0, 0));
|
PacketHandler.onDimCreatedPacket(new DimData(properties.LimboDimensionID, false, 0, 0, 0, 0, 0));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package StevenDimDoors.mod_pocketDim;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import net.minecraftforge.common.Configuration;
|
import net.minecraftforge.common.Configuration;
|
||||||
import net.minecraftforge.common.Property;
|
|
||||||
|
|
||||||
public class DDProperties
|
public class DDProperties
|
||||||
{
|
{
|
||||||
@@ -11,214 +10,195 @@ public class DDProperties
|
|||||||
* Block IDs
|
* Block IDs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static Property UnstableDoorID;
|
public final int UnstableDoorID;
|
||||||
public static Property DimensionalDoorID;
|
public final int DimensionalDoorID;
|
||||||
public static Property WarpDoorID;
|
public final int WarpDoorID;
|
||||||
public static Property TransTrapdoorID;
|
public final int TransTrapdoorID;
|
||||||
public static Property TransientDoorID;
|
public final int TransientDoorID;
|
||||||
|
public final int FabricBlockID;
|
||||||
public static Property FabricBlockID;
|
public final int RiftBlockID;
|
||||||
public static Property RiftBlockID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WorldGenBlockIDs
|
* World Generation Block IDs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static Property LimboBlockID;
|
public final int LimboBlockID;
|
||||||
public static Property PermaFabricBlockID;
|
public final int PermaFabricBlockID;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item IDs
|
* Item IDs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static Property RiftBladeItemID;
|
public final int RiftBladeItemID;
|
||||||
public static Property RiftSignatureItemID;
|
public final int RiftSignatureItemID;
|
||||||
public static Property RiftRemoverItemID;
|
public final int RiftRemoverItemID;
|
||||||
public static Property StableFabricItemID;
|
public final int StableFabricItemID;
|
||||||
public static Property StabilizedRiftSignatureItemID;
|
public final int StabilizedRiftSignatureItemID;
|
||||||
|
public final int DimensionalDoorItemID;
|
||||||
public static Property DimensionalDoorItemID;
|
public final int UnstableDoorItemID;
|
||||||
public static Property UnstableDoorItemID;
|
public final int WarpDoorItemID;
|
||||||
public static Property WarpDoorItemID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other IDs
|
* Other IDs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static Property LimboBiomeID;
|
public final int LimboBiomeID;
|
||||||
public static Property PocketBiomeID;
|
public final int PocketBiomeID;
|
||||||
public static Property LimboDimensionID;
|
public final int LimboDimensionID;
|
||||||
public static Property limboProviderID;
|
public final int LimboProviderID;
|
||||||
public static Property PocketProviderID;
|
public final int PocketProviderID;
|
||||||
public static Property DoorRenderEntityID;
|
public final int DoorRenderEntityID;
|
||||||
public static Property MonolithEntityID;
|
public final int MonolithEntityID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crafting Flags
|
* Crafting Flags
|
||||||
*/
|
*/
|
||||||
public static Property CraftingDimensionaDoorAllowed;
|
|
||||||
public static Property CraftingWarpDoorAllowed;
|
public final boolean CraftingDimensionaDoorAllowed;
|
||||||
public static Property CraftingRiftSignatureAllowed;
|
public final boolean CraftingWarpDoorAllowed;
|
||||||
public static Property CraftingRiftRemoverAllowed;
|
public final boolean CraftingRiftSignatureAllowed;
|
||||||
public static Property CraftingUnstableDoorAllowed;
|
public final boolean CraftingRiftRemoverAllowed;
|
||||||
public static Property CraftingRiftBladeAllowed;
|
public final boolean CraftingUnstableDoorAllowed;
|
||||||
public static Property CraftingTransTrapdoorAllowed;
|
public final boolean CraftingRiftBladeAllowed;
|
||||||
public static Property CraftingStabilizedRiftSignatureAllowed;
|
public final boolean CraftingTransTrapdoorAllowed;
|
||||||
|
public final boolean CraftingStabilizedRiftSignatureAllowed;
|
||||||
|
public final boolean CraftingStableFabricAllowed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other Flags
|
* Other Flags
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static Property WorldRiftGenerationEnabled;
|
public final boolean WorldRiftGenerationEnabled;
|
||||||
public static Property RiftSpreadEnabled;
|
public final boolean RiftSpreadEnabled;
|
||||||
public static Property RiftGriefingEnabled;
|
public final boolean RiftGriefingEnabled;
|
||||||
public static Property RiftsSpawnEndermenEnabled;
|
public final boolean RiftsSpawnEndermenEnabled;
|
||||||
public static Property LimboEnabled;
|
public final boolean LimboEnabled;
|
||||||
public static Property LimboRespawningEnabled;
|
public final boolean HardcoreLimboEnabled;
|
||||||
public static Property LimboReturnsInventoryEnabled;
|
public final boolean LimboReturnsInventoryEnabled;
|
||||||
public static Property DoorRenderingEnabled;
|
public final boolean DoorRenderingEnabled;
|
||||||
public static Property TNFREAKINGT_Enabled;
|
public final boolean TNFREAKINGT_Enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other
|
* Other
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static Property NonTntWeight;
|
public final int NonTntWeight;
|
||||||
public static Property RiftSpreadModifier;
|
public final int RiftSpreadModifier;
|
||||||
public static Property LimboReturnRange;
|
public final int LimboReturnRange;
|
||||||
|
public final String CustomSchematicDirectory;
|
||||||
|
|
||||||
public static void loadConfig(File configFile)
|
//Singleton instance
|
||||||
|
private static DDProperties instance = null;
|
||||||
|
//Path for custom dungeons within configuration directory
|
||||||
|
private final String CUSTOM_SCHEMATIC_SUBDIRECTORY = "/DimDoors_Custom_schematics";
|
||||||
|
//Names of categories
|
||||||
|
private final String CATEGORY_CRAFTING = "crafting";
|
||||||
|
private final String CATEGORY_ENTITY = "entity";
|
||||||
|
private final String CATEGORY_DIMENSION = "dimension";
|
||||||
|
private final String CATEGORY_PROVIDER = "provider";
|
||||||
|
private final String CATEGORY_BIOME = "biome";
|
||||||
|
|
||||||
|
private DDProperties(File configFile)
|
||||||
{
|
{
|
||||||
Configuration config = new Configuration(configFile);
|
//Load the configuration. This must be done in the constructor, even though I'd rather have a separate
|
||||||
|
//function, because "blank final" variables must be initialized within the constructor.
|
||||||
|
|
||||||
|
CustomSchematicDirectory = configFile.getParent() + CUSTOM_SCHEMATIC_SUBDIRECTORY;
|
||||||
|
Configuration config = new Configuration(configFile);
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
CraftingDimensionaDoorAllowed = config.get("Crafting control", "bCraftDimDoor", true);
|
CraftingDimensionaDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Dimesional Door", true).getBoolean(true);
|
||||||
CraftingWarpDoorAllowed = config.get("Crafting control", "bCraftExitDoor", true);
|
CraftingWarpDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Warp Door", true).getBoolean(true);
|
||||||
CraftingUnstableDoorAllowed = config.get("Crafting control", "bCraftChaosDoor", true);
|
CraftingUnstableDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crating Unstable Door", true).getBoolean(true);
|
||||||
CraftingTransTrapdoorAllowed = config.get("Crafting control", "bCraftDimHatch", true);
|
CraftingTransTrapdoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Transdimensional Trapdoor", true).getBoolean(true);
|
||||||
CraftingRiftSignatureAllowed = config.get("Crafting control", "bCraftRiftSig", true);
|
CraftingRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Signature", true).getBoolean(true);
|
||||||
CraftingRiftRemoverAllowed = config.get("Crafting control", "bCraftRiftRemover", true);
|
CraftingRiftRemoverAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Remover", true).getBoolean(true);
|
||||||
CraftingStabilizedRiftSignatureAllowed = config.get("Crafting control", "bCraftStabilizedRiftSig", true);
|
CraftingStabilizedRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stabilized Rift Signature", true).getBoolean(true);
|
||||||
CraftingRiftBladeAllowed = config.get("Crafting control", "bCraftRiftBlade", true);
|
CraftingRiftBladeAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Blade", true).getBoolean(true);
|
||||||
|
CraftingStableFabricAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stable Fabric", true).getBoolean(true);
|
||||||
|
|
||||||
LimboRespawningEnabled = config.get(Configuration.CATEGORY_GENERAL, "bHardcoreLimbo", false);
|
RiftGriefingEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Griefing", true,
|
||||||
LimboRespawningEnabled.comment = "True causes the player to respawn in limbo if they die in limbo";
|
"Sets whether rifts destroy blocks around them or not").getBoolean(true);
|
||||||
|
RiftSpreadEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Spread", true,
|
||||||
|
"Sets whether rifts create more rifts when they are near other rifts").getBoolean(true);
|
||||||
|
RiftsSpawnEndermenEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Endermen Spawning from Rifts", true,
|
||||||
|
"Sets whether groups of connected rifts will spawn Endermen").getBoolean(true);
|
||||||
|
|
||||||
TNFREAKINGT_Enabled = config.get("Configuration.CATEGORY_GENERAL", "EXPLOSIONS!!???!!!?!?!!", false);
|
LimboEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Limbo", true,
|
||||||
|
"Sets whether the Limbo dimension is activated").getBoolean(true);
|
||||||
|
LimboReturnsInventoryEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Limbo Returns Inventory", true,
|
||||||
|
"Sets whether players keep their inventories upon dying and respawning in Limbo").getBoolean(true);
|
||||||
|
HardcoreLimboEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Hardcore Limbo", false,
|
||||||
|
"Sets whether players that die in Limbo will respawn there").getBoolean(false);
|
||||||
|
LimboReturnRange = config.get(Configuration.CATEGORY_GENERAL, "Limbo Return Range", 500,
|
||||||
|
"Sets the farthest distance that Limbo can send you upon returning to the Overworld").getInt();
|
||||||
|
DoorRenderingEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Door Rendering", true).getBoolean(true);
|
||||||
|
|
||||||
RiftGriefingEnabled = config.get(Configuration.CATEGORY_GENERAL, "bRiftGreif", true);
|
TNFREAKINGT_Enabled = config.get(Configuration.CATEGORY_GENERAL, "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
|
||||||
RiftGriefingEnabled.comment = "toggles whether rifts eat blocks around them or not";
|
NonTntWeight = config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25,
|
||||||
|
"Weighs the chance that a block will not be TNT. Must be greater than or equal to 0. " +
|
||||||
|
"EXPLOSIONS must be set to true for this to have any effect.").getInt();
|
||||||
|
|
||||||
DoorRenderingEnabled = config.get(Configuration.CATEGORY_GENERAL, "bEnableDoorRender", true);
|
DoorRenderEntityID=config.get(CATEGORY_ENTITY, "Door Render Entity ID", 89).getInt();
|
||||||
|
MonolithEntityID = config.get(CATEGORY_ENTITY, "Monolith Entity ID", 125).getInt();
|
||||||
|
|
||||||
LimboReturnsInventoryEnabled = config.get(Configuration.CATEGORY_GENERAL, "bLimboReturnInventory", true);
|
DimensionalDoorID = config.getBlock("Dimensional Door Block ID", 1970).getInt();
|
||||||
LimboReturnsInventoryEnabled.comment="Toggles whether or not your inventory is returned upon dying and respawning in limbo";
|
TransTrapdoorID = config.getBlock("Transdimensional Trapdoor Block ID", 1971).getInt();
|
||||||
|
FabricBlockID =config.getBlock("Fabric Of Reality Block ID", 1973).getInt();
|
||||||
|
WarpDoorID = config.getBlock("Warp Door Block ID", 1975).getInt();
|
||||||
|
RiftBlockID = config.getBlock("Rift Block ID", 1977).getInt();
|
||||||
|
UnstableDoorID = config.getBlock("Unstable Door Block ID", 1978).getInt();
|
||||||
|
TransientDoorID = config.getBlock("Transient Door Block ID", 1979).getInt();
|
||||||
|
|
||||||
NonTntWeight=config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25);
|
WarpDoorItemID = config.getItem("Warp Door Item ID", 5670).getInt();
|
||||||
NonTntWeight.comment="Chance that a block will not be TNT. must be greater than or equal to 0. Explosions!?!?? must be set to true, and you figure out what it does. ";
|
RiftRemoverItemID = config.getItem("Rift Remover Item ID", 5671).getInt();
|
||||||
|
StableFabricItemID = config.getItem("Stable Fabric Item ID", 5672).getInt();
|
||||||
|
UnstableDoorItemID = config.getItem("Unstable Door Item ID", 5673).getInt();
|
||||||
|
DimensionalDoorItemID = config.getItem("Dimensional Door Item ID", 5674).getInt();
|
||||||
|
RiftSignatureItemID = config.getItem("Rift Signature Item ID", 5675).getInt();
|
||||||
|
RiftBladeItemID = config.getItem("Rift Blade Item ID", 5676).getInt();
|
||||||
|
StabilizedRiftSignatureItemID = config.getItem("Stabilized Rift Signature Item ID", 5677).getInt();
|
||||||
|
|
||||||
MonolithEntityID=config.get(Configuration.CATEGORY_GENERAL, "monolithID", 125);
|
LimboBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256", "Limbo Block ID", 217,
|
||||||
|
"Blocks used for the terrain in Limbo").getInt();
|
||||||
|
PermaFabricBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256",
|
||||||
|
"Perma Fabric Block ID", 220, "Blocks used for enclosing pocket dimensions").getInt();
|
||||||
|
|
||||||
DimensionalDoorID = config.getBlock("DimensionalDoorID", 1970);
|
LimboDimensionID = config.get(CATEGORY_DIMENSION, "Limbo Dimension ID", -23).getInt();
|
||||||
WarpDoorID = config.getBlock("WarpDoorID", 1975);
|
PocketProviderID = config.get(CATEGORY_PROVIDER, "Pocket Provider ID", 24).getInt();
|
||||||
UnstableDoorID = config.getBlock("UnstableDoorID", 1978);
|
LimboProviderID = config.get(CATEGORY_PROVIDER, "Limbo Provider ID", 13).getInt();
|
||||||
TransTrapdoorID = config.getBlock("TransdimensionalTrapdoorID", 1971);
|
|
||||||
TransientDoorID = config.getBlock("TransientDoorID", 1979);
|
|
||||||
FabricBlockID =config.getBlock("FabricOfRealityBlockID", 1973);
|
|
||||||
RiftBlockID = config.getBlock("RiftBlockID", 1977);
|
|
||||||
|
|
||||||
StabilizedRiftSignatureItemID=config.getItem("Stabilized Rift Signature", 5677);
|
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
|
||||||
RiftBladeItemID=config.getItem("Rift Blade", 5676);
|
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true);
|
||||||
UnstableDoorItemID=config.getItem("Chaos Door", 5673);
|
|
||||||
RiftRemoverItemID=config.getItem("Rift Remover", 5671);
|
|
||||||
StableFabricItemID=config.getItem("Stable Fabric", 5672);
|
|
||||||
WarpDoorItemID=config.getItem("Warp Door Item", 5673);
|
|
||||||
DimensionalDoorItemID=config.getItem("Dimensional Door Item", 5674);
|
|
||||||
RiftSignatureItemID=config.getItem("Rift Signature Item", 5675);
|
|
||||||
|
|
||||||
LimboEnabled=config.get(Configuration.CATEGORY_GENERAL, "bLimboActive", true);
|
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. " +
|
||||||
|
"A value greater than 5 is not recommended as the growth is exponential.").getInt();
|
||||||
|
|
||||||
LimboBlockID=config.get("Worldgen Block IDs - must be less than 256", "blockLimbo", 217);
|
|
||||||
PermaFabricBlockID=config.get("Worldgen Block IDs - must be less than 256", "blockFabricPerm", 220);
|
|
||||||
|
|
||||||
|
|
||||||
LimboDimensionID=config.get(Configuration.CATEGORY_GENERAL, "limboDimID", -23);
|
|
||||||
DoorRenderEntityID=config.get(Configuration.CATEGORY_GENERAL, "doorRenderID", 89);
|
|
||||||
|
|
||||||
LimboReturnRange=config.get(Configuration.CATEGORY_GENERAL, "limboReturnRange", 500);
|
|
||||||
LimboReturnRange.comment = "The farthest possible distance that limbo can send you upon return to the overworld.";
|
|
||||||
|
|
||||||
PocketProviderID=config.get(Configuration.CATEGORY_GENERAL, "pocketProviderID", 24);
|
|
||||||
|
|
||||||
limboProviderID=config.get(Configuration.CATEGORY_GENERAL, "limboProvider ID", 13);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "bWorldGenRifts", true);
|
|
||||||
WorldRiftGenerationEnabled.comment = "Toggles the natrual generation of dungeon rifts in other dimensions";
|
|
||||||
|
|
||||||
LimboEnabled = config.get(Configuration.CATEGORY_GENERAL, "bLimboActive", true);
|
|
||||||
LimboEnabled.comment="Toggles if dying in a pocket dim respawns the player in limbo";
|
|
||||||
|
|
||||||
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. ";
|
|
||||||
|
|
||||||
LimboBiomeID=config.get(Configuration.CATEGORY_GENERAL, "limboBiomeID", 251);
|
|
||||||
PocketBiomeID=config.get(Configuration.CATEGORY_GENERAL, "pocketBiomeID", 250);
|
|
||||||
|
|
||||||
|
LimboBiomeID = config.get(CATEGORY_BIOME, "Limbo Biome ID", 251).getInt();
|
||||||
|
PocketBiomeID = config.get(CATEGORY_BIOME, "Pocket Biome ID", 250).getInt();
|
||||||
|
|
||||||
config.save();
|
config.save();
|
||||||
|
|
||||||
mod_pocketDim.blockDimWallID=FabricBlockID.getInt();
|
|
||||||
mod_pocketDim.blockDimWallPermID=PermaFabricBlockID.getInt();
|
|
||||||
mod_pocketDim.blockLimboID=LimboBlockID.getInt();
|
|
||||||
mod_pocketDim.blockRiftID=LimboBlockID.getInt();
|
|
||||||
mod_pocketDim.dimDoorID=DimensionalDoorID.getInt();
|
|
||||||
mod_pocketDim.chaosDoorID=UnstableDoorID.getInt();
|
|
||||||
mod_pocketDim.transientDoorID=TransientDoorID.getInt();
|
|
||||||
mod_pocketDim.dimHatchID=TransTrapdoorID.getInt();
|
|
||||||
mod_pocketDim.ExitDoorID=WarpDoorID.getInt();
|
|
||||||
mod_pocketDim.blockRiftID=RiftBlockID.getInt();
|
|
||||||
mod_pocketDim.DoorRenderID=DoorRenderEntityID.getInt();
|
|
||||||
mod_pocketDim.hardcoreLimbo=LimboRespawningEnabled.getBoolean(false);
|
|
||||||
mod_pocketDim.enableDimTrapDoor=CraftingTransTrapdoorAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableDoorOpenGL=DoorRenderingEnabled.getBoolean(true);
|
|
||||||
mod_pocketDim.enableIronDimDoor=CraftingDimensionaDoorAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableRiftBlade=CraftingRiftBladeAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableRiftRemover=CraftingRiftBladeAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableRiftSignature=CraftingRiftSignatureAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableUnstableDoor=CraftingUnstableDoorAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableWoodenDimDoor=CraftingWarpDoorAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.enableStabilizedRiftSignature=CraftingStabilizedRiftSignatureAllowed.getBoolean(true);
|
|
||||||
mod_pocketDim.itemChaosDoorID=UnstableDoorItemID.getInt();
|
|
||||||
mod_pocketDim.itemDimDoorID=DimensionalDoorItemID.getInt();
|
|
||||||
mod_pocketDim.itemExitDoorID=WarpDoorItemID.getInt();
|
|
||||||
mod_pocketDim.itemLinkSignatureID=RiftSignatureItemID.getInt();
|
|
||||||
mod_pocketDim.itemRiftBladeID=RiftBladeItemID.getInt();
|
|
||||||
mod_pocketDim.itemRiftRemoverID=RiftRemoverItemID.getInt();
|
|
||||||
mod_pocketDim.itemStabilizedLinkSignatureID=StabilizedRiftSignatureItemID.getInt();
|
|
||||||
mod_pocketDim.itemStableFabricID=StableFabricItemID.getInt();
|
|
||||||
mod_pocketDim.obeliskID=MonolithEntityID.getInt();
|
|
||||||
mod_pocketDim.limboBiomeID=LimboBiomeID.getInt();
|
|
||||||
mod_pocketDim.pocketBiomeID=PocketBiomeID.getInt();
|
|
||||||
mod_pocketDim.providerID=PocketProviderID.getInt();
|
|
||||||
mod_pocketDim.limboProviderID=limboProviderID.getInt();
|
|
||||||
mod_pocketDim.limboExitRange=LimboReturnRange.getInt();
|
|
||||||
mod_pocketDim.TNFREAKINGT=TNFREAKINGT_Enabled.getBoolean(false);
|
|
||||||
mod_pocketDim.riftsInWorldGen=WorldRiftGenerationEnabled.getBoolean(true);
|
|
||||||
mod_pocketDim.riftSpreadFactor=RiftSpreadModifier.getInt();
|
|
||||||
mod_pocketDim.returnInventory=LimboReturnsInventoryEnabled.getBoolean(true);
|
|
||||||
mod_pocketDim.HOW_MUCH_TNT=NonTntWeight.getInt() + 1; //workaround so the generator code doesn't have to be changed
|
|
||||||
mod_pocketDim.limboDimID = LimboDimensionID.getInt();
|
|
||||||
mod_pocketDim.isLimboActive= LimboEnabled.getBoolean(true);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DDProperties create(File configFile)
|
||||||
|
{
|
||||||
|
if (instance == null)
|
||||||
|
instance = new DDProperties(configFile);
|
||||||
|
else
|
||||||
|
throw new IllegalStateException("Cannot create DDProperties twice");
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DDProperties instance()
|
||||||
|
{
|
||||||
|
if (instance == null)
|
||||||
|
{
|
||||||
|
//This is to prevent some frustrating bugs that could arise when classes
|
||||||
|
//are loaded in the wrong order. Trust me, I had to squash a few...
|
||||||
|
throw new IllegalStateException("Instance of DDProperties requested before properties have been loaded");
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,8 @@ public class DimData implements Serializable
|
|||||||
|
|
||||||
static final long serialVersionUID = 454342L;
|
static final long serialVersionUID = 454342L;
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public DimData(int dimID, boolean isPocket, int depth, LinkData exitLinkData)
|
public DimData(int dimID, boolean isPocket, int depth, LinkData exitLinkData)
|
||||||
{
|
{
|
||||||
this.dimID=dimID;
|
this.dimID=dimID;
|
||||||
@@ -41,16 +43,13 @@ public class DimData implements Serializable
|
|||||||
|
|
||||||
this.exitDimLink= exitLinkData;
|
this.exitDimLink= exitLinkData;
|
||||||
|
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public DimData(int dimID, boolean isPocket, int depth, int exitLinkDimID, int exitX, int exitY, int exitZ)
|
public DimData(int dimID, boolean isPocket, int depth, int exitLinkDimID, int exitX, int exitY, int exitZ)
|
||||||
{
|
{
|
||||||
this.dimID=dimID;
|
this(dimID, isPocket, depth, new LinkData(exitLinkDimID, exitX, exitY, exitZ));
|
||||||
this.depth=depth;
|
|
||||||
this.isPocket=isPocket;
|
|
||||||
|
|
||||||
this.exitDimLink= new LinkData(exitLinkDimID, exitX, exitY, exitZ);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LinkData findNearestRift(World world, int range, int x, int y, int z)
|
public LinkData findNearestRift(World world, int range, int x, int y, int z)
|
||||||
@@ -67,7 +66,7 @@ public class DimData implements Serializable
|
|||||||
{
|
{
|
||||||
while (k<range)
|
while (k<range)
|
||||||
{
|
{
|
||||||
if(world.getBlockId(x+i, y+j, z+k)==mod_pocketDim.blockRiftID&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
|
if(world.getBlockId(x+i, y+j, z+k)==properties.RiftBlockID&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
|
||||||
{
|
{
|
||||||
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
|
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
|
||||||
{
|
{
|
||||||
@@ -106,7 +105,7 @@ public class DimData implements Serializable
|
|||||||
{
|
{
|
||||||
while (k<range)
|
while (k<range)
|
||||||
{
|
{
|
||||||
if(world.getBlockId(x+i, y+j, z+k)==mod_pocketDim.blockRiftID)
|
if(world.getBlockId(x+i, y+j, z+k)==properties.RiftBlockID)
|
||||||
{
|
{
|
||||||
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
|
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
|
||||||
{
|
{
|
||||||
@@ -187,7 +186,7 @@ public class DimData implements Serializable
|
|||||||
|
|
||||||
public boolean isLimbo()
|
public boolean isLimbo()
|
||||||
{
|
{
|
||||||
if(this.dimID==mod_pocketDim.limboDimID)
|
if(this.dimID==properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -32,9 +33,17 @@ import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
|||||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
import net.minecraftforge.event.world.WorldEvent;
|
||||||
|
|
||||||
public class EventHookContainer
|
public class EventHookContainer
|
||||||
{
|
{
|
||||||
Random rand= new Random();
|
private static Random rand = new Random();
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
public EventHookContainer()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
|
||||||
@@ -46,14 +55,8 @@ public class EventHookContainer
|
|||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/monk.ogg")));
|
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/monk.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/monk.ogg")));
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/crack.ogg")));
|
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/crack.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/crack.ogg")));
|
||||||
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/tearing.ogg")));
|
event.manager.soundPoolSounds.addSound("mods/DimDoors/sfx/tearing.ogg", (mod_pocketDim.class.getResource("/mods/DimDoors/sfx/tearing.ogg")));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ForgeSubscribe
|
@ForgeSubscribe
|
||||||
public void onWorldLoad(WorldEvent.Load event)
|
public void onWorldLoad(WorldEvent.Load event)
|
||||||
{
|
{
|
||||||
@@ -87,7 +90,7 @@ public class EventHookContainer
|
|||||||
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
||||||
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))
|
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, properties.RiftBlockID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -120,7 +123,7 @@ public class EventHookContainer
|
|||||||
public void onPlayerFall(LivingFallEvent event)
|
public void onPlayerFall(LivingFallEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
event.setCanceled(event.entity.worldObj.provider.dimensionId==mod_pocketDim.limboDimID);
|
event.setCanceled(event.entity.worldObj.provider.dimensionId==properties.LimboDimensionID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +135,7 @@ public class EventHookContainer
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
if(event.entityPlayer.worldObj.provider.dimensionId==mod_pocketDim.limboDimID&&event.action==PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK)
|
if(event.entityPlayer.worldObj.provider.dimensionId==properties.LimboDimensionID&&event.action==PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,8 @@ public class PacketHandler implements IPacketHandler
|
|||||||
public static int removeLinkPacketID = 5;
|
public static int removeLinkPacketID = 5;
|
||||||
public static int linkKeyPacketID = 7;
|
public static int linkKeyPacketID = 7;
|
||||||
public static int dimPacketID = 6;
|
public static int dimPacketID = 6;
|
||||||
|
|
||||||
|
|
||||||
public static int dimUpdatePacketID = 1;
|
public static int dimUpdatePacketID = 1;
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||||
@@ -45,7 +42,6 @@ public class PacketHandler implements IPacketHandler
|
|||||||
if (packet.channel.equals("DimDoorPackets"))
|
if (packet.channel.equals("DimDoorPackets"))
|
||||||
{
|
{
|
||||||
handleRandom(packet,player);
|
handleRandom(packet,player);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -78,7 +74,10 @@ public class PacketHandler implements IPacketHandler
|
|||||||
}
|
}
|
||||||
if(dimDataToAdd.isPocket)
|
if(dimDataToAdd.isPocket)
|
||||||
{
|
{
|
||||||
dimHelper.registerDimension(dimId, mod_pocketDim.providerID);
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
|
dimHelper.registerDimension(dimId, properties.PocketProviderID);
|
||||||
//System.out.println("regsitered dim ID" + dimId);
|
//System.out.println("regsitered dim ID" + dimId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,13 @@ import cpw.mods.fml.common.IPlayerTracker;
|
|||||||
|
|
||||||
public class PlayerRespawnTracker implements IPlayerTracker
|
public class PlayerRespawnTracker implements IPlayerTracker
|
||||||
{
|
{
|
||||||
|
public PlayerRespawnTracker()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerLogin(EntityPlayer player) {
|
public void onPlayerLogin(EntityPlayer player) {
|
||||||
@@ -35,10 +41,10 @@ public class PlayerRespawnTracker implements IPlayerTracker
|
|||||||
@Override
|
@Override
|
||||||
public void onPlayerRespawn(EntityPlayer player)
|
public void onPlayerRespawn(EntityPlayer player)
|
||||||
{
|
{
|
||||||
if(player.worldObj.provider.dimensionId==mod_pocketDim.limboDimID)
|
if(player.worldObj.provider.dimensionId==properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!player.worldObj.isRemote&&mod_pocketDim.returnInventory)
|
if(!player.worldObj.isRemote && properties.LimboReturnsInventoryEnabled)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(player.username!=null)
|
if(player.username!=null)
|
||||||
|
|||||||
@@ -23,17 +23,23 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
boolean shouldGenHere=true;
|
boolean shouldGenHere=true;
|
||||||
LinkData link;
|
LinkData link;
|
||||||
|
|
||||||
|
|
||||||
DimData dimData;
|
DimData dimData;
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
public RiftGenerator()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||||
{
|
{
|
||||||
//Long ntime = System.nanoTime();
|
//Long ntime = System.nanoTime();
|
||||||
shouldGenHere=true;
|
shouldGenHere=true;
|
||||||
|
|
||||||
if(world.provider.getDimensionName()=="PocketDim"||!mod_pocketDim.riftsInWorldGen ||world.isRemote)
|
if (world.provider.getDimensionName()=="PocketDim"|| !properties.WorldRiftGenerationEnabled || world.isRemote)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.shouldGenHere=false;
|
this.shouldGenHere=false;
|
||||||
@@ -144,13 +150,13 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(random.nextInt(250)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote&&mod_pocketDim.riftsInWorldGen)
|
if(random.nextInt(250)==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;
|
||||||
if(world.provider.dimensionId==mod_pocketDim.limboDimID)
|
if(world.provider.dimensionId==properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
blockID= mod_pocketDim.blockLimboID;
|
blockID= properties.LimboBlockID;
|
||||||
}
|
}
|
||||||
i=chunkX*16-random.nextInt(16);
|
i=chunkX*16-random.nextInt(16);
|
||||||
k=chunkZ*16-random.nextInt(16);
|
k=chunkZ*16-random.nextInt(16);
|
||||||
|
|||||||
@@ -62,18 +62,12 @@ public class SchematicLoader
|
|||||||
public int cZ;
|
public int cZ;
|
||||||
public int cY;
|
public int cY;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean didRead = false;
|
public boolean didRead = false;
|
||||||
public String schematic;
|
public String schematic;
|
||||||
|
|
||||||
public SchematicLoader()
|
private DDProperties properties = DDProperties.instance();
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public SchematicLoader() { }
|
||||||
|
|
||||||
public void init(LinkData link)
|
public void init(LinkData link)
|
||||||
{
|
{
|
||||||
@@ -944,12 +938,12 @@ public class SchematicLoader
|
|||||||
|
|
||||||
if(blockToReplace==Block.doorIron.blockID)
|
if(blockToReplace==Block.doorIron.blockID)
|
||||||
{
|
{
|
||||||
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,mod_pocketDim.dimDoorID, transMeta );
|
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,properties.DimensionalDoorID, transMeta );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(blockToReplace==Block.doorWood.blockID)
|
if(blockToReplace==Block.doorWood.blockID)
|
||||||
{
|
{
|
||||||
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,mod_pocketDim.ExitDoorID, transMeta );
|
setBlockDirectly(world,i+xCooe,j+yCooe,k+zCooe,properties.WarpDoorID, transMeta );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1029,7 +1023,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
for(Point3D point : this.sideLinks)
|
for(Point3D point : this.sideLinks)
|
||||||
{
|
{
|
||||||
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.dimDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.dimDoorID)
|
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==properties.DimensionalDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==properties.DimensionalDoorID)
|
||||||
{
|
{
|
||||||
|
|
||||||
int depth = dimHelper.instance.getDimDepth(link.locDimID);
|
int depth = dimHelper.instance.getDimDepth(link.locDimID);
|
||||||
@@ -1080,14 +1074,14 @@ public class SchematicLoader
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())==Block.sandStone.blockID)
|
if(world.getBlockId(point.getX(), point.getY(), point.getZ())==properties.WarpDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==properties.WarpDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())==Block.sandStone.blockID)
|
||||||
{
|
{
|
||||||
|
|
||||||
LinkData randomLink=dimHelper.instance.getRandomLinkData(false);
|
LinkData randomLink=dimHelper.instance.getRandomLinkData(false);
|
||||||
|
|
||||||
LinkData sideLink = new LinkData(link.destDimID,dimHelper.dimList.get(link.locDimID).exitDimLink.destDimID,point.getX(), point.getY(), point.getZ(),point.getX(), 0, point.getZ(),true,world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ()));
|
LinkData sideLink = new LinkData(link.destDimID,dimHelper.dimList.get(link.locDimID).exitDimLink.destDimID,point.getX(), point.getY(), point.getZ(),point.getX(), 0, point.getZ(),true,world.getBlockMetadata(point.getX(), point.getY()-1, point.getZ()));
|
||||||
|
|
||||||
if(sideLink.destDimID==mod_pocketDim.limboDimID)
|
if(sideLink.destDimID==properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
sideLink.destDimID=0;
|
sideLink.destDimID=0;
|
||||||
}
|
}
|
||||||
@@ -1110,7 +1104,7 @@ public class SchematicLoader
|
|||||||
dimHelper.instance.createLink(sideLink);
|
dimHelper.instance.createLink(sideLink);
|
||||||
dimHelper.instance.createLink(sideLink.destDimID , sideLink.locDimID, sideLink.destXCoord, sideLink.destYCoord, sideLink.destZCoord, sideLink.locXCoord, sideLink.locYCoord, sideLink.locZCoord, dimHelper.instance.flipDoorMetadata(sideLink.linkOrientation));
|
dimHelper.instance.createLink(sideLink.destDimID , sideLink.locDimID, sideLink.destXCoord, sideLink.destYCoord, sideLink.destZCoord, sideLink.locXCoord, sideLink.locYCoord, sideLink.locZCoord, dimHelper.instance.flipDoorMetadata(sideLink.linkOrientation));
|
||||||
|
|
||||||
if(world.getBlockId(point.getX(), point.getY()-3, point.getZ())==mod_pocketDim.blockDimWallID)
|
if(world.getBlockId(point.getX(), point.getY()-3, point.getZ()) == properties.FabricBlockID)
|
||||||
{
|
{
|
||||||
setBlockDirectly(world,point.getX(), point.getY()-2, point.getZ(),Block.stoneBrick.blockID,0);
|
setBlockDirectly(world,point.getX(), point.getY()-2, point.getZ(),Block.stoneBrick.blockID,0);
|
||||||
|
|
||||||
@@ -1121,7 +1115,7 @@ public class SchematicLoader
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((world.getBlockId(point.getX(), point.getY(), point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==mod_pocketDim.ExitDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())!=Block.sandStone.blockID))
|
else if ((world.getBlockId(point.getX(), point.getY(), point.getZ()) == properties.WarpDoorID&&world.getBlockId(point.getX(), point.getY()-1, point.getZ())==properties.WarpDoorID&&world.getBlockId(point.getX(), point.getY()-2, point.getZ())!=Block.sandStone.blockID))
|
||||||
{
|
{
|
||||||
this.incomingLink = point;
|
this.incomingLink = point;
|
||||||
}
|
}
|
||||||
@@ -1168,7 +1162,6 @@ public class SchematicLoader
|
|||||||
this.cY=y >>4;
|
this.cY=y >>4;
|
||||||
|
|
||||||
int chunkX=(x % 16)< 0 ? ((x) % 16)+16 : ((x) % 16);
|
int chunkX=(x % 16)< 0 ? ((x) % 16)+16 : ((x) % 16);
|
||||||
int chunkY=y;
|
|
||||||
int chunkZ=((z) % 16)< 0 ? ((z) % 16)+16 : ((z) % 16);
|
int chunkZ=((z) % 16)< 0 ? ((z) % 16)+16 : ((z) % 16);
|
||||||
|
|
||||||
|
|
||||||
@@ -1189,8 +1182,5 @@ public class SchematicLoader
|
|||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,9 +33,12 @@ public class TransientDoor extends ExitDoor
|
|||||||
super(par1, Material.grass);
|
super(par1, Material.grass);
|
||||||
// this.blockIndexInTexture = 18;
|
// this.blockIndexInTexture = 18;
|
||||||
|
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_top");
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2()+"_top");
|
||||||
@@ -90,7 +93,7 @@ public class TransientDoor extends ExitDoor
|
|||||||
{
|
{
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
||||||
par1World.setBlock(par2, par3-1, par4, 0);
|
par1World.setBlock(par2, par3-1, par4, 0);
|
||||||
par1World.setBlock(par2, par3, par4, mod_pocketDim.blockRiftID);
|
par1World.setBlock(par2, par3, par4, properties.RiftBlockID);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,7 +107,7 @@ public class TransientDoor extends ExitDoor
|
|||||||
{
|
{
|
||||||
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
dimHelper.instance.teleportToPocket(par1World, linkData, par5Entity);
|
||||||
par1World.setBlock(par2, par3, par4, 0);
|
par1World.setBlock(par2, par3, par4, 0);
|
||||||
par1World.setBlock(par2, par3+1, par4, mod_pocketDim.blockRiftID);
|
par1World.setBlock(par2, par3+1, par4, properties.RiftBlockID);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.blocks;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
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;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
@@ -16,30 +17,27 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
public class BlockDimWallPerm extends Block
|
public class BlockDimWallPerm extends Block
|
||||||
{
|
{
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public BlockDimWallPerm(int i, int j, Material par2Material)
|
public BlockDimWallPerm(int i, int j, Material par2Material)
|
||||||
{
|
{
|
||||||
super(i, Material.ground);
|
super(i, Material.ground);
|
||||||
setTickRandomly(true);
|
setTickRandomly(true);
|
||||||
// this.setCreativeTab(CreativeTabs.tabBlock);
|
// this.setCreativeTab(CreativeTabs.tabBlock);
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2().replace("perm", ""));
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2().replace("perm", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int quantityDropped(Random par1Random)
|
public int quantityDropped(Random par1Random)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +45,7 @@ public class BlockDimWallPerm extends Block
|
|||||||
*/
|
*/
|
||||||
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
||||||
{
|
{
|
||||||
if(!par1World.isRemote&&par1World.provider.dimensionId==mod_pocketDim.limboDimID)
|
if(!par1World.isRemote&&par1World.provider.dimensionId==properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
@@ -68,14 +66,13 @@ public class BlockDimWallPerm extends Block
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int x = (link.destXCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
|
int x = (link.destXCoord + rand.nextInt(properties.LimboReturnRange)-properties.LimboReturnRange/2);
|
||||||
int z = (link.destZCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
|
int z = (link.destZCoord + rand.nextInt(properties.LimboReturnRange)-properties.LimboReturnRange/2);
|
||||||
|
|
||||||
x=x+(x>> 4); //make sure I am in the middle of a chunk, andnot on a boundry, so it doesnt load the chunk next to me
|
//make sure I am in the middle of a chunk, and not on a boundary, so it doesn't load the chunk next to me
|
||||||
|
x = x + (x >> 4);
|
||||||
z = z + (z >> 4);
|
z = z + (z >> 4);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int y = yCoordHelper.getFirstUncovered(0, x, 63, z);
|
int y = yCoordHelper.getFirstUncovered(0, x, 63, 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
|
||||||
@@ -103,12 +100,12 @@ public class BlockDimWallPerm extends Block
|
|||||||
|
|
||||||
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
|
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(0).setBlock(i+xc, j-1+yc, k+zc, mod_pocketDim.blockLimboID);
|
dimHelper.getWorld(0).setBlock(i+xc, j-1+yc, k+zc, properties.LimboBlockID);
|
||||||
}
|
}
|
||||||
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
|
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
|
||||||
|
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(0).setBlock(i+xc, j-1+yc, k+zc, mod_pocketDim.blockLimboID,2,0);
|
dimHelper.getWorld(0).setBlock(i+xc, j-1+yc, k+zc, properties.LimboBlockID,2,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.PacketHandler;
|
import StevenDimDoors.mod_pocketDim.PacketHandler;
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityRift;
|
import StevenDimDoors.mod_pocketDim.TileEntityRift;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -24,6 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
public class BlockRift extends BlockContainer
|
public class BlockRift extends BlockContainer
|
||||||
{
|
{
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public BlockRift(int i, int j, Material par2Material)
|
public BlockRift(int i, int j, Material par2Material)
|
||||||
{
|
{
|
||||||
@@ -31,16 +33,15 @@ public class BlockRift extends BlockContainer
|
|||||||
setTickRandomly(true);
|
setTickRandomly(true);
|
||||||
// this.setCreativeTab(CreativeTabs.tabBlock);
|
// this.setCreativeTab(CreativeTabs.tabBlock);
|
||||||
this.setLightOpacity(14);
|
this.setLightOpacity(14);
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
this.blockIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName2());
|
||||||
}
|
}
|
||||||
|
|
||||||
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
|
//sends a packet informing the client that there is a link present so it renders properly. (when placed)
|
||||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
@@ -118,7 +119,7 @@ public class BlockRift extends BlockContainer
|
|||||||
//function that regulates how many blocks it eats/ how fast it eates them.
|
//function that regulates how many blocks it eats/ how fast it eates them.
|
||||||
public void updateTick(World world, int x, int y, int z, Random random)
|
public void updateTick(World world, int x, int y, int z, Random random)
|
||||||
{
|
{
|
||||||
if(!world.isRemote&&dimHelper.instance.getLinkDataFromCoords(x, y, z, world.provider.dimensionId)!=null&&mod_pocketDim.enableRiftGrief)
|
if(!world.isRemote&&dimHelper.instance.getLinkDataFromCoords(x, y, z, world.provider.dimensionId)!=null && properties.RiftGriefingEnabled)
|
||||||
{
|
{
|
||||||
TileEntityRift rift = (TileEntityRift) world.getBlockTileEntity(x, y, z);
|
TileEntityRift rift = (TileEntityRift) world.getBlockTileEntity(x, y, z);
|
||||||
if(rift.isNearRift)
|
if(rift.isNearRift)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.blocks;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
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;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
@@ -28,12 +29,13 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
public class ChaosDoor extends dimDoor
|
public class ChaosDoor extends dimDoor
|
||||||
{
|
{
|
||||||
private Icon blockIconBottom;
|
private Icon blockIconBottom;
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public ChaosDoor(int par1, Material material)
|
public ChaosDoor(int par1, Material material)
|
||||||
{
|
{
|
||||||
super(par1, Material.iron);
|
super(par1, Material.iron);
|
||||||
// this.blockIndexInTexture = 18;
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
@@ -74,7 +76,7 @@ public class ChaosDoor extends dimDoor
|
|||||||
|
|
||||||
if(newDim)
|
if(newDim)
|
||||||
{
|
{
|
||||||
LinkData link = new LinkData(par1World.provider.dimensionId, mod_pocketDim.limboDimID, par2, par3, par4, par2, par3+500, par4, false,0);
|
LinkData link = new LinkData(par1World.provider.dimensionId, properties.LimboDimensionID, par2, par3, par4, par2, par3+500, par4, false,0);
|
||||||
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
|
link.linkOrientation= par1World.getBlockMetadata(par2, par3-1, par4);
|
||||||
dimHelper.instance.createLink(link);
|
dimHelper.instance.createLink(link);
|
||||||
// System.out.println(link.linkOrientation);
|
// System.out.println(link.linkOrientation);
|
||||||
@@ -101,9 +103,8 @@ public class ChaosDoor extends dimDoor
|
|||||||
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
int var12 = (int) (MathHelper.floor_double((double)((par5Entity.rotationYaw+90) * 4.0F / 360.0F) + 0.5D) & 3);
|
||||||
|
|
||||||
int num = par1World.getBlockMetadata(par2, par3-1, par4);
|
int num = par1World.getBlockMetadata(par2, par3-1, par4);
|
||||||
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==mod_pocketDim.chaosDoorID)
|
if(!par1World.isRemote&&(num==5||num==4||num==6||num==7)&&(num-4)==var12&&par1World.getBlockId(par2, par3-1, par4)==properties.UnstableDoorID)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
this.onPoweredBlockChange(par1World, par2, par3, par4, false);
|
||||||
|
|
||||||
boolean foundRandomDest=false;
|
boolean foundRandomDest=false;
|
||||||
@@ -122,7 +123,7 @@ public class ChaosDoor extends dimDoor
|
|||||||
if(link!=null)
|
if(link!=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!link.isLocPocket&&link.linkOrientation!=-10&&link.destDimID!=mod_pocketDim.limboDimID)
|
if(!link.isLocPocket&&link.linkOrientation!=-10&&link.destDimID!=properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
foundRandomDest=true;
|
foundRandomDest=true;
|
||||||
|
|
||||||
@@ -132,7 +133,7 @@ public class ChaosDoor extends dimDoor
|
|||||||
{
|
{
|
||||||
if(dimHelper.getWorld(link.locDimID).isAirBlock(link.locXCoord,link.locYCoord,link.locZCoord))
|
if(dimHelper.getWorld(link.locDimID).isAirBlock(link.locXCoord,link.locYCoord,link.locZCoord))
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord,link.locYCoord,link.locZCoord, mod_pocketDim.blockRiftID);
|
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord,link.locYCoord,link.locZCoord, properties.RiftBlockID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.blocks;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -34,9 +35,11 @@ public class dimDoor extends BlockContainer
|
|||||||
super(par1, Material.iron);
|
super(par1, Material.iron);
|
||||||
// this.blockIndexInTexture = 18;
|
// this.blockIndexInTexture = 18;
|
||||||
|
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
@@ -56,19 +59,19 @@ public class dimDoor extends BlockContainer
|
|||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
if(dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World)!=null)
|
||||||
{
|
{
|
||||||
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3, par4, par1World);
|
||||||
par1World.setBlock(par2, par3, par4, mod_pocketDim.blockRiftID);
|
par1World.setBlock(par2, par3, par4, properties.RiftBlockID);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World)!=null)
|
if(dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World)!=null)
|
||||||
{
|
{
|
||||||
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World);
|
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3-1, par4, par1World);
|
||||||
par1World.setBlock(par2, par3-1, par4, mod_pocketDim.blockRiftID);
|
par1World.setBlock(par2, par3-1, par4, properties.RiftBlockID);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World)!=null)
|
if(dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World)!=null)
|
||||||
{
|
{
|
||||||
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
|
LinkData link= dimHelper.instance.getLinkDataFromCoords(par2, par3+1, par4, par1World);
|
||||||
par1World.setBlock(par2, par3+1, par4, mod_pocketDim.blockRiftID);
|
par1World.setBlock(par2, par3+1, par4, properties.RiftBlockID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,7 +549,7 @@ public class dimDoor extends BlockContainer
|
|||||||
{
|
{
|
||||||
if (!par1World.isRemote)
|
if (!par1World.isRemote)
|
||||||
{
|
{
|
||||||
this.dropBlockAsItem(par1World, par2, par3, par4, mod_pocketDim.dimDoorID, 0);
|
this.dropBlockAsItem(par1World, par2, par3, par4, properties.DimensionalDoorID, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
import StevenDimDoors.mod_pocketDim.DimData;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -14,14 +15,19 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
public class CommandDeleteRifts extends CommandBase
|
public class CommandDeleteRifts extends CommandBase
|
||||||
{
|
{
|
||||||
|
public CommandDeleteRifts()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public String getCommandName()//the name of our command
|
public String getCommandName()//the name of our command
|
||||||
{
|
{
|
||||||
return "dimdoors-cleanupRifts";
|
return "dimdoors-cleanupRifts";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
public void processCommand(ICommandSender var1, String[] var2)
|
||||||
|
|
||||||
@@ -79,7 +85,7 @@ public class CommandDeleteRifts extends CommandBase
|
|||||||
}
|
}
|
||||||
targetWorld = dimHelper.getWorld(targetDim);
|
targetWorld = dimHelper.getWorld(targetDim);
|
||||||
|
|
||||||
if(targetWorld.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord)==mod_pocketDim.blockRiftID)
|
if(targetWorld.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord)==properties.RiftBlockID)
|
||||||
{
|
{
|
||||||
dim.removeLinkAtCoords(link);
|
dim.removeLinkAtCoords(link);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
package StevenDimDoors.mod_pocketDim.commands;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||||
@@ -10,14 +11,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
|
|
||||||
public class CommandEndDungeonCreation extends CommandBase
|
public class CommandEndDungeonCreation extends CommandBase
|
||||||
{
|
{
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
public CommandEndDungeonCreation()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
public String getCommandName()//the name of our command
|
public String getCommandName()//the name of our command
|
||||||
{
|
{
|
||||||
return "dimdoors-endDungeonCreation";
|
return "dimdoors-endDungeonCreation";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processCommand(ICommandSender var1, String[] var2)
|
public void processCommand(ICommandSender var1, String[] var2)
|
||||||
|
|
||||||
@@ -53,8 +59,8 @@ public class CommandEndDungeonCreation extends CommandBase
|
|||||||
}
|
}
|
||||||
else if(!player.worldObj.isRemote)
|
else if(!player.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
DungeonGenerator newDungeon = mod_pocketDim.dungeonHelper.exportDungeon(player.worldObj, x, y, z, mod_pocketDim.schematicContainer+"/"+var2[0]+".schematic");
|
DungeonGenerator newDungeon = mod_pocketDim.dungeonHelper.exportDungeon(player.worldObj, x, y, z, properties.CustomSchematicDirectory + "/" + var2[0] + ".schematic");
|
||||||
player.sendChatToPlayer("created dungeon schematic in " +mod_pocketDim.schematicContainer+"/"+var2[0]+".schematic");
|
player.sendChatToPlayer("created dungeon schematic in " + properties.CustomSchematicDirectory +"/"+var2[0]+".schematic");
|
||||||
mod_pocketDim.dungeonHelper.customDungeons.add(newDungeon);
|
mod_pocketDim.dungeonHelper.customDungeons.add(newDungeon);
|
||||||
|
|
||||||
if(mod_pocketDim.dungeonHelper.customDungeonStatus.containsKey(player.worldObj.provider.dimensionId)&&!player.worldObj.isRemote)
|
if(mod_pocketDim.dungeonHelper.customDungeonStatus.containsKey(player.worldObj.provider.dimensionId)&&!player.worldObj.isRemote)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
import StevenDimDoors.mod_pocketDim.DimData;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -18,6 +19,14 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
public class CommandStartDungeonCreation extends CommandBase
|
public class CommandStartDungeonCreation extends CommandBase
|
||||||
{
|
{
|
||||||
|
public CommandStartDungeonCreation()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public String getCommandName()//the name of our command
|
public String getCommandName()//the name of our command
|
||||||
{
|
{
|
||||||
return "dimdoors-startDungeonCreation";
|
return "dimdoors-startDungeonCreation";
|
||||||
@@ -40,7 +49,7 @@ public class CommandStartDungeonCreation extends CommandBase
|
|||||||
|
|
||||||
link = dimHelper.instance.createPocket(link,true, false);
|
link = dimHelper.instance.createPocket(link,true, false);
|
||||||
|
|
||||||
itemDimDoor.placeDoorBlock(player.worldObj, x, y, z, 3, Block.blocksList[mod_pocketDim.ExitDoorID]);
|
itemDimDoor.placeDoorBlock(player.worldObj, x, y, z, 3, Block.blocksList[properties.WarpDoorID]);
|
||||||
|
|
||||||
// dimHelper.instance.teleportToPocket(player.worldObj, link, player);
|
// dimHelper.instance.teleportToPocket(player.worldObj, link, player);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.block.BlockContainer;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -37,9 +38,12 @@ public class DungeonHelper
|
|||||||
|
|
||||||
public DungeonHelper()
|
public DungeonHelper()
|
||||||
{
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
private Random rand = new Random();
|
private Random rand = new Random();
|
||||||
|
|
||||||
public HashMap<Integer, LinkData> customDungeonStatus = new HashMap<Integer, LinkData>();
|
public HashMap<Integer, LinkData> customDungeonStatus = new HashMap<Integer, LinkData>();
|
||||||
@@ -361,27 +365,27 @@ public class DungeonHelper
|
|||||||
for(int count=0;count<50;count++)
|
for(int count=0;count<50;count++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(world.getBlockId(xMin, yI, zI)!=mod_pocketDim.blockDimWallPermID)
|
if(world.getBlockId(xMin, yI, zI)!=properties.PermaFabricBlockID)
|
||||||
{
|
{
|
||||||
xMin--;
|
xMin--;
|
||||||
}
|
}
|
||||||
if(world.getBlockId(xI, yMin, zI)!=mod_pocketDim.blockDimWallPermID)
|
if(world.getBlockId(xI, yMin, zI)!=properties.PermaFabricBlockID)
|
||||||
{
|
{
|
||||||
yMin--;
|
yMin--;
|
||||||
}
|
}
|
||||||
if(world.getBlockId(xI, yI, zMin)!=mod_pocketDim.blockDimWallPermID)
|
if(world.getBlockId(xI, yI, zMin)!=properties.PermaFabricBlockID)
|
||||||
{
|
{
|
||||||
zMin--;
|
zMin--;
|
||||||
}
|
}
|
||||||
if(world.getBlockId(xMax, yI, zI)!=mod_pocketDim.blockDimWallPermID)
|
if(world.getBlockId(xMax, yI, zI)!=properties.PermaFabricBlockID)
|
||||||
{
|
{
|
||||||
xMax++;
|
xMax++;
|
||||||
}
|
}
|
||||||
if(world.getBlockId(xI, yMax, zI)!=mod_pocketDim.blockDimWallPermID)
|
if(world.getBlockId(xI, yMax, zI)!=properties.PermaFabricBlockID)
|
||||||
{
|
{
|
||||||
yMax++;
|
yMax++;
|
||||||
}
|
}
|
||||||
if(world.getBlockId(xI, yI, zMax)!=mod_pocketDim.blockDimWallPermID)
|
if(world.getBlockId(xI, yI, zMax)!=properties.PermaFabricBlockID)
|
||||||
{
|
{
|
||||||
zMax++;
|
zMax++;
|
||||||
}
|
}
|
||||||
@@ -409,11 +413,11 @@ public class DungeonHelper
|
|||||||
int blockID = world.getBlockId(x+xMin, y+yMin, z+zMin);
|
int blockID = world.getBlockId(x+xMin, y+yMin, z+zMin);
|
||||||
int meta= world.getBlockMetadata(x+xMin, y+yMin, z+zMin);
|
int meta= world.getBlockMetadata(x+xMin, y+yMin, z+zMin);
|
||||||
|
|
||||||
if(blockID==mod_pocketDim.dimDoorID)
|
if(blockID==properties.DimensionalDoorID)
|
||||||
{
|
{
|
||||||
blockID=Block.doorIron.blockID;
|
blockID=Block.doorIron.blockID;
|
||||||
}
|
}
|
||||||
if(blockID==mod_pocketDim.ExitDoorID)
|
if(blockID==properties.WarpDoorID)
|
||||||
{
|
{
|
||||||
blockID=Block.doorWood.blockID;
|
blockID=Block.doorWood.blockID;
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,30 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.network.packet.Packet41EntityEffect;
|
||||||
|
import net.minecraft.network.packet.Packet43Experience;
|
||||||
|
import net.minecraft.network.packet.Packet9Respawn;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.WorldServer;
|
||||||
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||||
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
import StevenDimDoors.mod_pocketDim.DimData;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.ObjectSaveInputStream;
|
import StevenDimDoors.mod_pocketDim.ObjectSaveInputStream;
|
||||||
@@ -24,32 +42,7 @@ import StevenDimDoors.mod_pocketDim.TileEntityRift;
|
|||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
||||||
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
|
import StevenDimDoors.mod_pocketDim.world.pocketProvider;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityList;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.network.packet.Packet10Flying;
|
|
||||||
import net.minecraft.network.packet.Packet39AttachEntity;
|
|
||||||
import net.minecraft.network.packet.Packet41EntityEffect;
|
|
||||||
import net.minecraft.network.packet.Packet43Experience;
|
|
||||||
import net.minecraft.network.packet.Packet9Respawn;
|
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.Teleporter;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.WorldServer;
|
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
|
||||||
import net.minecraftforge.common.DimensionManager;
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
|
||||||
@@ -80,20 +73,20 @@ public class dimHelper extends DimensionManager
|
|||||||
public static dimHelper instance = new dimHelper();
|
public static dimHelper instance = new dimHelper();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HashMap for temporary storage of Link Singnature damage hash values. See itemLinkSignature for more details
|
* HashMap for temporary storage of Link Signature damage hash values. See itemLinkSignature for more details
|
||||||
* @Return
|
* @Return
|
||||||
*/
|
*/
|
||||||
public HashMap<Integer, LinkData> interDimLinkList= new HashMap<Integer,LinkData>();
|
public HashMap<Integer, LinkData> interDimLinkList= new HashMap<Integer,LinkData>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ArrayList containing all link data not sorted for easy random access, used for random doors and for recreating rifts if they have a block placed over them.
|
* ArrayList containing all link data not sorted for easy random access, used for random doors and for recreating rifts if they have a block placed over them.
|
||||||
* See the common tick manager and the Chaos door for details on useage
|
* See the common tick manager and the Chaos door for details on usage
|
||||||
* @Return
|
* @Return
|
||||||
*/
|
*/
|
||||||
//public ArrayList<LinkData> linksForRendering =new ArrayList<LinkData>();
|
//public ArrayList<LinkData> linksForRendering =new ArrayList<LinkData>();
|
||||||
Random rand= new Random();
|
Random rand= new Random();
|
||||||
|
|
||||||
//Stupid function I use because I dont understand bitwise operations yet. Used in door orientation
|
//Stupid function I use because I don't understand bitwise operations yet. Used in door orientation
|
||||||
//TODO get rid of this
|
//TODO get rid of this
|
||||||
public int flipDoorMetadata(int data)
|
public int flipDoorMetadata(int data)
|
||||||
{
|
{
|
||||||
@@ -113,9 +106,6 @@ public class dimHelper extends DimensionManager
|
|||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(data==4)
|
if(data==4)
|
||||||
{
|
{
|
||||||
return 6;
|
return 6;
|
||||||
@@ -160,16 +150,8 @@ public class dimHelper extends DimensionManager
|
|||||||
{
|
{
|
||||||
entity.mountEntity(null);
|
entity.mountEntity(null);
|
||||||
cart = teleportEntity(oldWorld, cart, link);
|
cart = teleportEntity(oldWorld, cart, link);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WorldServer newWorld;
|
WorldServer newWorld;
|
||||||
|
|
||||||
if(this.getWorld(link.destDimID)==null)
|
if(this.getWorld(link.destDimID)==null)
|
||||||
@@ -297,15 +279,10 @@ public class dimHelper extends DimensionManager
|
|||||||
}
|
}
|
||||||
mod_pocketDim.teleporter.placeInPortal(entity, newWorld, link);
|
mod_pocketDim.teleporter.placeInPortal(entity, newWorld, link);
|
||||||
return entity;
|
return entity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Primary function used to teleport the player using doors. Performes numerous null checks, and also generates the destination door/pocket if it has not done so already.
|
* Primary function used to teleport the player using doors. Performs numerous null checks, and also generates the destination door/pocket if it has not done so already.
|
||||||
* Also ensures correct orientation relative to the door using the pocketTeleporter.
|
* Also ensures correct orientation relative to the door using the pocketTeleporter.
|
||||||
* @param world- world the player is currently in
|
* @param world- world the player is currently in
|
||||||
* @param linkData- the link the player is using to teleport, sends the player to its dest information.
|
* @param linkData- the link the player is using to teleport, sends the player to its dest information.
|
||||||
@@ -315,25 +292,20 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public void teleportToPocket(World world,LinkData linkData, Entity entity)
|
public void teleportToPocket(World world,LinkData linkData, Entity entity)
|
||||||
{
|
{
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (linkData != null)
|
if (linkData != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int destinationID=linkData.destDimID;
|
int destinationID=linkData.destDimID;
|
||||||
|
|
||||||
int x=linkData.destXCoord;
|
int x=linkData.destXCoord;
|
||||||
int y=linkData.destYCoord;
|
int y=linkData.destYCoord;
|
||||||
int z=linkData.destZCoord;
|
int z=linkData.destZCoord;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int depth= this.getDimDepth(world.provider.dimensionId);
|
int depth= this.getDimDepth(world.provider.dimensionId);
|
||||||
|
|
||||||
if(this.dimList.containsKey(destinationID) && this.dimList.containsKey(world.provider.dimensionId))
|
if(this.dimList.containsKey(destinationID) && this.dimList.containsKey(world.provider.dimensionId))
|
||||||
@@ -384,14 +356,14 @@ public class dimHelper extends DimensionManager
|
|||||||
}
|
}
|
||||||
if(count==19)
|
if(count==19)
|
||||||
{
|
{
|
||||||
entity.worldObj.setBlock(playerXCoord, playerYCoord-1, playerZCoord, mod_pocketDim.blockDimWallID);
|
entity.worldObj.setBlock(playerXCoord, playerYCoord-1, playerZCoord, properties.FabricBlockID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.worldObj.getBlockId(playerXCoord, playerYCoord-1,playerZCoord )==Block.lavaStill.blockID)
|
if(entity.worldObj.getBlockId(playerXCoord, playerYCoord-1,playerZCoord )==Block.lavaStill.blockID)
|
||||||
{
|
{
|
||||||
entity.worldObj.setBlock(playerXCoord, playerYCoord-1, playerZCoord, mod_pocketDim.blockDimWallID);
|
entity.worldObj.setBlock(playerXCoord, playerYCoord-1, playerZCoord, properties.FabricBlockID);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.generateDoor(world,linkData);
|
this.generateDoor(world,linkData);
|
||||||
@@ -470,20 +442,14 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public LinkData createLink( int locationDimID, int destinationDimID, int locationXCoord, int locationYCoord, int locationZCoord, int destinationXCoord, int destinationYCoord, int destinationZCoord,int linkOrientation)
|
public LinkData createLink( int locationDimID, int destinationDimID, int locationXCoord, int locationYCoord, int locationZCoord, int destinationXCoord, int destinationYCoord, int destinationZCoord,int linkOrientation)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinkData linkData =new LinkData( locationDimID, destinationDimID, locationXCoord, locationYCoord, locationZCoord, destinationXCoord, destinationYCoord ,destinationZCoord,false,linkOrientation);
|
LinkData linkData =new LinkData( locationDimID, destinationDimID, locationXCoord, locationYCoord, locationZCoord, destinationXCoord, destinationYCoord ,destinationZCoord,false,linkOrientation);
|
||||||
return this.createLink(linkData);
|
return this.createLink(linkData);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public LinkData createLink(LinkData link)
|
public LinkData createLink(LinkData link)
|
||||||
{
|
{
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
if(!this.dimList.containsKey(link.locDimID))
|
if(!this.dimList.containsKey(link.locDimID))
|
||||||
{
|
{
|
||||||
@@ -514,7 +480,7 @@ public class dimHelper extends DimensionManager
|
|||||||
|
|
||||||
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))
|
if(!mod_pocketDim.blocksImmuneToRift.contains(blocktoReplace))
|
||||||
{
|
{
|
||||||
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, properties.RiftBlockID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,6 +586,8 @@ public class dimHelper extends DimensionManager
|
|||||||
int destY = incLink.destYCoord;
|
int destY = incLink.destYCoord;
|
||||||
int destZ = incLink.destZCoord;
|
int destZ = incLink.destZCoord;
|
||||||
|
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
if(!incLink.hasGennedDoor)
|
if(!incLink.hasGennedDoor)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -629,7 +597,7 @@ public class dimHelper extends DimensionManager
|
|||||||
DimData data = this.dimList.get(destinationID);
|
DimData data = this.dimList.get(destinationID);
|
||||||
|
|
||||||
int id =world.getBlockId(locX, locY, locZ);
|
int id =world.getBlockId(locX, locY, locZ);
|
||||||
if(id==mod_pocketDim.ExitDoorID||id==mod_pocketDim.dimDoorID||id==mod_pocketDim.transientDoorID)
|
if(id==properties.WarpDoorID||id==properties.DimensionalDoorID||id==properties.TransientDoorID)
|
||||||
{
|
{
|
||||||
int doorTypeToPlace=id;
|
int doorTypeToPlace=id;
|
||||||
|
|
||||||
@@ -653,7 +621,7 @@ public class dimHelper extends DimensionManager
|
|||||||
|
|
||||||
|
|
||||||
int blockToReplace= this.getWorld(destinationID).getBlockId(destX, destY, destZ);
|
int blockToReplace= this.getWorld(destinationID).getBlockId(destX, destY, destZ);
|
||||||
if(blockToReplace!=mod_pocketDim.dimDoorID&&blockToReplace!=mod_pocketDim.ExitDoorID&&blockToReplace!=mod_pocketDim.transientDoorID)
|
if(blockToReplace!=properties.DimensionalDoorID&&blockToReplace!=properties.WarpDoorID&&blockToReplace != properties.TransientDoorID)
|
||||||
{
|
{
|
||||||
this.getWorld(destinationID).setBlock(destX, destY-1, destZ, doorTypeToPlace,destOrientation,2);
|
this.getWorld(destinationID).setBlock(destX, destY-1, destZ, doorTypeToPlace,destOrientation,2);
|
||||||
this.getWorld(destinationID).setBlock(destX, destY, destZ, doorTypeToPlace,8,2);
|
this.getWorld(destinationID).setBlock(destX, destY, destZ, doorTypeToPlace,8,2);
|
||||||
@@ -683,6 +651,8 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public void generatePocket(LinkData incomingLink)
|
public void generatePocket(LinkData incomingLink)
|
||||||
{
|
{
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -764,15 +734,15 @@ public class dimHelper extends DimensionManager
|
|||||||
{
|
{
|
||||||
if(Math.abs(xCount)>=19||Math.abs(yCount)>=19||Math.abs(zCount)>=19)
|
if(Math.abs(xCount)>=19||Math.abs(yCount)>=19||Math.abs(zCount)>=19)
|
||||||
{
|
{
|
||||||
this.setBlockDirectly(this.getWorld(incomingLink.destDimID), x+xCount, y+yCount, z+zCount,mod_pocketDim.blockDimWallPermID,0);
|
this.setBlockDirectly(this.getWorld(incomingLink.destDimID), x+xCount, y+yCount, z+zCount,properties.PermaFabricBlockID,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.setBlockDirectly(this.getWorld(incomingLink.destDimID), x+xCount, y+yCount, z+zCount,mod_pocketDim.blockDimWallID,0);
|
this.setBlockDirectly(this.getWorld(incomingLink.destDimID), x+xCount, y+yCount, z+zCount,properties.FabricBlockID,0);
|
||||||
if(mod_pocketDim.TNFREAKINGT)
|
if(properties.TNFREAKINGT_Enabled)
|
||||||
{
|
{
|
||||||
if((Math.abs(xCount)>=16||Math.abs(yCount)>=16||Math.abs(zCount)>=16)&&rand.nextInt(mod_pocketDim.HOW_MUCH_TNT)==1)
|
if((Math.abs(xCount)>=16||Math.abs(yCount)>=16||Math.abs(zCount)>=16) && rand.nextInt(properties.NonTntWeight + 1) == 0)
|
||||||
{
|
{
|
||||||
this.getWorld(incomingLink.destDimID).setBlock( x+xCount, y+yCount, z+zCount,Block.tnt.blockID);
|
this.getWorld(incomingLink.destDimID).setBlock( x+xCount, y+yCount, z+zCount,Block.tnt.blockID);
|
||||||
}
|
}
|
||||||
@@ -807,6 +777,8 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public void initPockets()
|
public void initPockets()
|
||||||
{
|
{
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
mod_pocketDim.hasInitDims=true;
|
mod_pocketDim.hasInitDims=true;
|
||||||
this.load();
|
this.load();
|
||||||
if(!this.dimList.isEmpty())
|
if(!this.dimList.isEmpty())
|
||||||
@@ -826,7 +798,7 @@ public class dimHelper extends DimensionManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.getNextFreeDimId();
|
this.getNextFreeDimId();
|
||||||
registerDimension(dimData.dimID,mod_pocketDim.providerID);
|
registerDimension(dimData.dimID,properties.PocketProviderID);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -911,9 +883,11 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public LinkData createPocket(LinkData link , boolean isGoingDown, boolean isRandomRift)
|
public LinkData createPocket(LinkData link , boolean isGoingDown, boolean isRandomRift)
|
||||||
{
|
{
|
||||||
if(this.getWorld(link.locDimID)==null)
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
|
if (dimHelper.getWorld(link.locDimID) == null)
|
||||||
{
|
{
|
||||||
this.initDimension(link.locDimID);
|
dimHelper.initDimension(link.locDimID);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dimensionID;
|
int dimensionID;
|
||||||
@@ -921,11 +895,7 @@ public class dimHelper extends DimensionManager
|
|||||||
// World world = this.getWorld(link.locDimID);
|
// World world = this.getWorld(link.locDimID);
|
||||||
|
|
||||||
dimensionID = getNextFreeDimId();
|
dimensionID = getNextFreeDimId();
|
||||||
registerDimension(dimensionID,mod_pocketDim.providerID);
|
registerDimension(dimensionID, properties.PocketProviderID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DimData locationDimData;
|
DimData locationDimData;
|
||||||
DimData destDimData;
|
DimData destDimData;
|
||||||
|
|
||||||
@@ -1324,6 +1294,7 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public static boolean removeRift(World world, int x, int y, int z, int range, EntityPlayer player, ItemStack item)
|
public static boolean removeRift(World world, int x, int y, int z, int range, EntityPlayer player, ItemStack item)
|
||||||
{
|
{
|
||||||
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
LinkData nearest=null;
|
LinkData nearest=null;
|
||||||
float distance=range+1;
|
float distance=range+1;
|
||||||
@@ -1337,7 +1308,7 @@ public class dimHelper extends DimensionManager
|
|||||||
{
|
{
|
||||||
while (k<range)
|
while (k<range)
|
||||||
{
|
{
|
||||||
if(world.getBlockId(x+i, y+j, z+k)==mod_pocketDim.blockRiftID&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
|
if(world.getBlockId(x+i, y+j, z+k)==properties.RiftBlockID&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
|
||||||
{
|
{
|
||||||
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0||range==1)
|
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0||range==1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
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;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
@@ -29,26 +30,23 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
public class ItemRiftBlade extends itemDimDoor
|
public class ItemRiftBlade extends itemDimDoor
|
||||||
{
|
{
|
||||||
private int weaponDamage;
|
|
||||||
private final EnumToolMaterial toolMaterial= EnumToolMaterial.GOLD;
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
Random rand = new Random();
|
|
||||||
public ItemRiftBlade(int par1, Material par2Material)
|
public ItemRiftBlade(int par1, Material par2Material)
|
||||||
{
|
{
|
||||||
super(par1, par2Material);
|
super(par1, par2Material);
|
||||||
|
|
||||||
// this.setTextureFile("/PocketBlockTextures.png");
|
// this.setTextureFile("/PocketBlockTextures.png");
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||||
this.weaponDamage =8;
|
|
||||||
this.setMaxStackSize(1);
|
this.setMaxStackSize(1);
|
||||||
|
|
||||||
// this.itemIcon=5;
|
// this.itemIcon=5;
|
||||||
this.setMaxDamage(500);
|
this.setMaxDamage(500);
|
||||||
this.hasSubtypes=false;
|
this.hasSubtypes=false;
|
||||||
//TODO move to proxy
|
//TODO move to proxy
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
|
||||||
@@ -70,8 +68,6 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
public boolean hasEffect(ItemStack par1ItemStack)
|
||||||
@@ -226,7 +222,7 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
||||||
if(hit!=null&&!par2World.isRemote)
|
if(hit!=null&&!par2World.isRemote)
|
||||||
{
|
{
|
||||||
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
|
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==properties.RiftBlockID)
|
||||||
{
|
{
|
||||||
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
||||||
if(link!=null)
|
if(link!=null)
|
||||||
@@ -262,7 +258,7 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.transientDoorID)
|
else if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ) == properties.TransientDoorID)
|
||||||
{
|
{
|
||||||
didFindThing=true;
|
didFindThing=true;
|
||||||
}
|
}
|
||||||
@@ -385,17 +381,11 @@ public class ItemRiftBlade extends itemDimDoor
|
|||||||
*/
|
*/
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Opens a temporary doors,");
|
par3List.add("Opens a temporary doors,");
|
||||||
par3List.add ("special teleport attack,");
|
par3List.add ("special teleport attack,");
|
||||||
par3List.add ("and rotates existing doors");
|
par3List.add ("and rotates existing doors");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
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;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
@@ -20,7 +21,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
public class ItemStabilizedRiftSignature extends itemLinkSignature
|
public class ItemStabilizedRiftSignature extends itemLinkSignature
|
||||||
{
|
{
|
||||||
private Material doorMaterial;
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public ItemStabilizedRiftSignature(int par)
|
public ItemStabilizedRiftSignature(int par)
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,9 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
|||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
this.hasSubtypes=true;
|
this.hasSubtypes=true;
|
||||||
//TODO move to proxy
|
//TODO move to proxy
|
||||||
|
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@@ -85,9 +89,9 @@ public class ItemStabilizedRiftSignature extends itemLinkSignature
|
|||||||
boolean hasEnder = false;
|
boolean hasEnder = false;
|
||||||
// checks to see if the item has a link stored, if so, it creates it
|
// checks to see if the item has a link stored, if so, it creates it
|
||||||
|
|
||||||
if(par2EntityPlayer.inventory.hasItem(Item.enderPearl.itemID)||par2EntityPlayer.inventory.hasItem(mod_pocketDim.itemStableFabricID))
|
if(par2EntityPlayer.inventory.hasItem(Item.enderPearl.itemID)||par2EntityPlayer.inventory.hasItem(properties.StableFabricItemID))
|
||||||
{
|
{
|
||||||
if(!par2EntityPlayer.inventory.consumeInventoryItem(mod_pocketDim.itemStableFabricID))
|
if(!par2EntityPlayer.inventory.consumeInventoryItem(properties.StableFabricItemID))
|
||||||
|
|
||||||
{
|
{
|
||||||
par2EntityPlayer.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
par2EntityPlayer.inventory.consumeInventoryItem(Item.enderPearl.itemID);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class ItemStableFabric extends Item
|
|||||||
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
||||||
if(hit!=null&&!par2World.isRemote)
|
if(hit!=null&&!par2World.isRemote)
|
||||||
{
|
{
|
||||||
//if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
|
//if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==properties.RiftBlockID)
|
||||||
{
|
{
|
||||||
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
||||||
if(link!=null)
|
if(link!=null)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
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;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
@@ -24,34 +25,31 @@ import net.minecraft.world.World;
|
|||||||
|
|
||||||
public class itemDimDoor extends ItemDoor
|
public class itemDimDoor extends ItemDoor
|
||||||
{
|
{
|
||||||
private Material doorMaterial;
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public itemDimDoor(int par1, Material par2Material)
|
public itemDimDoor(int par1, Material par2Material)
|
||||||
{
|
{
|
||||||
super(par1, par2Material);
|
super(par1, par2Material);
|
||||||
this.setMaxStackSize(64);
|
this.setMaxStackSize(64);
|
||||||
this.doorMaterial = par2Material;
|
|
||||||
this.setCreativeTab(CreativeTabs.tabTransport);
|
this.setCreativeTab(CreativeTabs.tabTransport);
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerIcons(IconRegister par1IconRegister)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName().replace("item.", ""));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
par3List.add("Place on the block under a rift");
|
par3List.add("Place on the block under a rift");
|
||||||
par3List.add ("to activate that rift,");
|
par3List.add ("to activate that rift,");
|
||||||
par3List.add("or place anywhere else");
|
par3List.add("or place anywhere else");
|
||||||
par3List.add("to create a pocket dim");
|
par3List.add("to create a pocket dim");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||||
{
|
{
|
||||||
@@ -79,9 +77,6 @@ public class itemDimDoor extends ItemDoor
|
|||||||
var11 = mod_pocketDim.dimDoor;
|
var11 = mod_pocketDim.dimDoor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote)
|
if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)&&!par3World.isRemote)
|
||||||
{
|
{
|
||||||
int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
|
||||||
@@ -105,8 +100,6 @@ public class itemDimDoor extends ItemDoor
|
|||||||
|
|
||||||
placeDoorBlock(par3World, par4, par5-offset, par6, var12, var11);
|
placeDoorBlock(par3World, par4, par5-offset, par6, var12, var11);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--par1ItemStack.stackSize;
|
--par1ItemStack.stackSize;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -144,13 +137,11 @@ public class itemDimDoor extends ItemDoor
|
|||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||||
{
|
{
|
||||||
|
boolean didFindThing = false;
|
||||||
|
|
||||||
Boolean didFindThing=false;
|
|
||||||
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
MovingObjectPosition hit = this.getMovingObjectPositionFromPlayer(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
||||||
if(hit!=null&&!par2World.isRemote)
|
if(hit!=null&&!par2World.isRemote)
|
||||||
{
|
{
|
||||||
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ)==mod_pocketDim.blockRiftID)
|
if(par2World.getBlockId(hit.blockX, hit.blockY, hit.blockZ) == properties.RiftBlockID)
|
||||||
{
|
{
|
||||||
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
LinkData link = dimHelper.instance.getLinkDataFromCoords(hit.blockX, hit.blockY, hit.blockZ, par2World);
|
||||||
if(link!=null)
|
if(link!=null)
|
||||||
@@ -212,25 +203,15 @@ public class itemDimDoor extends ItemDoor
|
|||||||
int id = world.getBlockId(i, j, k);
|
int id = world.getBlockId(i, j, k);
|
||||||
|
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
if(id==mod_pocketDim.blockDimWallID||id==mod_pocketDim.blockRiftID||id==mod_pocketDim.blockDimWallPermID||id==0)
|
if (id==properties.FabricBlockID || id==properties.RiftBlockID || id==properties.PermaFabricBlockID || id == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(id!=0)
|
if (id != 0 && !Block.blocksList[id].blockMaterial.isReplaceable())
|
||||||
{
|
{
|
||||||
if(!Block.blocksList[id].blockMaterial.isReplaceable())
|
|
||||||
{
|
|
||||||
|
|
||||||
flag = false;
|
flag = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package StevenDimDoors.mod_pocketDim.items;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
import StevenDimDoors.mod_pocketDim.DimData;
|
||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
@@ -22,7 +23,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
|
|
||||||
public class itemLinkSignature extends Item
|
public class itemLinkSignature extends Item
|
||||||
{
|
{
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
public itemLinkSignature(int par1)
|
public itemLinkSignature(int par1)
|
||||||
{
|
{
|
||||||
@@ -35,8 +35,12 @@ public class itemLinkSignature extends Item
|
|||||||
this.setMaxDamage(0);
|
this.setMaxDamage(0);
|
||||||
this.hasSubtypes=true;
|
this.hasSubtypes=true;
|
||||||
//TODO move to proxy
|
//TODO move to proxy
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public boolean hasEffect(ItemStack par1ItemStack)
|
public boolean hasEffect(ItemStack par1ItemStack)
|
||||||
@@ -90,22 +94,22 @@ public class itemLinkSignature extends Item
|
|||||||
offset = 1;
|
offset = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.dimDoorID)
|
if(par3World.getBlockId(par4, par5, par6) == properties.DimensionalDoorID && par3World.getBlockId(par4, par5 + 1, par6) == properties.DimensionalDoorID)
|
||||||
{
|
{
|
||||||
offset = 1;
|
offset = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5+1, par6)==mod_pocketDim.ExitDoorID)
|
if(par3World.getBlockId(par4, par5, par6)==properties.WarpDoorID&&par3World.getBlockId(par4, par5+1, par6)==properties.WarpDoorID)
|
||||||
{
|
{
|
||||||
offset = 1;
|
offset = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.dimDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.dimDoorID)
|
if (par3World.getBlockId(par4, par5, par6)==properties.DimensionalDoorID&&par3World.getBlockId(par4, par5-1, par6)==properties.DimensionalDoorID)
|
||||||
{
|
{
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(par3World.getBlockId(par4, par5, par6)==mod_pocketDim.ExitDoorID&&par3World.getBlockId(par4, par5-1, par6)==mod_pocketDim.ExitDoorID)
|
if (par3World.getBlockId(par4, par5, par6) == properties.WarpDoorID && par3World.getBlockId(par4, par5-1, par6)==properties.WarpDoorID)
|
||||||
{
|
{
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
@@ -118,7 +122,7 @@ public class itemLinkSignature extends Item
|
|||||||
{
|
{
|
||||||
int id= (par3World.getBlockId(par4, par5+count, par6));
|
int id= (par3World.getBlockId(par4, par5+count, par6));
|
||||||
|
|
||||||
if(id == mod_pocketDim.dimDoorID||id==mod_pocketDim.ExitDoorID||id==mod_pocketDim.chaosDoorID)
|
if(id == properties.DimensionalDoorID||id==properties.WarpDoorID||id== properties.UnstableDoorID)
|
||||||
{
|
{
|
||||||
orientation = dimHelper.instance.getLinkDataFromCoords(par4, par5+count, par6,par3World).linkOrientation;
|
orientation = dimHelper.instance.getLinkDataFromCoords(par4, par5+count, par6,par3World).linkOrientation;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package StevenDimDoors.mod_pocketDim;
|
|||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@@ -15,7 +14,6 @@ import net.minecraft.entity.item.EntityItem;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
import net.minecraftforge.common.Configuration;
|
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
|
import StevenDimDoors.mod_pocketDim.blocks.BlockDimWall;
|
||||||
@@ -95,74 +93,31 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
@Instance("PocketDimensions")
|
@Instance("PocketDimensions")
|
||||||
public static mod_pocketDim instance = new mod_pocketDim();
|
public static mod_pocketDim instance = new mod_pocketDim();
|
||||||
public static SchematicLoader loader = new SchematicLoader();
|
|
||||||
public static pocketTeleporter teleporter = new pocketTeleporter();
|
|
||||||
public static DungeonHelper dungeonHelper= new DungeonHelper();
|
|
||||||
|
|
||||||
|
public static SchematicLoader loader;
|
||||||
|
public static pocketTeleporter teleporter;
|
||||||
|
public static DungeonHelper dungeonHelper;
|
||||||
|
|
||||||
|
public static ICommand printDimData;
|
||||||
|
public static ICommand removeRiftsCommand;
|
||||||
|
public static ICommand pruneDimsCommand;
|
||||||
|
public static ICommand removeAllLinksCommand;
|
||||||
|
public static ICommand deleteDimDataCommand;
|
||||||
|
public static ICommand addDungeonRift;
|
||||||
|
public static ICommand endDungeonCreation;
|
||||||
|
public static ICommand startDungeonCreation;
|
||||||
|
|
||||||
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 itemLinkSignatureID;
|
|
||||||
public static int blockRiftID;
|
|
||||||
public static int transientDoorID;
|
|
||||||
public static int itemRiftBladeID;
|
|
||||||
public static int limboExitRange;
|
|
||||||
// public static int railRenderID;
|
|
||||||
|
|
||||||
public static String schematicContainer;
|
|
||||||
|
|
||||||
public static int itemStableFabricID;
|
|
||||||
|
|
||||||
public static int itemStabilizedLinkSignatureID;
|
|
||||||
public static int itemExitDoorID;
|
|
||||||
public static int limboDimID;
|
|
||||||
public static int limboProviderID;
|
|
||||||
public static int itemChaosDoorID;
|
|
||||||
public static int chaosDoorID;
|
|
||||||
public static int blockLimboID;
|
|
||||||
public static int dimHatchID;
|
|
||||||
// public static int dimRailID;
|
|
||||||
|
|
||||||
public static int riftSpreadFactor;
|
|
||||||
public static int DoorRenderID=55;
|
|
||||||
public static int HOW_MUCH_TNT;
|
|
||||||
|
|
||||||
|
|
||||||
public static int itemDimDoorID;
|
|
||||||
///public static int linkDimDoorID;
|
|
||||||
public static int blockDimWallID;
|
|
||||||
public static int itemRiftRemoverID;
|
|
||||||
public static int blockDimWallPermID;
|
|
||||||
public static int obeliskID;
|
|
||||||
//public static Block linkDimDoor;
|
|
||||||
public static Block transientDoor;
|
public static Block transientDoor;
|
||||||
public static Block ExitDoor;
|
public static Block ExitDoor;
|
||||||
public static Block chaosDoor;
|
public static Block chaosDoor;
|
||||||
// public static Block linkExitDoor;
|
|
||||||
public static Block blockRift;
|
public static Block blockRift;
|
||||||
public static Block blockLimbo;
|
public static Block blockLimbo;
|
||||||
public static Block dimDoor;
|
public static Block dimDoor;
|
||||||
// public static Block dimRail;
|
|
||||||
|
|
||||||
public static Block blockDimWall;
|
public static Block blockDimWall;
|
||||||
public static Block dimHatch;
|
public static Block dimHatch;
|
||||||
public static Block blockDimWallPerm;
|
public static Block blockDimWallPerm;
|
||||||
public static Item itemRiftBlade;
|
|
||||||
|
|
||||||
|
public static Item itemRiftBlade;
|
||||||
public static Item itemDimDoor;
|
public static Item itemDimDoor;
|
||||||
public static Item itemExitDoor;
|
public static Item itemExitDoor;
|
||||||
public static Item itemRiftRemover;
|
public static Item itemRiftRemover;
|
||||||
@@ -171,97 +126,52 @@ public class mod_pocketDim
|
|||||||
public static Item itemChaosDoor;
|
public static Item itemChaosDoor;
|
||||||
public static Item itemStabilizedLinkSignature;
|
public static Item itemStabilizedLinkSignature;
|
||||||
|
|
||||||
|
|
||||||
public static BiomeGenBase limboBiome;
|
public static BiomeGenBase limboBiome;
|
||||||
public static BiomeGenBase pocketBiome;
|
public static BiomeGenBase pocketBiome;
|
||||||
|
|
||||||
public static int limboBiomeID;
|
public static PlayerRespawnTracker tracker;
|
||||||
public static int pocketBiomeID;
|
|
||||||
|
|
||||||
public static PlayerRespawnTracker tracker= new PlayerRespawnTracker();
|
|
||||||
|
|
||||||
public static HashMap<String,ArrayList<EntityItem>> limboSpawnInventory = new HashMap<String,ArrayList<EntityItem>>();
|
public static HashMap<String,ArrayList<EntityItem>> limboSpawnInventory = new HashMap<String,ArrayList<EntityItem>>();
|
||||||
|
|
||||||
public static ArrayList<Integer> blocksImmuneToRift = new ArrayList<Integer>();
|
public static ArrayList<Integer> blocksImmuneToRift = new ArrayList<Integer>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean riftsInWorldGen;
|
|
||||||
|
|
||||||
public static boolean isLimboActive;
|
|
||||||
|
|
||||||
public static boolean enableIronDimDoor;
|
|
||||||
|
|
||||||
public static boolean enableWoodenDimDoor;
|
|
||||||
|
|
||||||
public static boolean enableRiftSignature;
|
|
||||||
|
|
||||||
public static boolean enableRiftRemover;
|
|
||||||
|
|
||||||
public static boolean enableUnstableDoor;
|
|
||||||
|
|
||||||
public static boolean enableRiftBlade;
|
|
||||||
|
|
||||||
// public static boolean enableDimRail;
|
|
||||||
|
|
||||||
public static boolean enableDimTrapDoor;
|
|
||||||
|
|
||||||
public static boolean enableStabilizedRiftSignature;
|
|
||||||
|
|
||||||
public static boolean enableDoorOpenGL;
|
|
||||||
|
|
||||||
public static boolean hardcoreLimbo;
|
|
||||||
|
|
||||||
public static boolean returnInventory;
|
|
||||||
|
|
||||||
public static boolean hasInitDims = false;
|
public static boolean hasInitDims = false;
|
||||||
|
|
||||||
public static boolean TNFREAKINGT;
|
|
||||||
|
|
||||||
public static boolean isPlayerWearingGoogles = false;
|
public static boolean isPlayerWearingGoogles = false;
|
||||||
|
|
||||||
|
private static DDProperties properties;
|
||||||
|
public static RiftGenerator riftGen;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static RiftGenerator riftGen = new RiftGenerator();
|
|
||||||
|
|
||||||
|
|
||||||
// public static World limbo= null;
|
|
||||||
|
|
||||||
public static long genTime;
|
public static long genTime;
|
||||||
public static boolean enableRiftGrief;
|
public static int teleTimer = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//public Spells spells = null;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PreInit
|
@PreInit
|
||||||
public void PreInit(FMLPreInitializationEvent event)
|
public void PreInit(FMLPreInitializationEvent event)
|
||||||
{
|
{
|
||||||
|
//This should be the FIRST thing that gets done.
|
||||||
|
properties = DDProperties.create(event.getSuggestedConfigurationFile());
|
||||||
|
|
||||||
|
//Now do other stuff
|
||||||
MinecraftForge.EVENT_BUS.register(new EventHookContainer());
|
MinecraftForge.EVENT_BUS.register(new EventHookContainer());
|
||||||
File configFile = event.getSuggestedConfigurationFile();
|
|
||||||
|
|
||||||
Configuration config = new Configuration(configFile);
|
//These fields MUST be initialized after properties are loaded to prevent
|
||||||
|
//instances from holding onto null references to the properties.
|
||||||
|
|
||||||
|
loader = new SchematicLoader();
|
||||||
|
teleporter = new pocketTeleporter();
|
||||||
|
dungeonHelper= new DungeonHelper();
|
||||||
|
|
||||||
DDProperties.loadConfig(configFile);
|
printDimData = new CommandPrintDimData();
|
||||||
|
removeRiftsCommand = new CommandDeleteRifts();
|
||||||
|
pruneDimsCommand = new CommandPruneDims();
|
||||||
|
removeAllLinksCommand = new CommandDeleteAllLinks();
|
||||||
|
deleteDimDataCommand = new CommandDeleteDimData();
|
||||||
|
addDungeonRift = new CommandAddDungeonRift();
|
||||||
|
endDungeonCreation = new CommandEndDungeonCreation();
|
||||||
|
startDungeonCreation = new CommandStartDungeonCreation();
|
||||||
|
tracker = new PlayerRespawnTracker();
|
||||||
|
riftGen = new RiftGenerator();
|
||||||
|
|
||||||
|
File file= new File(properties.CustomSchematicDirectory);
|
||||||
String schematicDir = configFile.getParent()+"/DimDoors_Custom_schematics";
|
|
||||||
this.schematicContainer=schematicDir;
|
|
||||||
File file= new File(schematicDir);
|
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
|
|
||||||
String helpFile = "/mods/DimDoors/How_to_add_dungeons.txt";
|
String helpFile = "/mods/DimDoors/How_to_add_dungeons.txt";
|
||||||
@@ -270,70 +180,44 @@ public class mod_pocketDim
|
|||||||
copyfile.copyFile(helpFile, file+"/How_to_add_dungeons.txt");
|
copyfile.copyFile(helpFile, file+"/How_to_add_dungeons.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
dungeonHelper.importCustomDungeons(schematicDir);
|
dungeonHelper.importCustomDungeons(properties.CustomSchematicDirectory);
|
||||||
dungeonHelper.registerBaseDungeons();
|
dungeonHelper.registerBaseDungeons();
|
||||||
dungeonHelper.registerDungeonTypeTags();
|
dungeonHelper.registerDungeonTypeTags();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Init
|
@Init
|
||||||
public void Init(FMLInitializationEvent event)
|
public void Init(FMLInitializationEvent event)
|
||||||
{
|
{
|
||||||
|
transientDoor = (new TransientDoor(properties.TransientDoorID, Material.iron)).setHardness(1.0F) .setUnlocalizedName("transientDoor");
|
||||||
|
|
||||||
|
blockDimWall = (new BlockDimWall(properties.FabricBlockID, 0, Material.iron)).setLightValue(1.0F).setHardness(0.1F).setUnlocalizedName("blockDimWall");
|
||||||
|
blockDimWallPerm = (new BlockDimWallPerm(properties.PermaFabricBlockID, 0, Material.iron)).setLightValue(1.0F).setBlockUnbreakable().setHardness(100000.0F).setUnlocalizedName("blockDimWallPerm");
|
||||||
|
ExitDoor = (new ExitDoor(properties.WarpDoorID, Material.wood)).setHardness(1.0F) .setUnlocalizedName("dimDoorWarp");
|
||||||
transientDoor = (new TransientDoor(transientDoorID, Material.iron)).setHardness(1.0F) .setUnlocalizedName("transientDoor");
|
blockRift = (new BlockRift(properties.RiftBlockID, 0, Material.air).setHardness(1.0F) .setUnlocalizedName("rift"));
|
||||||
|
blockLimbo = (new BlockLimbo(properties.LimboBlockID, 15, Material.iron).setHardness(.2F).setUnlocalizedName("BlockLimbo").setLightValue(.0F));
|
||||||
// linkDimDoor = (new linkDimDoor(linkDimDoorID, Material.iron)).setHardness(1.0F) .setUnlocalizedName("dimDoorLink");
|
chaosDoor = (new ChaosDoor(properties.UnstableDoorID, Material.iron).setHardness(.2F).setUnlocalizedName("chaosDoor").setLightValue(.0F) );
|
||||||
blockDimWall = (new BlockDimWall(blockDimWallID, 0, Material.iron)).setLightValue(1.0F).setHardness(0.1F).setUnlocalizedName("blockDimWall");
|
dimDoor = (new dimDoor(properties.DimensionalDoorID, Material.iron)).setHardness(1.0F).setResistance(2000.0F) .setUnlocalizedName("dimDoor");
|
||||||
blockDimWallPerm = (new BlockDimWallPerm(blockDimWallPermID, 0, Material.iron)).setLightValue(1.0F).setBlockUnbreakable().setHardness(100000.0F).setUnlocalizedName("blockDimWallPerm");
|
dimHatch = (new dimHatch(properties.TransTrapdoorID, 84, Material.iron)).setHardness(1.0F) .setUnlocalizedName("dimHatch");
|
||||||
ExitDoor = (new ExitDoor(ExitDoorID, Material.wood)).setHardness(1.0F) .setUnlocalizedName("dimDoorWarp");
|
|
||||||
// linkExitDoor = (new linkExitDoor(linkExitDoorID, Material.wood)).setHardness(1.0F) .setUnlocalizedName("dimDoorexitlink");
|
|
||||||
blockRift = (new BlockRift(blockRiftID, 0, Material.air).setHardness(1.0F) .setUnlocalizedName("rift"));
|
|
||||||
blockLimbo = (new BlockLimbo(blockLimboID, 15, Material.iron).setHardness(.2F).setUnlocalizedName("BlockLimbo").setLightValue(.0F));
|
|
||||||
chaosDoor = (new ChaosDoor(chaosDoorID, Material.iron).setHardness(.2F).setUnlocalizedName("chaosDoor").setLightValue(.0F) );
|
|
||||||
dimDoor = (new dimDoor(dimDoorID, Material.iron)).setHardness(1.0F).setResistance(2000.0F) .setUnlocalizedName("dimDoor");
|
|
||||||
dimHatch = (new dimHatch(dimHatchID, 84, Material.iron)).setHardness(1.0F) .setUnlocalizedName("dimHatch");
|
|
||||||
// dimRail = (new DimRail(dimRailID, 88, false)).setHardness(.5F) .setUnlocalizedName("dimRail");
|
// dimRail = (new DimRail(dimRailID, 88, false)).setHardness(.5F) .setUnlocalizedName("dimRail");
|
||||||
|
|
||||||
itemDimDoor = (new itemDimDoor(itemDimDoorID, Material.iron)).setUnlocalizedName("itemDimDoor");
|
itemDimDoor = (new itemDimDoor(properties.DimensionalDoorItemID, Material.iron)).setUnlocalizedName("itemDimDoor");
|
||||||
itemExitDoor = (new itemExitDoor(itemExitDoorID, Material.wood)).setUnlocalizedName("itemDimDoorWarp");
|
itemExitDoor = (new itemExitDoor(properties.WarpDoorItemID, Material.wood)).setUnlocalizedName("itemDimDoorWarp");
|
||||||
itemLinkSignature = (new itemLinkSignature(itemLinkSignatureID )).setUnlocalizedName("itemLinkSignature");
|
itemLinkSignature = (new itemLinkSignature(properties.RiftSignatureItemID)).setUnlocalizedName("itemLinkSignature");
|
||||||
itemRiftRemover = (new itemRiftRemover(itemRiftRemoverID, Material.wood)).setUnlocalizedName("itemRiftRemover");
|
itemRiftRemover = (new itemRiftRemover(properties.RiftRemoverItemID, Material.wood)).setUnlocalizedName("itemRiftRemover");
|
||||||
itemStableFabric = (new ItemStableFabric(itemStableFabricID, 0)).setUnlocalizedName("itemStableFabric");
|
itemStableFabric = (new ItemStableFabric(properties.StableFabricItemID, 0)).setUnlocalizedName("itemStableFabric");
|
||||||
itemChaosDoor = (new ItemChaosDoor(itemChaosDoorID, Material.iron)).setUnlocalizedName("itemChaosDoor");
|
itemChaosDoor = (new ItemChaosDoor(properties.UnstableDoorItemID, Material.iron)).setUnlocalizedName("itemChaosDoor");
|
||||||
itemRiftBlade = (new ItemRiftBlade(itemRiftBladeID, Material.iron)).setUnlocalizedName("ItemRiftBlade");
|
itemRiftBlade = (new ItemRiftBlade(properties.RiftBladeItemID, Material.iron)).setUnlocalizedName("ItemRiftBlade");
|
||||||
itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(itemStabilizedLinkSignatureID)).setUnlocalizedName("itemStabilizedRiftSig");
|
itemStabilizedLinkSignature = (new ItemStabilizedRiftSignature(properties.StabilizedRiftSignatureItemID)).setUnlocalizedName("itemStabilizedRiftSig");
|
||||||
|
|
||||||
this.limboBiome= (new BiomeGenLimbo(this.limboBiomeID) );
|
mod_pocketDim.limboBiome= (new BiomeGenLimbo(properties.LimboBiomeID));
|
||||||
this.pocketBiome= (new BiomeGenPocket(this.pocketBiomeID));
|
mod_pocketDim.pocketBiome= (new BiomeGenPocket(properties.PocketBiomeID));
|
||||||
|
|
||||||
|
GameRegistry.registerWorldGenerator(mod_pocketDim.riftGen);
|
||||||
|
|
||||||
GameRegistry.registerWorldGenerator(this.riftGen);
|
|
||||||
|
|
||||||
//GameRegistry.registerBlock(dimRail, "Dimensional Rail");
|
|
||||||
GameRegistry.registerBlock(chaosDoor, "Unstable Door");
|
GameRegistry.registerBlock(chaosDoor, "Unstable Door");
|
||||||
GameRegistry.registerBlock(ExitDoor, "Warp Door");
|
GameRegistry.registerBlock(ExitDoor, "Warp Door");
|
||||||
//GameRegistry.registerBlock(linkExitDoor, "Warp Door link");
|
|
||||||
GameRegistry.registerBlock(blockRift, "Rift");
|
GameRegistry.registerBlock(blockRift, "Rift");
|
||||||
GameRegistry.registerBlock(blockLimbo, "Unraveled Fabric");
|
GameRegistry.registerBlock(blockLimbo, "Unraveled Fabric");
|
||||||
//GameRegistry.registerBlock(linkDimDoor, "Dimensional Door link");
|
|
||||||
GameRegistry.registerBlock(dimDoor, "Dimensional Door");
|
GameRegistry.registerBlock(dimDoor, "Dimensional Door");
|
||||||
GameRegistry.registerBlock(dimHatch,"Transdimensional Trapdoor");
|
GameRegistry.registerBlock(dimHatch,"Transdimensional Trapdoor");
|
||||||
GameRegistry.registerBlock(blockDimWall, "Fabric of Reality");
|
GameRegistry.registerBlock(blockDimWall, "Fabric of Reality");
|
||||||
@@ -342,22 +226,15 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
GameRegistry.registerPlayerTracker(tracker);
|
GameRegistry.registerPlayerTracker(tracker);
|
||||||
|
|
||||||
|
DimensionManager.registerProviderType(properties.PocketProviderID, pocketProvider.class, false);
|
||||||
|
DimensionManager.registerProviderType(properties.LimboProviderID, LimboProvider.class, false);
|
||||||
DimensionManager.registerProviderType(this.providerID, pocketProvider.class, false);
|
DimensionManager.registerDimension(properties.LimboDimensionID, properties.LimboProviderID);
|
||||||
DimensionManager.registerProviderType(this.limboProviderID, LimboProvider.class, false);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DimensionManager.registerDimension(this.limboDimID , this.limboProviderID);
|
|
||||||
|
|
||||||
LanguageRegistry.addName(transientDoor , "transientDoor");
|
LanguageRegistry.addName(transientDoor , "transientDoor");
|
||||||
|
|
||||||
LanguageRegistry.addName(blockRift , "Rift");
|
LanguageRegistry.addName(blockRift , "Rift");
|
||||||
LanguageRegistry.addName(blockLimbo , "Unraveled Fabric");
|
LanguageRegistry.addName(blockLimbo , "Unraveled Fabric");
|
||||||
LanguageRegistry.addName(ExitDoor , "Warp Door");
|
LanguageRegistry.addName(ExitDoor , "Warp Door");
|
||||||
LanguageRegistry.addName(chaosDoor , "Unstable Door");
|
LanguageRegistry.addName(chaosDoor , "Unstable Door");
|
||||||
//LanguageRegistry.addName(linkDimDoor, "Dimensional Door");
|
|
||||||
LanguageRegistry.addName(blockDimWall , "Fabric of Reality");
|
LanguageRegistry.addName(blockDimWall , "Fabric of Reality");
|
||||||
LanguageRegistry.addName(blockDimWallPerm , "Fabric of Reality");
|
LanguageRegistry.addName(blockDimWallPerm , "Fabric of Reality");
|
||||||
LanguageRegistry.addName(dimDoor, "Dimensional Door");
|
LanguageRegistry.addName(dimDoor, "Dimensional Door");
|
||||||
@@ -381,17 +258,15 @@ public class mod_pocketDim
|
|||||||
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
|
GameRegistry.registerTileEntity(TileEntityDimDoor.class, "TileEntityDimDoor");
|
||||||
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
|
GameRegistry.registerTileEntity(TileEntityRift.class, "TileEntityRift");
|
||||||
|
|
||||||
EntityRegistry.registerModEntity(MobObelisk.class, "Obelisk", this.obeliskID, this,70, 1, true);
|
EntityRegistry.registerModEntity(MobObelisk.class, "Monolith", properties.MonolithEntityID, this, 70, 1, true);
|
||||||
EntityList.IDtoClassMapping.put(this.obeliskID, MobObelisk.class);
|
EntityList.IDtoClassMapping.put(properties.MonolithEntityID, MobObelisk.class);
|
||||||
EntityList.entityEggs.put(this.obeliskID, new EntityEggInfo(this.obeliskID, 0, 0xffffff));
|
EntityList.entityEggs.put(properties.MonolithEntityID, new EntityEggInfo(properties.MonolithEntityID, 0, 0xffffff));
|
||||||
LanguageRegistry.instance().addStringLocalization("entity.DimDoors.Obelisk.name", "Monolith");
|
LanguageRegistry.instance().addStringLocalization("entity.DimDoors.Obelisk.name", "Monolith");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//GameRegistry.addBiome(this.limboBiome);
|
//GameRegistry.addBiome(this.limboBiome);
|
||||||
//GameRegistry.addBiome(this.pocketBiome);
|
//GameRegistry.addBiome(this.pocketBiome);
|
||||||
|
|
||||||
if(this.enableIronDimDoor)
|
if (properties.CraftingDimensionaDoorAllowed)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
|
||||||
{
|
{
|
||||||
@@ -400,7 +275,7 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemDimDoor, 1), new Object[]
|
||||||
{
|
{
|
||||||
" ", "yxy", " ", 'x', this.itemStableFabric, 'y', Item.doorIron
|
" ", "yxy", " ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.doorIron
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,14 +294,14 @@ public class mod_pocketDim
|
|||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
|
|
||||||
if(this.enableUnstableDoor)
|
if(properties.CraftingUnstableDoorAllowed)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(itemChaosDoor, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemChaosDoor, 1), new Object[]
|
||||||
{
|
{
|
||||||
" ", "yxy", " ", 'x', Item.eyeOfEnder, 'y', this.itemDimDoor
|
" ", "yxy", " ", 'x', Item.eyeOfEnder, 'y', mod_pocketDim.itemDimDoor
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(this.enableWoodenDimDoor)
|
if(properties.CraftingWarpDoorAllowed)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
|
||||||
{
|
{
|
||||||
@@ -435,10 +310,10 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemExitDoor, 1), new Object[]
|
||||||
{
|
{
|
||||||
" ", "yxy", " ", 'x', this.itemStableFabric, 'y', Item.doorWood
|
" ", "yxy", " ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.doorWood
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(this.enableDimTrapDoor)
|
if(properties.CraftingTransTrapdoorAllowed)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
|
||||||
{
|
{
|
||||||
@@ -447,10 +322,10 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(dimHatch, 1), new Object[]
|
||||||
{
|
{
|
||||||
" y ", " x ", " y ", 'x', this.itemStableFabric, 'y', Block.trapdoor
|
" y ", " x ", " y ", 'x', mod_pocketDim.itemStableFabric, 'y', Block.trapdoor
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(this.enableRiftSignature)
|
if(properties.CraftingRiftSignatureAllowed)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
|
||||||
{
|
{
|
||||||
@@ -459,10 +334,11 @@ public class mod_pocketDim
|
|||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemLinkSignature, 1), new Object[]
|
||||||
{
|
{
|
||||||
" y ", "yxy", " y ", 'x', this.itemStableFabric, 'y', Item.ingotIron
|
" y ", "yxy", " y ", 'x', mod_pocketDim.itemStableFabric, 'y', Item.ingotIron
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(this.enableRiftRemover)
|
|
||||||
|
if(properties.CraftingRiftRemoverAllowed)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
|
||||||
{
|
{
|
||||||
@@ -470,78 +346,54 @@ public class mod_pocketDim
|
|||||||
});
|
});
|
||||||
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemRiftRemover, 1), new Object[]
|
||||||
{
|
{
|
||||||
"yyy", "yxy", "yyy", 'x', this.itemStableFabric, 'y', Item.ingotGold
|
"yyy", "yxy", "yyy", 'x', mod_pocketDim.itemStableFabric, 'y', Item.ingotGold
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (properties.CraftingRiftBladeAllowed)
|
||||||
|
|
||||||
|
|
||||||
if(this.enableRiftBlade)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemRiftBlade, 1), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemRiftBlade, 1), new Object[]
|
||||||
{
|
{
|
||||||
" x ", " x ", " y ", 'x', Item.enderPearl, 'y',this.itemRiftRemover
|
" x ", " x ", " y ", 'x', Item.enderPearl, 'y',mod_pocketDim.itemRiftRemover
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (properties.CraftingStableFabricAllowed)
|
||||||
|
{
|
||||||
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
|
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
|
||||||
{
|
{
|
||||||
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', this.blockDimWall
|
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', mod_pocketDim.blockDimWall
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', this.blockLimbo
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.enableStabilizedRiftSignature)
|
|
||||||
{
|
|
||||||
GameRegistry.addRecipe(new ItemStack(this.itemStabilizedLinkSignature,1), new Object[]
|
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', this.itemLinkSignature, 'y', this.itemStableFabric
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.blocksImmuneToRift.add(this.blockDimWallID);
|
if (properties.CraftingStabilizedRiftSignatureAllowed)
|
||||||
this.blocksImmuneToRift.add(this.blockDimWallPermID);
|
{
|
||||||
this.blocksImmuneToRift.add(this.dimDoorID);
|
GameRegistry.addRecipe(new ItemStack(mod_pocketDim.itemStabilizedLinkSignature,1), new Object[]
|
||||||
this.blocksImmuneToRift.add(this.ExitDoorID);
|
{
|
||||||
// this.blocksImmuneToRift.add(this.linkDimDoorID);
|
" y ", "yxy", " y ", 'x', mod_pocketDim.itemLinkSignature, 'y', mod_pocketDim.itemStableFabric
|
||||||
// this.blocksImmuneToRift.add(this.linkExitDoorID);
|
});
|
||||||
this.blocksImmuneToRift.add(this.dimHatchID);
|
}
|
||||||
this.blocksImmuneToRift.add(this.chaosDoorID);
|
|
||||||
this.blocksImmuneToRift.add(this.blockRiftID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.FabricBlockID);
|
||||||
this.blocksImmuneToRift.add(this.transientDoorID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.PermaFabricBlockID);
|
||||||
this.blocksImmuneToRift.add(Block.blockIron.blockID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.DimensionalDoorID);
|
||||||
this.blocksImmuneToRift.add(Block.blockDiamond.blockID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.WarpDoorID);
|
||||||
this.blocksImmuneToRift.add(Block.blockEmerald.blockID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.TransTrapdoorID);
|
||||||
this.blocksImmuneToRift.add(Block.blockGold.blockID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.UnstableDoorID);
|
||||||
this.blocksImmuneToRift.add(Block.blockLapis.blockID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.RiftBlockID);
|
||||||
this.blocksImmuneToRift.add(Block.bedrock.blockID);
|
mod_pocketDim.blocksImmuneToRift.add(properties.TransientDoorID);
|
||||||
|
mod_pocketDim.blocksImmuneToRift.add(Block.blockIron.blockID);
|
||||||
|
mod_pocketDim.blocksImmuneToRift.add(Block.blockDiamond.blockID);
|
||||||
|
mod_pocketDim.blocksImmuneToRift.add(Block.blockEmerald.blockID);
|
||||||
|
mod_pocketDim.blocksImmuneToRift.add(Block.blockGold.blockID);
|
||||||
|
mod_pocketDim.blocksImmuneToRift.add(Block.blockLapis.blockID);
|
||||||
|
mod_pocketDim.blocksImmuneToRift.add(Block.bedrock.blockID);
|
||||||
|
|
||||||
dungeonHelper.registerFlipBlocks();
|
dungeonHelper.registerFlipBlocks();
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
proxy.loadTextures();
|
proxy.loadTextures();
|
||||||
proxy.registerRenderers();
|
proxy.registerRenderers();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -555,13 +407,12 @@ public class mod_pocketDim
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
dimHelper.instance.save();
|
dimHelper.instance.save();
|
||||||
dimHelper.instance.unregsisterDims();
|
dimHelper.instance.unregsisterDims();
|
||||||
dimHelper.dimList.clear();
|
dimHelper.dimList.clear();
|
||||||
dimHelper.blocksToDecay.clear();
|
dimHelper.blocksToDecay.clear();
|
||||||
dimHelper.instance.interDimLinkList.clear();
|
dimHelper.instance.interDimLinkList.clear();
|
||||||
this.hasInitDims=false;
|
mod_pocketDim.hasInitDims=false;
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
@@ -573,27 +424,21 @@ public class mod_pocketDim
|
|||||||
@ServerStarting
|
@ServerStarting
|
||||||
public void serverStarting(FMLServerStartingEvent event)
|
public void serverStarting(FMLServerStartingEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
event.registerServerCommand(removeRiftsCommand);
|
event.registerServerCommand(removeRiftsCommand);
|
||||||
event.registerServerCommand(pruneDimsCommand);
|
event.registerServerCommand(pruneDimsCommand);
|
||||||
event.registerServerCommand(removeAllLinksCommand);
|
event.registerServerCommand(removeAllLinksCommand);
|
||||||
event.registerServerCommand(deleteDimDataCommand);
|
event.registerServerCommand(deleteDimDataCommand);
|
||||||
event.registerServerCommand(addDungeonRift);
|
event.registerServerCommand(addDungeonRift);
|
||||||
event.registerServerCommand(this.startDungeonCreation);
|
event.registerServerCommand(mod_pocketDim.startDungeonCreation);
|
||||||
event.registerServerCommand(this.printDimData);
|
event.registerServerCommand(mod_pocketDim.printDimData);
|
||||||
event.registerServerCommand(this.endDungeonCreation);
|
event.registerServerCommand(mod_pocketDim.endDungeonCreation);
|
||||||
|
|
||||||
dimHelper.instance.load();
|
dimHelper.instance.load();
|
||||||
if(!dimHelper.dimList.containsKey(this.limboDimID))
|
if(!dimHelper.dimList.containsKey(properties.LimboDimensionID))
|
||||||
{
|
{
|
||||||
dimHelper.instance.dimList.put(mod_pocketDim.limboDimID, new DimData( mod_pocketDim.limboDimID, false, 0, new LinkData()));
|
dimHelper.dimList.put(properties.LimboDimensionID, new DimData( properties.LimboDimensionID, false, 0, new LinkData()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int teleTimer=0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
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;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
@@ -36,9 +37,9 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
int destX=0;
|
int destX=0;
|
||||||
int destY=0;
|
int destY=0;
|
||||||
int destZ=0;
|
int destZ=0;
|
||||||
|
|
||||||
public MobObelisk(World par1World)
|
public MobObelisk(World par1World)
|
||||||
{
|
{
|
||||||
|
|
||||||
super(par1World);
|
super(par1World);
|
||||||
this.texture="/mods/DimDoors/textures/mobs/Monolith0.png";
|
this.texture="/mods/DimDoors/textures/mobs/Monolith0.png";
|
||||||
this.setSize(3F, 9.0F);
|
this.setSize(3F, 9.0F);
|
||||||
@@ -46,11 +47,12 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
this.scaleFactor= (float) ((rand.nextDouble()/2)+1);
|
this.scaleFactor= (float) ((rand.nextDouble()/2)+1);
|
||||||
this.aggroMax=rand.nextInt(245)+200;
|
this.aggroMax=rand.nextInt(245)+200;
|
||||||
|
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDespawn()
|
public boolean canDespawn()
|
||||||
{
|
{
|
||||||
@@ -86,15 +88,8 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
{
|
{
|
||||||
super.entityInit();
|
super.entityInit();
|
||||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityUpdate()
|
public void onEntityUpdate()
|
||||||
{
|
{
|
||||||
@@ -196,7 +191,7 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinkData link = new LinkData(this.worldObj.provider.dimensionId, mod_pocketDim.limboDimID, (int)this.posX, (int)this.posY, (int)this.posZ, (int)this.posX+rand.nextInt(500)-250, (int)this.posY+500, (int)this.posZ+rand.nextInt(500)-250, false,0);
|
LinkData link = new LinkData(this.worldObj.provider.dimensionId, properties.LimboDimensionID, (int)this.posX, (int)this.posY, (int)this.posZ, (int)this.posX+rand.nextInt(500)-250, (int)this.posY+500, (int)this.posZ+rand.nextInt(500)-250, false,0);
|
||||||
|
|
||||||
dimHelper.instance.teleportToPocket(worldObj, link, entityPlayer);
|
dimHelper.instance.teleportToPocket(worldObj, link, entityPlayer);
|
||||||
this.aggro=0;
|
this.aggro=0;
|
||||||
@@ -306,7 +301,7 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
{
|
{
|
||||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15));
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this,AxisAlignedBB.getBoundingBox( this.posX-15, posY-4, this.posZ-15, this.posX+15, this.posY+15, this.posZ+15));
|
||||||
|
|
||||||
if(list.size()>0&&this.worldObj.provider.dimensionId==mod_pocketDim.limboDimID)
|
if(list.size()>0&&this.worldObj.provider.dimensionId==properties.LimboDimensionID)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,22 @@ package StevenDimDoors.mod_pocketDim.world;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.MapGenBase;
|
import net.minecraft.world.gen.MapGenBase;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
|
|
||||||
public class CustomCaveGen extends MapGenBase
|
public class CustomCaveGen extends MapGenBase
|
||||||
{
|
{
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
public CustomCaveGen()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a larger initial cave node than usual. Called 25% of the time.
|
* Generates a larger initial cave node than usual. Called 25% of the time.
|
||||||
*/
|
*/
|
||||||
@@ -185,7 +192,7 @@ public class CustomCaveGen extends MapGenBase
|
|||||||
var49 = true;
|
var49 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var53 == mod_pocketDim.blockLimboID|| var53 == Block.dirt.blockID || var53 == Block.grass.blockID)
|
if (var53 == properties.LimboBlockID || var53 == Block.dirt.blockID || var53 == Block.grass.blockID)
|
||||||
{
|
{
|
||||||
if (var50 < 10)
|
if (var50 < 10)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package StevenDimDoors.mod_pocketDim.world;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@@ -28,7 +29,7 @@ import net.minecraftforge.event.terraingen.ChunkProviderEvent;
|
|||||||
|
|
||||||
public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvider
|
public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvider
|
||||||
{
|
{
|
||||||
private Random rand;
|
private static Random rand;
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
/** A NoiseGeneratorOctaves used in generating terrain */
|
||||||
private NoiseGeneratorOctaves noiseGen1;
|
private NoiseGeneratorOctaves noiseGen1;
|
||||||
@@ -102,15 +103,12 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
int[][] field_73219_j = new int[32][32];
|
int[][] field_73219_j = new int[32][32];
|
||||||
{
|
{
|
||||||
// caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);
|
// caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public LimboGenerator(World par1World, long par2)
|
public LimboGenerator(World par1World, long par2)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
super(par1World, par2, false);
|
super(par1World, par2, false);
|
||||||
//par2 = 90899090;
|
//par2 = 90899090;
|
||||||
this.rand = new Random(par2);
|
this.rand = new Random(par2);
|
||||||
@@ -133,6 +131,9 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
this.mobSpawnerNoise = noiseGens[6];
|
this.mobSpawnerNoise = noiseGens[6];
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
this.worldObj=par1World;
|
this.worldObj=par1World;
|
||||||
|
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -376,11 +377,11 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
{
|
{
|
||||||
if ((var47 += var49) > 0.0D)
|
if ((var47 += var49) > 0.0D)
|
||||||
{
|
{
|
||||||
par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockLimboID;
|
par3ArrayOfByte[var43 += var44] = (byte)properties.LimboBlockID;
|
||||||
}
|
}
|
||||||
else if (var12 * 8 + var31 < var6)
|
else if (var12 * 8 + var31 < var6)
|
||||||
{
|
{
|
||||||
par3ArrayOfByte[var43 += var44] = (byte)mod_pocketDim.blockDimWallPermID;
|
par3ArrayOfByte[var43 += var44] = (byte)properties.PermaFabricBlockID;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.world;
|
package StevenDimDoors.mod_pocketDim.world;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.util.ChunkCoordinates;
|
import net.minecraft.util.ChunkCoordinates;
|
||||||
@@ -10,31 +8,29 @@ import net.minecraft.world.WorldProvider;
|
|||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
import net.minecraft.world.biome.WorldChunkManagerHell;
|
import net.minecraft.world.biome.WorldChunkManagerHell;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.storage.WorldInfo;
|
|
||||||
import net.minecraftforge.client.IRenderHandler;
|
import net.minecraftforge.client.IRenderHandler;
|
||||||
|
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
|
||||||
public class LimboProvider extends WorldProvider
|
public class LimboProvider extends WorldProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDimensionName() {
|
public String getDimensionName() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return "Limbo";
|
return "Limbo";
|
||||||
}
|
}
|
||||||
|
|
||||||
private IRenderHandler skyRenderer;
|
private IRenderHandler skyRenderer;
|
||||||
|
private DDProperties properties = null;
|
||||||
|
|
||||||
public LimboProvider()
|
public LimboProvider()
|
||||||
{
|
{
|
||||||
this.hasNoSky = false;
|
this.hasNoSky = false;
|
||||||
|
|
||||||
|
|
||||||
this.skyRenderer = new limboSkyProvider();
|
this.skyRenderer = new limboSkyProvider();
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@@ -59,9 +55,9 @@ public class LimboProvider extends WorldProvider
|
|||||||
|
|
||||||
public boolean canRespawnHere()
|
public boolean canRespawnHere()
|
||||||
{
|
{
|
||||||
|
return properties.HardcoreLimboEnabled && properties.LimboEnabled;
|
||||||
return mod_pocketDim.hardcoreLimbo&&mod_pocketDim.isLimboActive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBlockHighHumidity(int x, int y, int z)
|
public boolean isBlockHighHumidity(int x, int y, int z)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -73,6 +69,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void generateLightBrightnessTable()
|
protected void generateLightBrightnessTable()
|
||||||
{
|
{
|
||||||
@@ -129,7 +126,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
public boolean canCoordinateBeSpawn(int par1, int par2)
|
public boolean canCoordinateBeSpawn(int par1, int par2)
|
||||||
{
|
{
|
||||||
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
||||||
return var3 == mod_pocketDim.blockLimboID;
|
return var3 == properties.LimboBlockID;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public double getHorizon()
|
public double getHorizon()
|
||||||
@@ -159,6 +156,7 @@ public class LimboProvider extends WorldProvider
|
|||||||
{
|
{
|
||||||
return new LimboGenerator(worldObj, 45);
|
return new LimboGenerator(worldObj, 45);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -180,12 +178,5 @@ public class LimboProvider extends WorldProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
return var5;
|
return var5;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.world;
|
package StevenDimDoors.mod_pocketDim.world;
|
||||||
|
|
||||||
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -24,11 +25,13 @@ public class pocketProvider extends WorldProvider
|
|||||||
|
|
||||||
public boolean isSavingSchematic= false;
|
public boolean isSavingSchematic= false;
|
||||||
public int dimToSave;
|
public int dimToSave;
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
public pocketProvider()
|
public pocketProvider()
|
||||||
{
|
{
|
||||||
this.hasNoSky=true;
|
this.hasNoSky=true;
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -89,7 +92,6 @@ public class pocketProvider extends WorldProvider
|
|||||||
@Override
|
@Override
|
||||||
public String getDimensionName()
|
public String getDimensionName()
|
||||||
{
|
{
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return "PocketDim " + this.dimensionId;
|
return "PocketDim " + this.dimensionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,9 +100,9 @@ public class pocketProvider extends WorldProvider
|
|||||||
{
|
{
|
||||||
int respawnDim;
|
int respawnDim;
|
||||||
|
|
||||||
if(mod_pocketDim.isLimboActive)
|
if (properties.LimboEnabled)
|
||||||
{
|
{
|
||||||
respawnDim= mod_pocketDim.limboDimID;
|
respawnDim = properties.LimboDimensionID;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ import cpw.mods.fml.common.network.Player;
|
|||||||
// This just handles the data packets in the server
|
// This just handles the data packets in the server
|
||||||
public class ClientPacketHandler implements IPacketHandler{
|
public class ClientPacketHandler implements IPacketHandler{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPacketData(INetworkManager manager,
|
public void onPacketData(INetworkManager manager,
|
||||||
Packet250CustomPayload packet, Player player) {
|
Packet250CustomPayload packet, Player player) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.dimDoor;
|
import StevenDimDoors.mod_pocketDim.blocks.dimDoor;
|
||||||
@@ -24,6 +25,14 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
{
|
{
|
||||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||||
|
|
||||||
|
public RenderDimDoor()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the dimdoor.
|
* Renders the dimdoor.
|
||||||
*/
|
*/
|
||||||
@@ -31,7 +40,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
dimDoor.class.cast(Block.blocksList[properties.DimensionalDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
@@ -268,7 +277,7 @@ public class RenderDimDoor extends TileEntitySpecialRenderer
|
|||||||
|
|
||||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||||
{
|
{
|
||||||
if(mod_pocketDim.enableDoorOpenGL)
|
if (properties.DoorRenderingEnabled)
|
||||||
{
|
{
|
||||||
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
import StevenDimDoors.mod_pocketDim.TileEntityDimDoor;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.blocks.dimDoor;
|
import StevenDimDoors.mod_pocketDim.blocks.dimDoor;
|
||||||
@@ -24,6 +25,14 @@ public class RenderDimRail extends TileEntitySpecialRenderer
|
|||||||
{
|
{
|
||||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||||
|
|
||||||
|
public RenderDimRail()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the dimdoor.
|
* Renders the dimdoor.
|
||||||
*/
|
*/
|
||||||
@@ -31,7 +40,7 @@ public class RenderDimRail extends TileEntitySpecialRenderer
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dimDoor.class.cast(Block.blocksList[mod_pocketDim.dimDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
dimDoor.class.cast(Block.blocksList[properties.DimensionalDoorID]).updateAttatchedTile(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord).getFullMetadata(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
@@ -266,7 +275,7 @@ public class RenderDimRail extends TileEntitySpecialRenderer
|
|||||||
|
|
||||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||||
{
|
{
|
||||||
if(mod_pocketDim.enableDoorOpenGL)
|
if (properties.DoorRenderingEnabled)
|
||||||
{
|
{
|
||||||
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
this.renderDimDoorTileEntity((TileEntityDimDoor)par1TileEntity, par2, par4, par6, par8);
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
schematics/fallingTNThall.schematic
Normal file
BIN
schematics/fallingTNThall.schematic
Normal file
Binary file not shown.
BIN
schematics/tntPuzzleTrap.schematic
Normal file
BIN
schematics/tntPuzzleTrap.schematic
Normal file
Binary file not shown.
Reference in New Issue
Block a user