Overhauled configuration #16
@@ -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,177 +12,179 @@ 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
|
||||||
|
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||||
|
{
|
||||||
|
if (type.equals(EnumSet.of(TickType.SERVER)))
|
||||||
|
{
|
||||||
|
onTickInGame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
||||||
|
{
|
||||||
|
if (type.equals(EnumSet.of(TickType.SERVER)))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumSet ticks()
|
||||||
|
{
|
||||||
|
return EnumSet.of(TickType.SERVER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//replaces rifts in game that have been destroyed/have blocks placed over them.
|
||||||
|
private void onTickInGame()
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
if(tickCount>100)
|
||||||
|
{
|
||||||
|
tickCount=0;
|
||||||
|
int i=0;
|
||||||
|
|
||||||
|
|
||||||
|
while (i<15&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
LinkData link;
|
||||||
|
|
||||||
|
//actually gets the random rift based on the size of the list
|
||||||
|
link = (LinkData) dimHelper.instance.getRandomLinkData(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(link!=null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(dimHelper.getWorld(link.locDimID)!=null)
|
||||||
|
{
|
||||||
|
World world=dimHelper.getWorld(link.locDimID);
|
||||||
|
|
||||||
|
int blocktoReplace = world.getBlockId(link.locXCoord, link.locYCoord, link.locZCoord);
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
tickCount++;
|
||||||
|
System.out.println("something on tick went wrong");
|
||||||
|
}
|
||||||
|
tickCount++;
|
||||||
|
|
||||||
|
//this section regulates decay in Limbo- it records any blocks placed by the player and later progresss them through the decay cycle
|
||||||
|
if(tickCount2>10&&dimHelper.blocksToDecay!=null)
|
||||||
|
{
|
||||||
|
tickCount2=0;
|
||||||
|
if(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(properties.LimboDimensionID)!=null)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if(dimHelper.blocksToDecay.size()>rand.nextInt(400))
|
||||||
|
{
|
||||||
|
int index = rand.nextInt(dimHelper.blocksToDecay.size());
|
||||||
|
Point3D point = (Point3D) dimHelper.blocksToDecay.get(index);
|
||||||
|
|
||||||
|
int blockID = dimHelper.getWorld(properties.LimboDimensionID).getBlockId(point.getX(), point.getY(), point.getZ());
|
||||||
|
int idToSet=Block.stone.blockID;
|
||||||
|
|
||||||
|
if(blockID==0||blockID==properties.LimboBlockID)
|
||||||
|
{
|
||||||
|
dimHelper.blocksToDecay.remove(index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(Block.blocksList[idToSet] instanceof BlockContainer)
|
||||||
|
{
|
||||||
|
idToSet=-1;
|
||||||
|
dimHelper.blocksToDecay.remove(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(blockID==Block.cobblestone.blockID)
|
||||||
|
{
|
||||||
|
idToSet=Block.gravel.blockID;
|
||||||
|
}
|
||||||
|
if(blockID==Block.stone.blockID)
|
||||||
|
{
|
||||||
|
idToSet=Block.cobblestone.blockID;
|
||||||
|
|
||||||
|
}
|
||||||
|
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(properties.LimboDimensionID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
|
||||||
|
{
|
||||||
|
idToSet=properties.LimboBlockID;
|
||||||
|
dimHelper.getWorld(properties.LimboDimensionID).scheduleBlockUpdate(point.getX(), point.getY(), point.getZ(),10, idToSet);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(blockID==Block.gravel.blockID)
|
||||||
|
{
|
||||||
|
dimHelper.blocksToDecay.remove(index);
|
||||||
|
idToSet=-1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(idToSet!=-1)
|
||||||
|
{
|
||||||
|
|
||||||
|
dimHelper.getWorld(properties.LimboDimensionID).setBlock(point.getX(), point.getY(), point.getZ(), idToSet);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tickCount2++;
|
||||||
|
|
||||||
|
if(mod_pocketDim.teleTimer>0)
|
||||||
|
{
|
||||||
|
mod_pocketDim.teleTimer--;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
|
||||||
{
|
|
||||||
if (type.equals(EnumSet.of(TickType.SERVER)))
|
|
||||||
{
|
|
||||||
onTickInGame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
|
||||||
{
|
|
||||||
if (type.equals(EnumSet.of(TickType.SERVER)))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumSet ticks()
|
|
||||||
{
|
|
||||||
return EnumSet.of(TickType.SERVER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//replaces rifts in game that have been destroyed/have blocks placed over them.
|
|
||||||
private void onTickInGame()
|
|
||||||
{
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
if(tickCount>100)
|
|
||||||
{
|
|
||||||
tickCount=0;
|
|
||||||
int i=0;
|
|
||||||
|
|
||||||
|
|
||||||
while (i<15&&FMLCommonHandler.instance().getEffectiveSide()==Side.SERVER)
|
|
||||||
{
|
|
||||||
i++;
|
|
||||||
LinkData link;
|
|
||||||
|
|
||||||
//actually gets the random rift based on the size of the list
|
|
||||||
link = (LinkData) dimHelper.instance.getRandomLinkData(true);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(link!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(link.locDimID)!=null)
|
|
||||||
{
|
|
||||||
World world=dimHelper.getWorld(link.locDimID);
|
|
||||||
|
|
||||||
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(dimHelper.instance.getLinkDataFromCoords(link.locXCoord, link.locYCoord, link.locZCoord, link.locDimID)==null)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dimHelper.getWorld(link.locDimID).setBlock(link.locXCoord, link.locYCoord, link.locZCoord, mod_pocketDim.blockRiftID);
|
|
||||||
TileEntityRift.class.cast(dimHelper.getWorld(link.locDimID).getBlockTileEntity(link.locXCoord, link.locYCoord, link.locZCoord)).hasGrownRifts=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
tickCount++;
|
|
||||||
System.out.println("something on tick went wrong");
|
|
||||||
}
|
|
||||||
tickCount++;
|
|
||||||
|
|
||||||
//this section regulates decay in Limbo- it records any blocks placed by the player and later progresss them through the decay cycle
|
|
||||||
if(tickCount2>10&&dimHelper.blocksToDecay!=null)
|
|
||||||
{
|
|
||||||
tickCount2=0;
|
|
||||||
if(!dimHelper.blocksToDecay.isEmpty()&&dimHelper.getWorld(mod_pocketDim.limboDimID)!=null)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.blocksToDecay.size()>rand.nextInt(400))
|
|
||||||
{
|
|
||||||
int index = rand.nextInt(dimHelper.blocksToDecay.size());
|
|
||||||
Point3D point = (Point3D) dimHelper.blocksToDecay.get(index);
|
|
||||||
|
|
||||||
int blockID = dimHelper.getWorld(mod_pocketDim.limboDimID).getBlockId(point.getX(), point.getY(), point.getZ());
|
|
||||||
int idToSet=Block.stone.blockID;
|
|
||||||
|
|
||||||
if(blockID==0||blockID==mod_pocketDim.blockLimboID)
|
|
||||||
{
|
|
||||||
dimHelper.blocksToDecay.remove(index);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(Block.blocksList[idToSet] instanceof BlockContainer)
|
|
||||||
{
|
|
||||||
idToSet=-1;
|
|
||||||
dimHelper.blocksToDecay.remove(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(blockID==Block.cobblestone.blockID)
|
|
||||||
{
|
|
||||||
idToSet=Block.gravel.blockID;
|
|
||||||
}
|
|
||||||
if(blockID==Block.stone.blockID)
|
|
||||||
{
|
|
||||||
idToSet=Block.cobblestone.blockID;
|
|
||||||
|
|
||||||
}
|
|
||||||
if(blockID==Block.gravel.blockID&&!dimHelper.getWorld(mod_pocketDim.limboDimID).isAirBlock(point.getX(), point.getY()-1, point.getZ()))
|
|
||||||
{
|
|
||||||
idToSet=mod_pocketDim.blockLimboID;
|
|
||||||
dimHelper.getWorld(mod_pocketDim.limboDimID).scheduleBlockUpdate(point.getX(), point.getY(), point.getZ(),10, idToSet);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(blockID==Block.gravel.blockID)
|
|
||||||
{
|
|
||||||
dimHelper.blocksToDecay.remove(index);
|
|
||||||
idToSet=-1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(idToSet!=-1)
|
|
||||||
{
|
|
||||||
|
|
||||||
dimHelper.getWorld(mod_pocketDim.limboDimID).setBlock(point.getX(), point.getY(), point.getZ(), idToSet);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tickCount2++;
|
|
||||||
|
|
||||||
if(mod_pocketDim.teleTimer>0)
|
|
||||||
{
|
|
||||||
mod_pocketDim.teleTimer--;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
204
StevenDimDoors/mod_pocketDim/DDProperties.java
Normal file
204
StevenDimDoors/mod_pocketDim/DDProperties.java
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
package StevenDimDoors.mod_pocketDim;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.Configuration;
|
||||||
|
|
||||||
|
public class DDProperties
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Block IDs
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final int UnstableDoorID;
|
||||||
|
public final int DimensionalDoorID;
|
||||||
|
public final int WarpDoorID;
|
||||||
|
public final int TransTrapdoorID;
|
||||||
|
public final int TransientDoorID;
|
||||||
|
public final int FabricBlockID;
|
||||||
|
public final int RiftBlockID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* World Generation Block IDs
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final int LimboBlockID;
|
||||||
|
public final int PermaFabricBlockID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item IDs
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final int RiftBladeItemID;
|
||||||
|
public final int RiftSignatureItemID;
|
||||||
|
public final int RiftRemoverItemID;
|
||||||
|
public final int StableFabricItemID;
|
||||||
|
public final int StabilizedRiftSignatureItemID;
|
||||||
|
public final int DimensionalDoorItemID;
|
||||||
|
public final int UnstableDoorItemID;
|
||||||
|
public final int WarpDoorItemID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Other IDs
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final int LimboBiomeID;
|
||||||
|
public final int PocketBiomeID;
|
||||||
|
public final int LimboDimensionID;
|
||||||
|
public final int LimboProviderID;
|
||||||
|
public final int PocketProviderID;
|
||||||
|
public final int DoorRenderEntityID;
|
||||||
|
public final int MonolithEntityID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Crafting Flags
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final boolean CraftingDimensionaDoorAllowed;
|
||||||
|
public final boolean CraftingWarpDoorAllowed;
|
||||||
|
public final boolean CraftingRiftSignatureAllowed;
|
||||||
|
public final boolean CraftingRiftRemoverAllowed;
|
||||||
|
public final boolean CraftingUnstableDoorAllowed;
|
||||||
|
public final boolean CraftingRiftBladeAllowed;
|
||||||
|
public final boolean CraftingTransTrapdoorAllowed;
|
||||||
|
public final boolean CraftingStabilizedRiftSignatureAllowed;
|
||||||
|
public final boolean CraftingStableFabricAllowed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Other Flags
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final boolean WorldRiftGenerationEnabled;
|
||||||
|
public final boolean RiftSpreadEnabled;
|
||||||
|
public final boolean RiftGriefingEnabled;
|
||||||
|
public final boolean RiftsSpawnEndermenEnabled;
|
||||||
|
public final boolean LimboEnabled;
|
||||||
|
public final boolean HardcoreLimboEnabled;
|
||||||
|
public final boolean LimboReturnsInventoryEnabled;
|
||||||
|
public final boolean DoorRenderingEnabled;
|
||||||
|
public final boolean TNFREAKINGT_Enabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Other
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final int NonTntWeight;
|
||||||
|
public final int RiftSpreadModifier;
|
||||||
|
public final int LimboReturnRange;
|
||||||
|
public final String CustomSchematicDirectory;
|
||||||
|
|
||||||
|
//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)
|
||||||
|
{
|
||||||
|
//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();
|
||||||
|
|
||||||
|
CraftingDimensionaDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Dimesional Door", true).getBoolean(true);
|
||||||
|
CraftingWarpDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Warp Door", true).getBoolean(true);
|
||||||
|
CraftingUnstableDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crating Unstable Door", true).getBoolean(true);
|
||||||
|
CraftingTransTrapdoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Transdimensional Trapdoor", true).getBoolean(true);
|
||||||
|
CraftingRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Signature", true).getBoolean(true);
|
||||||
|
CraftingRiftRemoverAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Remover", true).getBoolean(true);
|
||||||
|
CraftingStabilizedRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stabilized Rift Signature", true).getBoolean(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);
|
||||||
|
|
||||||
|
RiftGriefingEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Griefing", true,
|
||||||
|
"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);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
TNFREAKINGT_Enabled = config.get(Configuration.CATEGORY_GENERAL, "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
|
||||||
|
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();
|
||||||
|
|
||||||
|
DoorRenderEntityID=config.get(CATEGORY_ENTITY, "Door Render Entity ID", 89).getInt();
|
||||||
|
MonolithEntityID = config.get(CATEGORY_ENTITY, "Monolith Entity ID", 125).getInt();
|
||||||
|
|
||||||
|
DimensionalDoorID = config.getBlock("Dimensional Door Block ID", 1970).getInt();
|
||||||
|
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();
|
||||||
|
|
||||||
|
WarpDoorItemID = config.getItem("Warp Door Item ID", 5670).getInt();
|
||||||
|
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();
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
LimboDimensionID = config.get(CATEGORY_DIMENSION, "Limbo Dimension ID", -23).getInt();
|
||||||
|
PocketProviderID = config.get(CATEGORY_PROVIDER, "Pocket Provider ID", 24).getInt();
|
||||||
|
LimboProviderID = config.get(CATEGORY_PROVIDER, "Limbo Provider ID", 13).getInt();
|
||||||
|
|
||||||
|
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
|
||||||
|
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(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();
|
||||||
|
|
||||||
|
LimboBiomeID = config.get(CATEGORY_BIOME, "Limbo Biome ID", 251).getInt();
|
||||||
|
PocketBiomeID = config.get(CATEGORY_BIOME, "Pocket Biome ID", 250).getInt();
|
||||||
|
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
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,224 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import net.minecraftforge.common.Configuration;
|
|
||||||
import net.minecraftforge.common.Property;
|
|
||||||
|
|
||||||
public class DimDoorsConfig
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* BlockIDs
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Property UnstableDoorID;
|
|
||||||
public static Property DimensionalDoorID;
|
|
||||||
public static Property WarpDoorID;
|
|
||||||
public static Property TransTrapdoorID;
|
|
||||||
public static Property TransientDoorID;
|
|
||||||
|
|
||||||
public static Property FabricBlockID;
|
|
||||||
public static Property RiftBlockID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WorldGenBlockIDs
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Property LimboBlockID;
|
|
||||||
public static Property PermaFabricBlockID;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ItemIDs
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Property RiftBladeItemID;
|
|
||||||
public static Property RiftSignatureItemID;
|
|
||||||
public static Property RiftRemoverItemID;
|
|
||||||
public static Property StableFabricItemID;
|
|
||||||
public static Property StabilizedRiftSignatureItemID;
|
|
||||||
|
|
||||||
public static Property DimensionalDoorItemID;
|
|
||||||
public static Property UnstableDoorItemID;
|
|
||||||
public static Property WarpDoorItemID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Other IDs
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Property LimboBiomeID;
|
|
||||||
public static Property PocketBiomeID;
|
|
||||||
public static Property LimboDimensionID;
|
|
||||||
public static Property limboProviderID;
|
|
||||||
public static Property PocketProviderID;
|
|
||||||
public static Property DoorRenderEntityID;
|
|
||||||
public static Property MonolithEntityID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CraftingFlags
|
|
||||||
*/
|
|
||||||
public static Property CraftingDimensionaDoorAllowed;
|
|
||||||
public static Property CraftingWarpDoorAllowed;
|
|
||||||
public static Property CraftingRiftSignatureAllowed;
|
|
||||||
public static Property CraftingRiftRemoverAllowed;
|
|
||||||
public static Property CraftingUnstableDoorAllowed;
|
|
||||||
public static Property CraftingRiftBladeAllowed;
|
|
||||||
public static Property CraftingTransTrapdoorAllowed;
|
|
||||||
public static Property CraftingStabilizedRiftSignatureAllowed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OtherFlags
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Property WorldRiftGenerationEnabled;
|
|
||||||
public static Property RiftSpreadEnabled;
|
|
||||||
public static Property RiftGriefingEnabled;
|
|
||||||
public static Property RiftsSpawnEndermenEnabled;
|
|
||||||
public static Property LimboEnabled;
|
|
||||||
public static Property LimboRespawningEnabled;
|
|
||||||
public static Property LimboReturnsInventoryEnabled;
|
|
||||||
public static Property DoorRenderingEnabled;
|
|
||||||
public static Property TNFREAKINGT_Enabled;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Other
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static Property NonTntWeight;
|
|
||||||
public static Property RiftSpreadModifier;
|
|
||||||
public static Property LimboReturnRange;
|
|
||||||
|
|
||||||
public static void loadConfig(File configFile)
|
|
||||||
{
|
|
||||||
Configuration config = new Configuration(configFile);
|
|
||||||
|
|
||||||
config.load();
|
|
||||||
|
|
||||||
CraftingDimensionaDoorAllowed = config.get("Crafting control", "bCraftDimDoor", true);
|
|
||||||
CraftingWarpDoorAllowed = config.get("Crafting control", "bCraftExitDoor", true);
|
|
||||||
CraftingUnstableDoorAllowed = config.get("Crafting control", "bCraftChaosDoor", true);
|
|
||||||
CraftingTransTrapdoorAllowed = config.get("Crafting control", "bCraftDimHatch", true);
|
|
||||||
CraftingRiftSignatureAllowed = config.get("Crafting control", "bCraftRiftSig", true);
|
|
||||||
CraftingRiftRemoverAllowed = config.get("Crafting control", "bCraftRiftRemover", true);
|
|
||||||
CraftingStabilizedRiftSignatureAllowed = config.get("Crafting control", "bCraftStabilizedRiftSig", true);
|
|
||||||
CraftingRiftBladeAllowed = config.get("Crafting control", "bCraftRiftBlade", true);
|
|
||||||
|
|
||||||
LimboRespawningEnabled = config.get(Configuration.CATEGORY_GENERAL, "bHardcoreLimbo", false);
|
|
||||||
LimboRespawningEnabled.comment = "True causes the player to respawn in limbo if they die in limbo";
|
|
||||||
|
|
||||||
TNFREAKINGT_Enabled = config.get("Configuration.CATEGORY_GENERAL", "EXPLOSIONS!!???!!!?!?!!", false);
|
|
||||||
|
|
||||||
RiftGriefingEnabled = config.get(Configuration.CATEGORY_GENERAL, "bRiftGreif", true);
|
|
||||||
RiftGriefingEnabled.comment = "toggles whether rifts eat blocks around them or not";
|
|
||||||
|
|
||||||
DoorRenderingEnabled = config.get(Configuration.CATEGORY_GENERAL, "bEnableDoorRender", true);
|
|
||||||
|
|
||||||
LimboReturnsInventoryEnabled = config.get(Configuration.CATEGORY_GENERAL, "bLimboReturnInventory", true);
|
|
||||||
LimboReturnsInventoryEnabled.comment="Toggles whether or not your inventory is returned upon dying and respawning in limbo";
|
|
||||||
|
|
||||||
NonTntWeight=config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25);
|
|
||||||
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. ";
|
|
||||||
|
|
||||||
MonolithEntityID=config.get(Configuration.CATEGORY_GENERAL, "monolithID", 125);
|
|
||||||
|
|
||||||
DimensionalDoorID = config.getBlock("DimensionalDoorID", 1970);
|
|
||||||
WarpDoorID = config.getBlock("WarpDoorID", 1975);
|
|
||||||
UnstableDoorID = config.getBlock("UnstableDoorID", 1978);
|
|
||||||
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);
|
|
||||||
RiftBladeItemID=config.getItem("Rift Blade", 5676);
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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,341 +32,340 @@ 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
|
||||||
|
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (packet.channel.equals("DimDoorPackets"))
|
||||||
|
{
|
||||||
|
handleRandom(packet,player);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
private void handleRandom(Packet250CustomPayload packet, Player player)
|
||||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
{
|
||||||
{
|
ByteArrayDataInput data = ByteStreams.newDataInput(packet.data);
|
||||||
|
|
||||||
if (packet.channel.equals("DimDoorPackets"))
|
int id=data.readByte();
|
||||||
{
|
|
||||||
handleRandom(packet,player);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleRandom(Packet250CustomPayload packet, Player player)
|
|
||||||
{
|
|
||||||
ByteArrayDataInput data = ByteStreams.newDataInput(packet.data);
|
|
||||||
|
|
||||||
int id=data.readByte();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(id==regsiterDimPacketID)
|
if(id==regsiterDimPacketID)
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dimId = data.readInt();
|
|
||||||
// System.out.println("regsitered dim ID" + dimId);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimDataToAdd = new DimData(dimId, data.readBoolean(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt());
|
|
||||||
|
|
||||||
if(!dimHelper.dimList.containsKey(dimId))
|
|
||||||
{
|
|
||||||
dimHelper.dimList.put(dimId, dimDataToAdd);
|
|
||||||
}
|
|
||||||
if(dimDataToAdd.isPocket)
|
|
||||||
{
|
|
||||||
dimHelper.registerDimension(dimId, mod_pocketDim.providerID);
|
|
||||||
//System.out.println("regsitered dim ID" + dimId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
// e.printStackTrace();
|
|
||||||
if(dimId!=0)
|
|
||||||
{
|
|
||||||
// System.out.println(String.valueOf(dimId)+"dimID already registered");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(id==registerLinkPacketID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dimId = data.readInt();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimDataToAddLink= dimHelper.dimList.get(dimId);
|
|
||||||
|
|
||||||
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
|
||||||
linkToAdd.hasGennedDoor=data.readBoolean();
|
|
||||||
|
|
||||||
dimHelper.instance.createLink(linkToAdd);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
System.out.println("Tried to update client link data & failed!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(id==removeLinkPacketID)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int dimId = data.readInt();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DimData dimDataToRemoveFrom= dimHelper.dimList.get(dimId);
|
|
||||||
|
|
||||||
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
|
||||||
dimDataToRemoveFrom.removeLinkAtCoords(linkToAdd.locDimID, linkToAdd.locXCoord,linkToAdd.locYCoord, linkToAdd.locZCoord);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
//e.printStackTrace();
|
|
||||||
System.out.println("Tried to update client link data & failed!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if(id==this.linkKeyPacketID)
|
|
||||||
{
|
|
||||||
LinkData link = new LinkData(data.readInt(), data.readInt(), data.readInt(), data.readInt());
|
|
||||||
dimHelper.instance.interDimLinkList.put(data.readInt(), link);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onClientJoinPacket(INetworkManager manager, HashMap<Integer, DimData> dimList)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
Collection<Integer> dimIDs= dimList.keySet();
|
|
||||||
Collection<DimData> dimDataSet= dimList.values();
|
|
||||||
Collection<Packet250CustomPayload> packetsToSend = new HashSet();
|
|
||||||
|
|
||||||
|
|
||||||
|
int dimId = data.readInt();
|
||||||
for(DimData data : dimDataSet)
|
// System.out.println("regsitered dim ID" + dimId);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
|
DimData dimDataToAdd = new DimData(dimId, data.readBoolean(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt());
|
||||||
|
|
||||||
manager.addToSendQueue(PacketHandler.onDimCreatedPacket(data));
|
if(!dimHelper.dimList.containsKey(dimId))
|
||||||
|
{
|
||||||
Collection <HashMap<Integer, HashMap<Integer, LinkData>>> linkList = data.linksInThisDim.values();
|
dimHelper.dimList.put(dimId, dimDataToAdd);
|
||||||
|
}
|
||||||
for(HashMap map : linkList )
|
if(dimDataToAdd.isPocket)
|
||||||
{
|
{
|
||||||
|
if (properties == null)
|
||||||
Collection <HashMap<Integer, LinkData>> linkList2 = map.values();
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
for(HashMap map2 : linkList2)
|
|
||||||
{
|
|
||||||
Collection <LinkData> linkList3 = map2.values();
|
|
||||||
|
|
||||||
for(LinkData link : linkList3)
|
|
||||||
{
|
|
||||||
|
|
||||||
packetsToSend.add(( PacketHandler.onLinkCreatedPacket(link)));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dimHelper.registerDimension(dimId, properties.PocketProviderID);
|
||||||
|
//System.out.println("regsitered dim ID" + dimId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
for (Packet250CustomPayload packet : packetsToSend)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
manager.addToSendQueue(packet);
|
// e.printStackTrace();
|
||||||
|
if(dimId!=0)
|
||||||
|
{
|
||||||
|
// System.out.println(String.valueOf(dimId)+"dimID already registered");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(id==registerLinkPacketID)
|
||||||
public static Packet250CustomPayload onLinkCreatedPacket(LinkData link)
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.registerLinkPacketID);
|
|
||||||
dataOut.writeInt(link.locDimID);
|
|
||||||
dataOut.writeInt(link.destDimID);
|
|
||||||
dataOut.writeInt(link.locXCoord);
|
|
||||||
dataOut.writeInt(link.locYCoord);
|
|
||||||
dataOut.writeInt(link.locZCoord);
|
|
||||||
dataOut.writeInt(link.destXCoord);
|
|
||||||
dataOut.writeInt(link.destYCoord);
|
|
||||||
dataOut.writeInt(link.destZCoord);
|
|
||||||
dataOut.writeBoolean(link.isLocPocket);
|
|
||||||
|
|
||||||
dataOut.writeInt(link.linkOrientation);
|
|
||||||
dataOut.writeBoolean(link.hasGennedDoor);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="DimDoorPackets";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Packet250CustomPayload linkKeyPacket(LinkData link, int key)
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.linkKeyPacketID);
|
|
||||||
|
|
||||||
dataOut.writeInt(link.destDimID);
|
|
||||||
dataOut.writeInt(link.destXCoord);
|
|
||||||
dataOut.writeInt(link.destYCoord);
|
|
||||||
dataOut.writeInt(link.destZCoord);
|
|
||||||
dataOut.writeInt(key);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="DimDoorPackets";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void onLinkRemovedPacket(LinkData link)
|
|
||||||
{
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.removeLinkPacketID);
|
|
||||||
dataOut.writeInt(link.locDimID);
|
|
||||||
dataOut.writeInt(link.destDimID);
|
|
||||||
dataOut.writeInt(link.locXCoord);
|
|
||||||
dataOut.writeInt(link.locYCoord);
|
|
||||||
dataOut.writeInt(link.locZCoord);
|
|
||||||
dataOut.writeInt(link.destXCoord);
|
|
||||||
dataOut.writeInt(link.destYCoord);
|
|
||||||
dataOut.writeInt(link.destZCoord);
|
|
||||||
dataOut.writeBoolean(link.isLocPocket);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="DimDoorPackets";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();;
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Packet250CustomPayload onDimCreatedPacket(DimData data)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
DataOutputStream dataOut = new DataOutputStream(bos);
|
|
||||||
|
|
||||||
|
|
||||||
try
|
int dimId = data.readInt();
|
||||||
{
|
try
|
||||||
|
{
|
||||||
|
DimData dimDataToAddLink= dimHelper.dimList.get(dimId);
|
||||||
|
|
||||||
dataOut.writeByte(PacketHandler.regsiterDimPacketID);
|
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
||||||
dataOut.writeInt(data.dimID);
|
linkToAdd.hasGennedDoor=data.readBoolean();
|
||||||
dataOut.writeBoolean(data.isPocket);
|
|
||||||
|
|
||||||
dataOut.writeInt(data.depth);
|
dimHelper.instance.createLink(linkToAdd);
|
||||||
dataOut.writeInt(data.exitDimLink.destDimID);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destXCoord);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destYCoord);
|
|
||||||
dataOut.writeInt(data.exitDimLink.destZCoord);
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
}
|
e.printStackTrace();
|
||||||
|
System.out.println("Tried to update client link data & failed!");
|
||||||
|
}
|
||||||
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
|
||||||
packet.channel="DimDoorPackets";
|
|
||||||
packet.data = bos.toByteArray();
|
|
||||||
packet.length = bos.size();
|
|
||||||
|
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
|
||||||
return packet;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
if(id==removeLinkPacketID)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int dimId = data.readInt();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DimData dimDataToRemoveFrom= dimHelper.dimList.get(dimId);
|
||||||
|
|
||||||
|
LinkData linkToAdd = new LinkData(dimId, data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readInt(), data.readBoolean(),data.readInt());
|
||||||
|
dimDataToRemoveFrom.removeLinkAtCoords(linkToAdd.locDimID, linkToAdd.locXCoord,linkToAdd.locYCoord, linkToAdd.locZCoord);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
//e.printStackTrace();
|
||||||
|
System.out.println("Tried to update client link data & failed!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if(id==this.linkKeyPacketID)
|
||||||
|
{
|
||||||
|
LinkData link = new LinkData(data.readInt(), data.readInt(), data.readInt(), data.readInt());
|
||||||
|
dimHelper.instance.interDimLinkList.put(data.readInt(), link);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onClientJoinPacket(INetworkManager manager, HashMap<Integer, DimData> dimList)
|
||||||
|
{
|
||||||
|
|
||||||
|
Collection<Integer> dimIDs= dimList.keySet();
|
||||||
|
Collection<DimData> dimDataSet= dimList.values();
|
||||||
|
Collection<Packet250CustomPayload> packetsToSend = new HashSet();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for(DimData data : dimDataSet)
|
||||||
|
{
|
||||||
|
|
||||||
|
manager.addToSendQueue(PacketHandler.onDimCreatedPacket(data));
|
||||||
|
|
||||||
|
Collection <HashMap<Integer, HashMap<Integer, LinkData>>> linkList = data.linksInThisDim.values();
|
||||||
|
|
||||||
|
for(HashMap map : linkList )
|
||||||
|
{
|
||||||
|
|
||||||
|
Collection <HashMap<Integer, LinkData>> linkList2 = map.values();
|
||||||
|
|
||||||
|
for(HashMap map2 : linkList2)
|
||||||
|
{
|
||||||
|
Collection <LinkData> linkList3 = map2.values();
|
||||||
|
|
||||||
|
for(LinkData link : linkList3)
|
||||||
|
{
|
||||||
|
|
||||||
|
packetsToSend.add(( PacketHandler.onLinkCreatedPacket(link)));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
for (Packet250CustomPayload packet : packetsToSend)
|
||||||
|
{
|
||||||
|
manager.addToSendQueue(packet);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Packet250CustomPayload onLinkCreatedPacket(LinkData link)
|
||||||
|
{
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream dataOut = new DataOutputStream(bos);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
dataOut.writeByte(PacketHandler.registerLinkPacketID);
|
||||||
|
dataOut.writeInt(link.locDimID);
|
||||||
|
dataOut.writeInt(link.destDimID);
|
||||||
|
dataOut.writeInt(link.locXCoord);
|
||||||
|
dataOut.writeInt(link.locYCoord);
|
||||||
|
dataOut.writeInt(link.locZCoord);
|
||||||
|
dataOut.writeInt(link.destXCoord);
|
||||||
|
dataOut.writeInt(link.destYCoord);
|
||||||
|
dataOut.writeInt(link.destZCoord);
|
||||||
|
dataOut.writeBoolean(link.isLocPocket);
|
||||||
|
|
||||||
|
dataOut.writeInt(link.linkOrientation);
|
||||||
|
dataOut.writeBoolean(link.hasGennedDoor);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
Packet250CustomPayload packet= new Packet250CustomPayload();
|
||||||
|
packet.channel="DimDoorPackets";
|
||||||
|
packet.data = bos.toByteArray();
|
||||||
|
packet.length = bos.size();;
|
||||||
|
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Packet250CustomPayload linkKeyPacket(LinkData link, int key)
|
||||||
|
{
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream dataOut = new DataOutputStream(bos);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
dataOut.writeByte(PacketHandler.linkKeyPacketID);
|
||||||
|
|
||||||
|
dataOut.writeInt(link.destDimID);
|
||||||
|
dataOut.writeInt(link.destXCoord);
|
||||||
|
dataOut.writeInt(link.destYCoord);
|
||||||
|
dataOut.writeInt(link.destZCoord);
|
||||||
|
dataOut.writeInt(key);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
Packet250CustomPayload packet= new Packet250CustomPayload();
|
||||||
|
packet.channel="DimDoorPackets";
|
||||||
|
packet.data = bos.toByteArray();
|
||||||
|
packet.length = bos.size();;
|
||||||
|
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void onLinkRemovedPacket(LinkData link)
|
||||||
|
{
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream dataOut = new DataOutputStream(bos);
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
dataOut.writeByte(PacketHandler.removeLinkPacketID);
|
||||||
|
dataOut.writeInt(link.locDimID);
|
||||||
|
dataOut.writeInt(link.destDimID);
|
||||||
|
dataOut.writeInt(link.locXCoord);
|
||||||
|
dataOut.writeInt(link.locYCoord);
|
||||||
|
dataOut.writeInt(link.locZCoord);
|
||||||
|
dataOut.writeInt(link.destXCoord);
|
||||||
|
dataOut.writeInt(link.destYCoord);
|
||||||
|
dataOut.writeInt(link.destZCoord);
|
||||||
|
dataOut.writeBoolean(link.isLocPocket);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
Packet250CustomPayload packet= new Packet250CustomPayload();
|
||||||
|
packet.channel="DimDoorPackets";
|
||||||
|
packet.data = bos.toByteArray();
|
||||||
|
packet.length = bos.size();;
|
||||||
|
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Packet250CustomPayload onDimCreatedPacket(DimData data)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream dataOut = new DataOutputStream(bos);
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
dataOut.writeByte(PacketHandler.regsiterDimPacketID);
|
||||||
|
dataOut.writeInt(data.dimID);
|
||||||
|
dataOut.writeBoolean(data.isPocket);
|
||||||
|
|
||||||
|
dataOut.writeInt(data.depth);
|
||||||
|
dataOut.writeInt(data.exitDimLink.destDimID);
|
||||||
|
dataOut.writeInt(data.exitDimLink.destXCoord);
|
||||||
|
dataOut.writeInt(data.exitDimLink.destYCoord);
|
||||||
|
dataOut.writeInt(data.exitDimLink.destZCoord);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
Packet250CustomPayload packet= new Packet250CustomPayload();
|
||||||
|
packet.channel="DimDoorPackets";
|
||||||
|
packet.data = bos.toByteArray();
|
||||||
|
packet.length = bos.size();
|
||||||
|
|
||||||
|
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||||
|
return packet;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
private void handleObjectPacket(Packet250CustomPayload packet, Player player)
|
private void handleObjectPacket(Packet250CustomPayload packet, Player player)
|
||||||
{
|
{
|
||||||
ObjectInputStream data = new ObjectInputStream;
|
ObjectInputStream data = new ObjectInputStream;
|
||||||
@@ -395,28 +394,28 @@ public class PacketHandler implements IPacketHandler
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
public static void sendDimObject(DimData dim)
|
public static void sendDimObject(DimData dim)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
{
|
ObjectOutputStream dataOut = new ObjectOutputStream(bos);
|
||||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
dataOut.writeObject(dim);
|
||||||
ObjectOutputStream dataOut = new ObjectOutputStream(bos);
|
|
||||||
dataOut.writeObject(dim);
|
|
||||||
|
|
||||||
Packet250CustomPayload packet= new Packet250CustomPayload();
|
Packet250CustomPayload packet= new Packet250CustomPayload();
|
||||||
packet.channel="DimDoorPackets";
|
packet.channel="DimDoorPackets";
|
||||||
packet.data = bos.toByteArray();
|
packet.data = bos.toByteArray();
|
||||||
packet.length = bos.size();;
|
packet.length = bos.size();;
|
||||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -12,75 +12,81 @@ import cpw.mods.fml.common.IWorldGenerator;
|
|||||||
|
|
||||||
public class RiftGenerator implements IWorldGenerator
|
public class RiftGenerator implements IWorldGenerator
|
||||||
{
|
{
|
||||||
private int minableBlockId;
|
private int minableBlockId;
|
||||||
private int numberOfBlocks;
|
private int numberOfBlocks;
|
||||||
int cycles=40;
|
int cycles=40;
|
||||||
boolean shouldSave = false;
|
boolean shouldSave = false;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int i;
|
int i;
|
||||||
int k;
|
int k;
|
||||||
int j;
|
int j;
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
boolean shouldGenHere=true;
|
boolean shouldGenHere=true;
|
||||||
LinkData link;
|
LinkData link;
|
||||||
|
DimData dimData;
|
||||||
|
|
||||||
|
private static DDProperties properties = null;
|
||||||
|
|
||||||
|
public RiftGenerator()
|
||||||
|
{
|
||||||
|
if (properties == null)
|
||||||
|
properties = DDProperties.instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||||
|
{
|
||||||
|
//Long ntime = System.nanoTime();
|
||||||
|
shouldGenHere=true;
|
||||||
|
|
||||||
|
if (world.provider.getDimensionName()=="PocketDim"|| !properties.WorldRiftGenerationEnabled || world.isRemote)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.shouldGenHere=false;
|
||||||
|
|
||||||
|
|
||||||
DimData dimData;
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
|
||||||
{
|
|
||||||
//Long ntime = System.nanoTime();
|
|
||||||
shouldGenHere=true;
|
|
||||||
|
|
||||||
if(world.provider.getDimensionName()=="PocketDim"||!mod_pocketDim.riftsInWorldGen ||world.isRemote)
|
|
||||||
{
|
|
||||||
|
|
||||||
this.shouldGenHere=false;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
if(this.shouldGenHere)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
if(this.shouldGenHere)
|
if(random.nextInt(3500)==0)
|
||||||
{
|
{
|
||||||
|
i=chunkX*16-random.nextInt(16);
|
||||||
|
k=chunkZ*16-random.nextInt(16);
|
||||||
|
|
||||||
|
j= world.getHeightValue(i, k);
|
||||||
|
|
||||||
|
if(j>20&&world.getBlockId(i, j, k)==0)
|
||||||
|
{
|
||||||
|
// System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"Large gen");
|
||||||
|
|
||||||
|
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true,rand.nextInt(4));
|
||||||
|
link = dimHelper.instance.createPocket(link,true, true);
|
||||||
|
this.shouldSave=true;
|
||||||
|
|
||||||
|
|
||||||
if(random.nextInt(3500)==0)
|
// SchematicLoader loader = new SchematicLoader();
|
||||||
{
|
// loader.init(link);
|
||||||
i=chunkX*16-random.nextInt(16);
|
// loader.generateSchematic(link);
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
|
|
||||||
if(j>20&&world.getBlockId(i, j, k)==0)
|
|
||||||
{
|
|
||||||
// System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"Large gen");
|
|
||||||
|
|
||||||
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true,rand.nextInt(4));
|
|
||||||
link = dimHelper.instance.createPocket(link,true, true);
|
|
||||||
this.shouldSave=true;
|
|
||||||
|
|
||||||
|
|
||||||
// SchematicLoader loader = new SchematicLoader();
|
count=0;
|
||||||
// loader.init(link);
|
while(random.nextInt(4)!=1)
|
||||||
// loader.generateSchematic(link);
|
{
|
||||||
|
i=chunkX*16-random.nextInt(16);
|
||||||
|
k=chunkZ*16-random.nextInt(16);
|
||||||
|
|
||||||
|
j= world.getHeightValue(i, k);
|
||||||
|
|
||||||
count=0;
|
if(world.isAirBlock(i, j+1, k))
|
||||||
while(random.nextInt(4)!=1)
|
{
|
||||||
{
|
|
||||||
i=chunkX*16-random.nextInt(16);
|
|
||||||
k=chunkZ*16-random.nextInt(16);
|
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
|
||||||
|
|
||||||
if(world.isAirBlock(i, j+1, k))
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
link = dimHelper.instance.createLink(link.locDimID,link.destDimID, i, j+1, k,link.destXCoord,link.destYCoord,link.destZCoord);
|
link = dimHelper.instance.createLink(link.locDimID,link.destDimID, i, j+1, k,link.destXCoord,link.destYCoord,link.destZCoord);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -88,13 +94,13 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
if(random.nextInt(540)==0)
|
if(random.nextInt(540)==0)
|
||||||
{
|
{
|
||||||
i=chunkX*16-random.nextInt(16);
|
i=chunkX*16-random.nextInt(16);
|
||||||
@@ -140,76 +146,76 @@ 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);
|
||||||
|
|
||||||
j= world.getHeightValue(i, k);
|
j= world.getHeightValue(i, k);
|
||||||
if(j>20&&world.getBlockId(i, j, k)==0)
|
if(j>20&&world.getBlockId(i, j, k)==0)
|
||||||
{
|
{
|
||||||
//System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"small gen");
|
//System.out.println(String.valueOf(i)+"x "+String.valueOf(j)+"y "+String.valueOf(k)+"z"+"small gen");
|
||||||
|
|
||||||
count=0;
|
count=0;
|
||||||
|
|
||||||
|
|
||||||
if(world.isAirBlock(i, j+1, k))
|
if(world.isAirBlock(i, j+1, k))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(world.isBlockOpaqueCube(i, j-2, k)||world.isBlockOpaqueCube(i, j-1, k))
|
if(world.isBlockOpaqueCube(i, j-2, k)||world.isBlockOpaqueCube(i, j-1, k))
|
||||||
{
|
{
|
||||||
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true,rand.nextInt(4));
|
link = new LinkData(world.provider.dimensionId, 0, i, j+1, k, i, j+1, k, true,rand.nextInt(4));
|
||||||
link =dimHelper.instance.createPocket(link,true, true);
|
link =dimHelper.instance.createPocket(link,true, true);
|
||||||
|
|
||||||
for(int xc=-3;xc<4;xc++)
|
for(int xc=-3;xc<4;xc++)
|
||||||
{
|
{
|
||||||
for(int zc=-3;zc<4;zc++)
|
for(int zc=-3;zc<4;zc++)
|
||||||
{
|
{
|
||||||
for(int yc=0;yc<200;yc++)
|
for(int yc=0;yc<200;yc++)
|
||||||
{
|
{
|
||||||
if(yc==0&&world.isBlockOpaqueCube(i+xc, j-2,k +zc))
|
if(yc==0&&world.isBlockOpaqueCube(i+xc, j-2,k +zc))
|
||||||
{
|
{
|
||||||
|
|
||||||
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
|
if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+2)
|
||||||
{
|
{
|
||||||
world.setBlock(i+xc, j-1+yc, k+zc, blockID);
|
world.setBlock(i+xc, j-1+yc, k+zc, blockID);
|
||||||
}
|
}
|
||||||
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
|
else if(Math.abs(xc)+Math.abs(zc)<rand.nextInt(3)+3)
|
||||||
|
|
||||||
{
|
{
|
||||||
world.setBlock(i+xc, j-1+yc, k+zc, blockID,2,1);
|
world.setBlock(i+xc, j-1+yc, k+zc, blockID,2,1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemRiftBlade.placeDoorBlock(world, i, j+1, k, 0, mod_pocketDim.transientDoor);
|
ItemRiftBlade.placeDoorBlock(world, i, j+1, k, 0, mod_pocketDim.transientDoor);
|
||||||
|
|
||||||
{
|
{
|
||||||
world.setBlock(i, j+1, k-1, blockID,0,1);
|
world.setBlock(i, j+1, k-1, blockID,0,1);
|
||||||
world.setBlock(i, j+1, k+1, blockID,0,1);
|
world.setBlock(i, j+1, k+1, blockID,0,1);
|
||||||
world.setBlock(i, j, k-1, blockID,0,1);
|
world.setBlock(i, j, k-1, blockID,0,1);
|
||||||
world.setBlock(i, j, k+1, blockID,0,1);
|
world.setBlock(i, j, k+1, blockID,0,1);
|
||||||
world.setBlock(i, j+2, k+1, blockID,3,1);
|
world.setBlock(i, j+2, k+1, blockID,3,1);
|
||||||
world.setBlock(i, j+2, k-1, blockID,3,1);
|
world.setBlock(i, j+2, k-1, blockID,3,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -217,16 +223,16 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.shouldSave=true;
|
this.shouldSave=true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// dimData = dimHelper.instance.dimList.get(link.destDimID);
|
// dimData = dimHelper.instance.dimList.get(link.destDimID);
|
||||||
|
|
||||||
|
|
||||||
// SchematicLoader loader = new SchematicLoader();
|
// SchematicLoader loader = new SchematicLoader();
|
||||||
// loader.init(link);
|
// loader.init(link);
|
||||||
// loader.generateSchematic(link);
|
// loader.generateSchematic(link);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -235,22 +241,22 @@ public class RiftGenerator implements IWorldGenerator
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.shouldSave)
|
if(this.shouldSave)
|
||||||
{
|
{
|
||||||
// dimHelper.instance.save();
|
// dimHelper.instance.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// mod_pocketDim.genTime=((System.nanoTime()-ntime)+mod_pocketDim.genTime);
|
// mod_pocketDim.genTime=((System.nanoTime()-ntime)+mod_pocketDim.genTime);
|
||||||
// System.out.println( mod_pocketDim.genTime);
|
// System.out.println( mod_pocketDim.genTime);
|
||||||
// System.out.println( (System.nanoTime()-ntime));
|
// System.out.println( (System.nanoTime()-ntime));
|
||||||
|
|
||||||
// ntime=0L;
|
// ntime=0L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -7,9 +7,9 @@ import cpw.mods.fml.common.network.Player;
|
|||||||
|
|
||||||
public class ServerPacketHandler implements IPacketHandler
|
public class ServerPacketHandler implements IPacketHandler
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onPacketData(INetworkManager manager,
|
public void onPacketData(INetworkManager manager,
|
||||||
Packet250CustomPayload packet, Player player)
|
Packet250CustomPayload packet, Player player)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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,83 +17,79 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
|
||||||
|
*/
|
||||||
|
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
||||||
|
{
|
||||||
|
if(!par1World.isRemote&&par1World.provider.dimensionId==properties.LimboDimensionID)
|
||||||
|
{
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
LinkData link=dimHelper.instance.getRandomLinkData(false);
|
||||||
|
if(link==null)
|
||||||
|
{
|
||||||
|
link =new LinkData(0,0,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
if(dimHelper.getWorld(0)==null)
|
||||||
|
{
|
||||||
}
|
dimHelper.initDimension(0);
|
||||||
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Only matters if the player is in limbo, acts to teleport the player from limbo back to dim 0
|
|
||||||
*/
|
|
||||||
public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
||||||
{
|
|
||||||
if(!par1World.isRemote&&par1World.provider.dimensionId==mod_pocketDim.limboDimID)
|
|
||||||
{
|
|
||||||
Random rand = new Random();
|
|
||||||
|
|
||||||
LinkData link=dimHelper.instance.getRandomLinkData(false);
|
|
||||||
if(link==null)
|
|
||||||
{
|
|
||||||
link =new LinkData(0,0,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(0)==null)
|
if(dimHelper.getWorld(0)!=null&&par5Entity instanceof EntityPlayer)
|
||||||
{
|
{
|
||||||
dimHelper.initDimension(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dimHelper.getWorld(0)!=null&&par5Entity instanceof EntityPlayer)
|
int x = (link.destXCoord + rand.nextInt(properties.LimboReturnRange)-properties.LimboReturnRange/2);
|
||||||
{
|
int z = (link.destZCoord + rand.nextInt(properties.LimboReturnRange)-properties.LimboReturnRange/2);
|
||||||
|
|
||||||
|
//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);
|
||||||
|
|
||||||
|
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
|
||||||
|
dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0),
|
||||||
|
EntityPlayer.class.cast(par5Entity));
|
||||||
|
|
||||||
|
|
||||||
int x = (link.destXCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/2);
|
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z );
|
||||||
int z = (link.destZCoord + rand.nextInt(mod_pocketDim.limboExitRange)-mod_pocketDim.limboExitRange/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
|
//makes sure they can breath when they teleport
|
||||||
z=z+(z>> 4);
|
dimHelper.getWorld(0).setBlock(x, y, z, 0);
|
||||||
|
int i=x;
|
||||||
|
int j=y-1;
|
||||||
|
int k=z;
|
||||||
|
|
||||||
|
|
||||||
|
for(int xc=-3;xc<4;xc++)
|
||||||
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
|
|
||||||
dimHelper.instance.teleportToPocket(par1World, new LinkData(par1World.provider.dimensionId,0,x,y,z,link.locXCoord,link.locYCoord,link.locZCoord,link.isLocPocket,0),
|
|
||||||
EntityPlayer.class.cast(par5Entity));
|
|
||||||
|
|
||||||
|
|
||||||
EntityPlayer.class.cast(par5Entity).setPositionAndUpdate( x, y, z );
|
|
||||||
|
|
||||||
//makes sure they can breath when they teleport
|
|
||||||
dimHelper.getWorld(0).setBlock(x, y, z, 0);
|
|
||||||
int i=x;
|
|
||||||
int j=y-1;
|
|
||||||
int k=z;
|
|
||||||
|
|
||||||
|
|
||||||
for(int xc=-3;xc<4;xc++)
|
|
||||||
{
|
{
|
||||||
for(int zc=-3;zc<4;zc++)
|
for(int zc=-3;zc<4;zc++)
|
||||||
{
|
{
|
||||||
@@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,7 +122,7 @@ public class BlockDimWallPerm extends Block
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,23 +25,23 @@ 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)
|
||||||
{
|
{
|
||||||
super(i, Material.air);
|
super(i, Material.air);
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -52,241 +53,241 @@ public class BlockRift extends BlockContainer
|
|||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
// this.updateTick(par1World, par2, par3, par4, new Random());
|
// this.updateTick(par1World, par2, par3, par4, new Random());
|
||||||
|
|
||||||
}
|
}
|
||||||
public boolean isCollidable()
|
public boolean isCollidable()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {}
|
||||||
|
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
public boolean isOpaqueCube()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
* Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
||||||
*/
|
*/
|
||||||
public boolean canCollideCheck(int par1, boolean par2)
|
public boolean canCollideCheck(int par1, boolean par2)
|
||||||
{
|
{
|
||||||
|
|
||||||
return par2;
|
return par2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the
|
* Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the
|
||||||
* adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
|
* adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
|
||||||
*/
|
*/
|
||||||
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//this doesnt do anything yet.
|
//this doesnt do anything yet.
|
||||||
public int getRenderType()
|
public int getRenderType()
|
||||||
{
|
{
|
||||||
if(mod_pocketDim.isPlayerWearingGoogles)
|
if(mod_pocketDim.isPlayerWearingGoogles)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
||||||
* coordinates. Args: blockAccess, x, y, z, side
|
* coordinates. Args: blockAccess, x, y, z, side
|
||||||
*/
|
*/
|
||||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
||||||
* cleared to be reused)
|
* cleared to be reused)
|
||||||
*/
|
*/
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//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)
|
||||||
{
|
{
|
||||||
|
|
||||||
int range=4;
|
int range=4;
|
||||||
|
|
||||||
float distance=range+range/4;
|
float distance=range+range/4;
|
||||||
int i=-range;
|
int i=-range;
|
||||||
int j=-range;
|
int j=-range;
|
||||||
int k=-range;
|
int k=-range;
|
||||||
boolean flag=true;
|
boolean flag=true;
|
||||||
while (i<range&&flag)
|
while (i<range&&flag)
|
||||||
{
|
{
|
||||||
while (j<range&&flag)
|
while (j<range&&flag)
|
||||||
{
|
{
|
||||||
while (k<range&&flag)
|
while (k<range&&flag)
|
||||||
{
|
{
|
||||||
if(!mod_pocketDim.blocksImmuneToRift.contains(world.getBlockId(x+i, y+j, z+k))&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance&&!world.isAirBlock(x+i, y+j, z+k))
|
if(!mod_pocketDim.blocksImmuneToRift.contains(world.getBlockId(x+i, y+j, z+k))&&MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance&&!world.isAirBlock(x+i, y+j, z+k))
|
||||||
{
|
{
|
||||||
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0&&random.nextInt(2)==0)
|
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0&&random.nextInt(2)==0)
|
||||||
{
|
{
|
||||||
world.setBlock(x+i, y+j, z+k,0);
|
world.setBlock(x+i, y+j, z+k,0);
|
||||||
flag=random.nextBoolean()||random.nextBoolean();
|
flag=random.nextBoolean()||random.nextBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
k=-range;
|
k=-range;
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
}
|
}
|
||||||
j=-range;
|
j=-range;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* regulates the render effect, especially when multiple rifts start to link up. Has 3 main parts- Grows toward and away from nearest rft, bends toward it, and a randomization function
|
* regulates the render effect, especially when multiple rifts start to link up. Has 3 main parts- Grows toward and away from nearest rft, bends toward it, and a randomization function
|
||||||
*/
|
*/
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random rand)
|
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random rand)
|
||||||
{
|
{
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
//growth in the direction towards the nearby rift
|
//growth in the direction towards the nearby rift
|
||||||
float xGrowth=0;
|
float xGrowth=0;
|
||||||
float yGrowth=0;
|
float yGrowth=0;
|
||||||
float zGrowth=0;
|
float zGrowth=0;
|
||||||
//growth away from the nearby rift
|
//growth away from the nearby rift
|
||||||
float xGrowthn=0;
|
float xGrowthn=0;
|
||||||
float yGrowthn=0;
|
float yGrowthn=0;
|
||||||
float zGrowthn=0;
|
float zGrowthn=0;
|
||||||
//how far the particles are away from original rift. Used to decrease noise the farther they are away.
|
//how far the particles are away from original rift. Used to decrease noise the farther they are away.
|
||||||
float xChange = 0;
|
float xChange = 0;
|
||||||
float yChange = 0;
|
float yChange = 0;
|
||||||
float zChange = 0;
|
float zChange = 0;
|
||||||
|
|
||||||
TileEntityRift tile = (TileEntityRift)par1World.getBlockTileEntity(par2, par3, par4);
|
TileEntityRift tile = (TileEntityRift)par1World.getBlockTileEntity(par2, par3, par4);
|
||||||
|
|
||||||
//the noise, ie, how far the rift particles are away from the intended location.
|
//the noise, ie, how far the rift particles are away from the intended location.
|
||||||
float offset=0;
|
float offset=0;
|
||||||
float Xoffset=0;
|
float Xoffset=0;
|
||||||
float Yoffset=0;
|
float Yoffset=0;
|
||||||
float Zoffset=0;
|
float Zoffset=0;
|
||||||
for (count = 0; count < 12 && tile!=null; ++count)
|
for (count = 0; count < 12 && tile!=null; ++count)
|
||||||
{
|
{
|
||||||
//TODO change to a switch statement for clarity
|
//TODO change to a switch statement for clarity
|
||||||
if(tile.xOffset>0)
|
if(tile.xOffset>0)
|
||||||
{
|
{
|
||||||
if(rand.nextInt(tile.xOffset)==0)
|
if(rand.nextInt(tile.xOffset)==0)
|
||||||
{
|
{
|
||||||
xGrowth =xGrowth+.15F*tile.xOffset;
|
xGrowth =xGrowth+.15F*tile.xOffset;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tile.xOffset<0)
|
else if(tile.xOffset<0)
|
||||||
{
|
{
|
||||||
if(rand.nextInt(-tile.xOffset)==0)
|
if(rand.nextInt(-tile.xOffset)==0)
|
||||||
{
|
{
|
||||||
xGrowthn =xGrowthn-.15F*-tile.xOffset;
|
xGrowthn =xGrowthn-.15F*-tile.xOffset;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tile.yOffset>0)
|
if(tile.yOffset>0)
|
||||||
{
|
{
|
||||||
if(rand.nextInt(tile.yOffset)==0)
|
if(rand.nextInt(tile.yOffset)==0)
|
||||||
{
|
{
|
||||||
yGrowth =yGrowth+.15F*tile.yOffset;
|
yGrowth =yGrowth+.15F*tile.yOffset;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tile.yOffset<0)
|
else if(tile.yOffset<0)
|
||||||
{
|
{
|
||||||
if(rand.nextInt(-tile.yOffset)==0)
|
if(rand.nextInt(-tile.yOffset)==0)
|
||||||
{
|
{
|
||||||
yGrowthn =yGrowthn-.15F*-tile.yOffset;
|
yGrowthn =yGrowthn-.15F*-tile.yOffset;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tile.zOffset>0)
|
if(tile.zOffset>0)
|
||||||
{
|
{
|
||||||
if(rand.nextInt(tile.zOffset)==0)
|
if(rand.nextInt(tile.zOffset)==0)
|
||||||
{
|
{
|
||||||
zGrowth =zGrowth+.15F*tile.zOffset;
|
zGrowth =zGrowth+.15F*tile.zOffset;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tile.zOffset<0)
|
else if(tile.zOffset<0)
|
||||||
{
|
{
|
||||||
if(rand.nextInt(-tile.zOffset)==0)
|
if(rand.nextInt(-tile.zOffset)==0)
|
||||||
{
|
{
|
||||||
zGrowthn =zGrowthn-.15F*-tile.zOffset;
|
zGrowthn =zGrowthn-.15F*-tile.zOffset;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xChange=(float) ((xGrowth+xGrowthn)+rand.nextGaussian()*.05F);
|
xChange=(float) ((xGrowth+xGrowthn)+rand.nextGaussian()*.05F);
|
||||||
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
|
yChange=(float) ((yGrowth+yGrowthn)+rand.nextGaussian()*.05F);
|
||||||
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
|
zChange=(float) ((zGrowth+zGrowthn)+rand.nextGaussian()*.05F);
|
||||||
|
|
||||||
offset= (float) ((0.2F/(1+Math.abs(xChange)+Math.abs(yChange)+Math.abs(zChange))));
|
offset= (float) ((0.2F/(1+Math.abs(xChange)+Math.abs(yChange)+Math.abs(zChange))));
|
||||||
Xoffset= (float) ((0.25F/(1+Math.abs(xChange))));
|
Xoffset= (float) ((0.25F/(1+Math.abs(xChange))));
|
||||||
|
|
||||||
Yoffset= (float) ((0.25F/(1+Math.abs(yChange))));
|
Yoffset= (float) ((0.25F/(1+Math.abs(yChange))));
|
||||||
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
|
Zoffset= (float) ((0.25F/(1+Math.abs(zChange))));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5+xChange+Xoffset*rand.nextGaussian(), par3+.5+yChange+Yoffset*rand.nextGaussian() , par4+.5+zChange+Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5+xChange+Xoffset*rand.nextGaussian(), par3+.5+yChange+Yoffset*rand.nextGaussian() , par4+.5+zChange+Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5-xChange-Xoffset*rand.nextGaussian(), par3+.5-yChange-Yoffset*rand.nextGaussian() , par4+.5-zChange-Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new RiftFX(par1World,par2+.5-xChange-Xoffset*rand.nextGaussian(), par3+.5-yChange-Yoffset*rand.nextGaussian() , par4+.5-zChange-Zoffset*rand.nextGaussian(), rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, rand.nextGaussian() * 0.001D, FMLClientHandler.instance().getClient().effectRenderer));
|
||||||
|
|
||||||
|
|
||||||
if(rand.nextBoolean())
|
if(rand.nextBoolean())
|
||||||
{
|
{
|
||||||
//renders an extra little blob on top of the actual rift location so its easier to find. Eventually will only render if the player has the goggles.
|
//renders an extra little blob on top of the actual rift location so its easier to find. Eventually will only render if the player has the goggles.
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new GoggleRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new GoggleRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
|
||||||
}
|
}
|
||||||
if(tile.shouldClose)
|
if(tile.shouldClose)
|
||||||
{
|
{
|
||||||
//renders an opposite color effect if it is being closed by the rift remover
|
//renders an opposite color effect if it is being closed by the rift remover
|
||||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new ClosingRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new ClosingRiftFX(par1World,par2+.5, par3+.5, par4+.5, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, rand.nextGaussian() * 0.01D, FMLClientHandler.instance().getClient().effectRenderer));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public int idPicked(World par1World, int par2, int par3, int par4)
|
public int idPicked(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int idDropped(int par1, Random par2Random, int par3)
|
public int idDropped(int par1, Random par2Random, int par3)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World var1)
|
public TileEntity createNewTileEntity(World var1)
|
||||||
|
|||||||
@@ -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,28 +292,23 @@ public class dimHelper extends DimensionManager
|
|||||||
*/
|
*/
|
||||||
public void teleportToPocket(World world,LinkData linkData, Entity entity)
|
public void teleportToPocket(World world,LinkData linkData, Entity entity)
|
||||||
{
|
{
|
||||||
if(world.isRemote)
|
DDProperties properties = DDProperties.instance();
|
||||||
|
|
||||||
|
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))
|
||||||
{
|
{
|
||||||
this.generatePocket(linkData);
|
this.generatePocket(linkData);
|
||||||
|
|
||||||
@@ -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;
|
public ItemRiftBlade(int par1, Material par2Material)
|
||||||
private final EnumToolMaterial toolMaterial= EnumToolMaterial.GOLD;
|
|
||||||
private Material doorMaterial;
|
|
||||||
|
|
||||||
Random rand = new Random();
|
|
||||||
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,7 +35,11 @@ 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
|
||||||
@@ -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,173 +93,85 @@ 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 dimHatch;
|
||||||
public static Block blockDimWall;
|
|
||||||
public static Block dimHatch;
|
|
||||||
public static Block blockDimWallPerm;
|
public static Block blockDimWallPerm;
|
||||||
public static Item itemRiftBlade;
|
|
||||||
|
|
||||||
public static Item itemDimDoor;
|
|
||||||
public static Item itemExitDoor;
|
|
||||||
public static Item itemRiftRemover;
|
|
||||||
public static Item itemLinkSignature;
|
|
||||||
public static Item itemStableFabric;
|
|
||||||
public static Item itemChaosDoor;
|
|
||||||
public static Item itemStabilizedLinkSignature;
|
|
||||||
|
|
||||||
|
public static Item itemRiftBlade;
|
||||||
|
public static Item itemDimDoor;
|
||||||
|
public static Item itemExitDoor;
|
||||||
|
public static Item itemRiftRemover;
|
||||||
|
public static Item itemLinkSignature;
|
||||||
|
public static Item itemStableFabric;
|
||||||
|
public static Item itemChaosDoor;
|
||||||
|
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 hasInitDims = false;
|
||||||
|
public static boolean isPlayerWearingGoogles = false;
|
||||||
|
|
||||||
|
private static DDProperties properties;
|
||||||
|
public static RiftGenerator riftGen;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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 TNFREAKINGT;
|
|
||||||
|
|
||||||
public static boolean isPlayerWearingGoogles=false;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
DimDoorsConfig.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,28 +226,21 @@ 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");
|
||||||
LanguageRegistry.addName(dimHatch, "Transdimensional Trapdoor");
|
LanguageRegistry.addName(dimHatch, "Transdimensional Trapdoor");
|
||||||
|
|
||||||
LanguageRegistry.addName(itemExitDoor , "Warp Door");
|
LanguageRegistry.addName(itemExitDoor, "Warp Door");
|
||||||
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
|
LanguageRegistry.addName(itemLinkSignature , "Rift Signature");
|
||||||
LanguageRegistry.addName(itemStabilizedLinkSignature, "Stabilized Rift Signature");
|
LanguageRegistry.addName(itemStabilizedLinkSignature, "Stabilized Rift Signature");
|
||||||
LanguageRegistry.addName(itemRiftRemover , "Rift Remover");
|
LanguageRegistry.addName(itemRiftRemover , "Rift Remover");
|
||||||
@@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
|
if (properties.CraftingStableFabricAllowed)
|
||||||
{
|
|
||||||
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', this.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[]
|
GameRegistry.addRecipe(new ItemStack(itemStableFabric, 4), new Object[]
|
||||||
{
|
{
|
||||||
" y ", "yxy", " y ", 'x', this.itemLinkSignature, 'y', this.itemStableFabric
|
" y ", "yxy", " y ", 'x', Item.enderPearl, 'y', mod_pocketDim.blockDimWall
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
||||||
{
|
{
|
||||||
@@ -70,68 +72,61 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float getRenderSizeModifier()
|
public float getRenderSizeModifier()
|
||||||
{
|
{
|
||||||
return this.scaleFactor;
|
return this.scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
|
||||||
{
|
|
||||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
|
||||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
|
||||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
|
||||||
entity.setPosition(x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void entityInit()
|
|
||||||
{
|
|
||||||
super.entityInit();
|
|
||||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||||
|
{
|
||||||
|
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||||
|
entity.lastTickPosY = entity.prevPosY = entity.posY = y + (double)entity.yOffset;
|
||||||
|
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||||
|
entity.setPosition(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void entityInit()
|
||||||
|
{
|
||||||
|
super.entityInit();
|
||||||
|
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityUpdate()
|
public void onEntityUpdate()
|
||||||
{
|
{
|
||||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||||
|
|
||||||
this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png";
|
this.texture="/mods/DimDoors/textures/mobs/Monolith"+b0+".png";
|
||||||
if(!this.hasJumped&&!this.worldObj.isRemote)
|
if(!this.hasJumped&&!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
|
|
||||||
int sanity=0;
|
int sanity=0;
|
||||||
double jumpHeight=0;
|
double jumpHeight=0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
jumpHeight = this.posY+rand.nextInt(25);
|
jumpHeight = this.posY+rand.nextInt(25);
|
||||||
if(this.worldObj.provider instanceof pocketProvider)
|
if(this.worldObj.provider instanceof pocketProvider)
|
||||||
{
|
{
|
||||||
jumpHeight = jumpHeight- rand.nextInt(10);
|
jumpHeight = jumpHeight- rand.nextInt(10);
|
||||||
}
|
}
|
||||||
sanity++;
|
sanity++;
|
||||||
}
|
}
|
||||||
while(!this.worldObj.isAirBlock((int)this.posX,(int)jumpHeight+6 , (int)this.posZ)&&sanity<20);
|
while(!this.worldObj.isAirBlock((int)this.posX,(int)jumpHeight+6 , (int)this.posZ)&&sanity<20);
|
||||||
this.hasJumped=true;
|
this.hasJumped=true;
|
||||||
|
|
||||||
this.setLocationAndAngles(this.posX,jumpHeight , this.posZ, this.rotationPitch, this.rotationYaw);
|
this.setLocationAndAngles(this.posX,jumpHeight , this.posZ, this.rotationPitch, this.rotationYaw);
|
||||||
PacketDispatcher.sendPacketToAllInDimension(new Packet34EntityTeleport(this), this.worldObj.provider.dimensionId);
|
PacketDispatcher.sendPacketToAllInDimension(new Packet34EntityTeleport(this), this.worldObj.provider.dimensionId);
|
||||||
this.worldObj.updateEntity(this);
|
this.worldObj.updateEntity(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onEntityUpdate();
|
super.onEntityUpdate();
|
||||||
|
|
||||||
if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock())
|
if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock())
|
||||||
{
|
{
|
||||||
this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
|
this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
|
||||||
this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
|
this.pushOutOfBlocks(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
|
||||||
this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
|
this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D);
|
||||||
this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
|
this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -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;
|
||||||
@@ -213,10 +208,10 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
if(!(this.worldObj.provider instanceof LimboProvider || this.worldObj.getClosestPlayerToEntity(this, 5)!=null)||this.aggro>300)
|
if(!(this.worldObj.provider instanceof LimboProvider || this.worldObj.getClosestPlayerToEntity(this, 5)!=null)||this.aggro>300)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0; i < -1+this.textureState/2; ++i)
|
for (int i = 0; i < -1+this.textureState/2; ++i)
|
||||||
{
|
{
|
||||||
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, entityPlayer.posY + this.rand.nextDouble() * (double)entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * (double)entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
entityPlayer.worldObj.spawnParticle("portal", entityPlayer.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, entityPlayer.posY + this.rand.nextDouble() * (double)entityPlayer.height - 0.75D, entityPlayer.posZ + (this.rand.nextDouble() - 0.5D) * (double)entityPlayer.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -290,11 +285,11 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
|
|
||||||
|
|
||||||
this.textureState= (byte) (this.aggro/25);
|
this.textureState= (byte) (this.aggro/25);
|
||||||
if(!this.worldObj.isRemote)
|
if(!this.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.dataWatcher.updateObject(16, Byte.valueOf(this.textureState));
|
this.dataWatcher.updateObject(16, Byte.valueOf(this.textureState));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -302,130 +297,130 @@ public class MobObelisk extends EntityFlying implements IMob
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public boolean getCanSpawnHere()
|
public boolean getCanSpawnHere()
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldAttackPlayer(EntityPlayer par1EntityPlayer)
|
private boolean shouldAttackPlayer(EntityPlayer par1EntityPlayer)
|
||||||
{
|
{
|
||||||
return par1EntityPlayer.canEntityBeSeen(this);
|
return par1EntityPlayer.canEntityBeSeen(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
|
private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
|
||||||
{
|
{
|
||||||
double d4 = (par1 - this.posX) / par7;
|
double d4 = (par1 - this.posX) / par7;
|
||||||
double d5 = (par3 - this.posY) / par7;
|
double d5 = (par3 - this.posY) / par7;
|
||||||
double d6 = (par5 - this.posZ) / par7;
|
double d6 = (par5 - this.posZ) / par7;
|
||||||
AxisAlignedBB axisalignedbb = this.boundingBox.copy();
|
AxisAlignedBB axisalignedbb = this.boundingBox.copy();
|
||||||
|
|
||||||
for (int i = 1; (double)i < par7; ++i)
|
for (int i = 1; (double)i < par7; ++i)
|
||||||
{
|
{
|
||||||
axisalignedbb.offset(d4, d5, d6);
|
axisalignedbb.offset(d4, d5, d6);
|
||||||
|
|
||||||
if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
|
if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
|
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
|
||||||
{
|
{
|
||||||
if(!(par1DamageSource==DamageSource.inWall))
|
if(!(par1DamageSource==DamageSource.inWall))
|
||||||
{
|
{
|
||||||
this.aggro=400;
|
this.aggro=400;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void faceEntity(Entity par1Entity, float par2, float par3)
|
public void faceEntity(Entity par1Entity, float par2, float par3)
|
||||||
{
|
{
|
||||||
double d0 = par1Entity.posX - this.posX;
|
double d0 = par1Entity.posX - this.posX;
|
||||||
double d1 = par1Entity.posZ - this.posZ;
|
double d1 = par1Entity.posZ - this.posZ;
|
||||||
double d2;
|
double d2;
|
||||||
|
|
||||||
if (par1Entity instanceof EntityLiving)
|
if (par1Entity instanceof EntityLiving)
|
||||||
{
|
{
|
||||||
EntityLiving entityliving = (EntityLiving)par1Entity;
|
EntityLiving entityliving = (EntityLiving)par1Entity;
|
||||||
d2 = entityliving.posY + (double)entityliving.getEyeHeight() - (this.posY + (double)this.getEyeHeight());
|
d2 = entityliving.posY + (double)entityliving.getEyeHeight() - (this.posY + (double)this.getEyeHeight());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
d2 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) - (this.posY + (double)this.getEyeHeight());
|
d2 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) - (this.posY + (double)this.getEyeHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1);
|
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1);
|
||||||
float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
|
float f2 = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
|
||||||
float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI));
|
float f3 = (float)(-(Math.atan2(d2, d3) * 180.0D / Math.PI));
|
||||||
this.rotationPitch = f3;
|
this.rotationPitch = f3;
|
||||||
this.rotationYaw = f2;
|
this.rotationYaw = f2;
|
||||||
|
|
||||||
this.rotationYaw = f2;
|
this.rotationYaw = f2;
|
||||||
this.rotationYawHead=f2;
|
this.rotationYawHead=f2;
|
||||||
this.renderYawOffset=this.rotationYaw;
|
this.renderYawOffset=this.rotationYaw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private float updateRotation(float par1, float par2, float par3)
|
private float updateRotation(float par1, float par2, float par3)
|
||||||
{
|
{
|
||||||
float f3 = MathHelper.wrapAngleTo180_float(par2 - par1);
|
float f3 = MathHelper.wrapAngleTo180_float(par2 - par1);
|
||||||
|
|
||||||
if (f3 > par3)
|
if (f3 > par3)
|
||||||
{
|
{
|
||||||
f3 = par3;
|
f3 = par3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f3 < -par3)
|
if (f3 < -par3)
|
||||||
{
|
{
|
||||||
f3 = -par3;
|
f3 = -par3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1 + f3;
|
return par1 + f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getRotationYawHead()
|
public float getRotationYawHead()
|
||||||
{
|
{
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(par1NBTTagCompound);
|
super.writeEntityToNBT(par1NBTTagCompound);
|
||||||
par1NBTTagCompound.setFloat("soundTime", this.soundTime);
|
par1NBTTagCompound.setFloat("soundTime", this.soundTime);
|
||||||
par1NBTTagCompound.setInteger("aggro", this.aggro);
|
par1NBTTagCompound.setInteger("aggro", this.aggro);
|
||||||
par1NBTTagCompound.setInteger("aggroMax", this.aggroMax);
|
par1NBTTagCompound.setInteger("aggroMax", this.aggroMax);
|
||||||
par1NBTTagCompound.setByte("textureState", this.textureState);
|
par1NBTTagCompound.setByte("textureState", this.textureState);
|
||||||
par1NBTTagCompound.setBoolean("hasJumped", this.hasJumped);
|
par1NBTTagCompound.setBoolean("hasJumped", this.hasJumped);
|
||||||
par1NBTTagCompound.setFloat("scaleFactor", this.scaleFactor);
|
par1NBTTagCompound.setFloat("scaleFactor", this.scaleFactor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(par1NBTTagCompound);
|
super.readEntityFromNBT(par1NBTTagCompound);
|
||||||
this.soundTime=par1NBTTagCompound.getFloat("soundTime");
|
this.soundTime=par1NBTTagCompound.getFloat("soundTime");
|
||||||
this.aggro=par1NBTTagCompound.getInteger("aggro");
|
this.aggro=par1NBTTagCompound.getInteger("aggro");
|
||||||
this.aggroMax=par1NBTTagCompound.getInteger("aggroMax");
|
this.aggroMax=par1NBTTagCompound.getInteger("aggroMax");
|
||||||
this.textureState=par1NBTTagCompound.getByte("textureState");
|
this.textureState=par1NBTTagCompound.getByte("textureState");
|
||||||
this.hasJumped=par1NBTTagCompound.getBoolean("hasJumped");
|
this.hasJumped=par1NBTTagCompound.getBoolean("hasJumped");
|
||||||
this.scaleFactor=par1NBTTagCompound.getFloat("scaleFactor");
|
this.scaleFactor=par1NBTTagCompound.getFloat("scaleFactor");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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,111 +29,111 @@ 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;
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
/** A NoiseGeneratorOctaves used in generating terrain */
|
||||||
private NoiseGeneratorOctaves noiseGen2;
|
private NoiseGeneratorOctaves noiseGen2;
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
/** A NoiseGeneratorOctaves used in generating terrain */
|
||||||
private NoiseGeneratorOctaves noiseGen3;
|
private NoiseGeneratorOctaves noiseGen3;
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
/** A NoiseGeneratorOctaves used in generating terrain */
|
||||||
private NoiseGeneratorOctaves noiseGen4;
|
private NoiseGeneratorOctaves noiseGen4;
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
/** A NoiseGeneratorOctaves used in generating terrain */
|
||||||
public NoiseGeneratorOctaves noiseGen5;
|
public NoiseGeneratorOctaves noiseGen5;
|
||||||
|
|
||||||
public World world;
|
public World world;
|
||||||
private final byte[] field_82700_c = new byte[256];
|
private final byte[] field_82700_c = new byte[256];
|
||||||
private final byte[] field_82698_d = new byte[256];
|
private final byte[] field_82698_d = new byte[256];
|
||||||
|
|
||||||
/** A NoiseGeneratorOctaves used in generating terrain */
|
/** A NoiseGeneratorOctaves used in generating terrain */
|
||||||
public NoiseGeneratorOctaves noiseGen6;
|
public NoiseGeneratorOctaves noiseGen6;
|
||||||
public NoiseGeneratorOctaves mobSpawnerNoise;
|
public NoiseGeneratorOctaves mobSpawnerNoise;
|
||||||
|
|
||||||
/** Reference to the World object. */
|
/** Reference to the World object. */
|
||||||
private World worldObj;
|
private World worldObj;
|
||||||
|
|
||||||
/** are map structures going to be generated (e.g. strongholds) */
|
/** are map structures going to be generated (e.g. strongholds) */
|
||||||
private final boolean mapFeaturesEnabled = false;
|
private final boolean mapFeaturesEnabled = false;
|
||||||
|
|
||||||
/** Holds the overall noise array used in chunk generation */
|
/** Holds the overall noise array used in chunk generation */
|
||||||
private double[] noiseArray;
|
private double[] noiseArray;
|
||||||
private double[] stoneNoise = new double[256];
|
private double[] stoneNoise = new double[256];
|
||||||
private MapGenBase caveGenerator = new CustomCaveGen();
|
private MapGenBase caveGenerator = new CustomCaveGen();
|
||||||
|
|
||||||
/** Holds Stronghold Generator */
|
/** Holds Stronghold Generator */
|
||||||
private MapGenStronghold strongholdGenerator = new MapGenStronghold();
|
private MapGenStronghold strongholdGenerator = new MapGenStronghold();
|
||||||
|
|
||||||
/** Holds Village Generator */
|
/** Holds Village Generator */
|
||||||
private MapGenVillage villageGenerator = new MapGenVillage();
|
private MapGenVillage villageGenerator = new MapGenVillage();
|
||||||
|
|
||||||
/** Holds Mineshaft Generator */
|
/** Holds Mineshaft Generator */
|
||||||
private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
|
private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
|
||||||
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
|
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
|
||||||
|
|
||||||
/** Holds ravine generator */
|
/** Holds ravine generator */
|
||||||
private MapGenBase ravineGenerator = new MapGenRavine();
|
private MapGenBase ravineGenerator = new MapGenRavine();
|
||||||
|
|
||||||
/** The biomes that are used to generate the chunk */
|
/** The biomes that are used to generate the chunk */
|
||||||
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
|
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen3 */
|
/** A double array that hold terrain noise from noiseGen3 */
|
||||||
double[] noise3;
|
double[] noise3;
|
||||||
|
|
||||||
/** A double array that hold terrain noise */
|
/** A double array that hold terrain noise */
|
||||||
double[] noise1;
|
double[] noise1;
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen2 */
|
/** A double array that hold terrain noise from noiseGen2 */
|
||||||
double[] noise2;
|
double[] noise2;
|
||||||
|
|
||||||
/** A double array that hold terrain noise from noiseGen5 */
|
/** A double array that hold terrain noise from noiseGen5 */
|
||||||
double[] noise5;
|
double[] noise5;
|
||||||
|
|
||||||
/** A double array that holds terrain noise from noiseGen6 */
|
/** A double array that holds terrain noise from noiseGen6 */
|
||||||
double[] noise6;
|
double[] noise6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to store the 5x5 parabolic field that is used during terrain generation.
|
* Used to store the 5x5 parabolic field that is used during terrain generation.
|
||||||
*/
|
*/
|
||||||
float[] parabolicField;
|
float[] parabolicField;
|
||||||
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);
|
||||||
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); //base terrain
|
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); //base terrain
|
||||||
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); //hillyness
|
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); //hillyness
|
||||||
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 80); //seems to adjust the size of features, how stretched things are -default 8
|
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 80); //seems to adjust the size of features, how stretched things are -default 8
|
||||||
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
|
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
|
||||||
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
|
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
|
||||||
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
|
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
|
||||||
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
|
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
|
||||||
|
|
||||||
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
|
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
|
||||||
// noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
|
// noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
|
||||||
this.noiseGen1 = noiseGens[0];
|
this.noiseGen1 = noiseGens[0];
|
||||||
this.noiseGen2 = noiseGens[1];
|
this.noiseGen2 = noiseGens[1];
|
||||||
this.noiseGen3 = noiseGens[2];
|
this.noiseGen3 = noiseGens[2];
|
||||||
this.noiseGen4 = noiseGens[3];
|
this.noiseGen4 = noiseGens[3];
|
||||||
this.noiseGen5 = noiseGens[4];
|
this.noiseGen5 = noiseGens[4];
|
||||||
this.noiseGen6 = noiseGens[5];
|
this.noiseGen6 = noiseGens[5];
|
||||||
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
|
||||||
@@ -142,27 +143,27 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
|
public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Chunk provideChunk(int par1, int par2)
|
public Chunk provideChunk(int par1, int par2)
|
||||||
{
|
{
|
||||||
this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
|
this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
|
||||||
byte[] var3 = new byte[32768];
|
byte[] var3 = new byte[32768];
|
||||||
this.generateTerrain(par1, par2, var3);
|
this.generateTerrain(par1, par2, var3);
|
||||||
this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
|
this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
|
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
|
||||||
|
|
||||||
|
|
||||||
var4.generateSkylightMap();
|
var4.generateSkylightMap();
|
||||||
return var4;
|
return var4;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Chunk loadChunk(int var1, int var2) {
|
public Chunk loadChunk(int var1, int var2) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
@@ -181,227 +182,227 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return super.saveChunks(var1, var2);
|
return super.saveChunks(var1, var2);
|
||||||
}
|
}
|
||||||
private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)
|
private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)
|
||||||
{
|
{
|
||||||
ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);
|
ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);
|
||||||
MinecraftForge.EVENT_BUS.post(event);
|
MinecraftForge.EVENT_BUS.post(event);
|
||||||
if (event.getResult() == Result.DENY) return event.noisefield;
|
if (event.getResult() == Result.DENY) return event.noisefield;
|
||||||
|
|
||||||
if (par1ArrayOfDouble == null)
|
if (par1ArrayOfDouble == null)
|
||||||
{
|
{
|
||||||
par1ArrayOfDouble = new double[par5 * par6 * par7];
|
par1ArrayOfDouble = new double[par5 * par6 * par7];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.parabolicField == null)
|
if (this.parabolicField == null)
|
||||||
{
|
{
|
||||||
this.parabolicField = new float[25];
|
this.parabolicField = new float[25];
|
||||||
|
|
||||||
for (int var8 = -2; var8 <= 2; ++var8)
|
for (int var8 = -2; var8 <= 2; ++var8)
|
||||||
{
|
{
|
||||||
for (int var9 = -2; var9 <= 2; ++var9)
|
for (int var9 = -2; var9 <= 2; ++var9)
|
||||||
{
|
{
|
||||||
float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
|
float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
|
||||||
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
|
this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double var44 = 884.412D; //large values here create spiky land. add a 0, good -default 884
|
double var44 = 884.412D; //large values here create spiky land. add a 0, good -default 884
|
||||||
double var45 = 9840.412D; //large values here make sheets- default - 684
|
double var45 = 9840.412D; //large values here make sheets- default - 684
|
||||||
this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
|
this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
|
||||||
this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
|
this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
|
||||||
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
|
this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
|
||||||
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
||||||
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
|
||||||
boolean var43 = false;
|
boolean var43 = false;
|
||||||
boolean var42 = false;
|
boolean var42 = false;
|
||||||
int var12 = 0;
|
int var12 = 0;
|
||||||
int var13 = 0;
|
int var13 = 0;
|
||||||
|
|
||||||
for (int var14 = 0; var14 < par5; ++var14)
|
for (int var14 = 0; var14 < par5; ++var14)
|
||||||
{
|
{
|
||||||
for (int var15 = 0; var15 < par7; ++var15)
|
for (int var15 = 0; var15 < par7; ++var15)
|
||||||
{
|
{
|
||||||
float var16 = 0.0F;
|
float var16 = 0.0F;
|
||||||
float var17 = 0.0F;
|
float var17 = 0.0F;
|
||||||
float var18 = 0.0F;
|
float var18 = 0.0F;
|
||||||
byte var19 = 2;
|
byte var19 = 2;
|
||||||
BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
|
BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
|
||||||
|
|
||||||
for (int var21 = -var19; var21 <= var19; ++var21)
|
for (int var21 = -var19; var21 <= var19; ++var21)
|
||||||
{
|
{
|
||||||
for (int var22 = -var19; var22 <= var19; ++var22)
|
for (int var22 = -var19; var22 <= var19; ++var22)
|
||||||
{
|
{
|
||||||
float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (BiomeGenBase.plains.minHeight + 9.0F);
|
float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (BiomeGenBase.plains.minHeight + 9.0F);
|
||||||
|
|
||||||
|
|
||||||
//this adjusts the height of the terrain
|
//this adjusts the height of the terrain
|
||||||
|
|
||||||
var16 += BiomeGenBase.plains.maxHeight * var24+4;
|
var16 += BiomeGenBase.plains.maxHeight * var24+4;
|
||||||
var17 += BiomeGenBase.plains.minHeight * var24-1;
|
var17 += BiomeGenBase.plains.minHeight * var24-1;
|
||||||
var18 += var24;
|
var18 += var24;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var16 /= var18;
|
var16 /= var18;
|
||||||
var17 /= var18;
|
var17 /= var18;
|
||||||
var16 = (var16 * 0.9F + 0.1F);
|
var16 = (var16 * 0.9F + 0.1F);
|
||||||
var17 = (var17 * 4.0F - 1.0F) / 8.0F;
|
var17 = (var17 * 4.0F - 1.0F) / 8.0F;
|
||||||
double var47 = this.noise6[var13] / 8000.0D;
|
double var47 = this.noise6[var13] / 8000.0D;
|
||||||
|
|
||||||
if (var47 < 0.0D)
|
if (var47 < 0.0D)
|
||||||
{
|
{
|
||||||
var47 = -var47 * 0.3D;
|
var47 = -var47 * 0.3D;
|
||||||
}
|
}
|
||||||
|
|
||||||
var47 = var47 * 3.0D - 2.0D;
|
var47 = var47 * 3.0D - 2.0D;
|
||||||
|
|
||||||
if (var47 < 0.0D)
|
if (var47 < 0.0D)
|
||||||
{
|
{
|
||||||
var47 /= 2.0D;
|
var47 /= 2.0D;
|
||||||
|
|
||||||
if (var47 < -1.0D)
|
if (var47 < -1.0D)
|
||||||
{
|
{
|
||||||
var47 = -1.0D;
|
var47 = -1.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
var47 /= 1.4D;
|
var47 /= 1.4D;
|
||||||
var47 /= 2.0D;
|
var47 /= 2.0D;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (var47 > 1.0D)
|
if (var47 > 1.0D)
|
||||||
{
|
{
|
||||||
var47 = 1.0D;
|
var47 = 1.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
var47 /= 8.0D;
|
var47 /= 8.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
++var13;
|
++var13;
|
||||||
|
|
||||||
for (int var46 = 0; var46 < par6; ++var46)
|
for (int var46 = 0; var46 < par6; ++var46)
|
||||||
{
|
{
|
||||||
double var48 = (double)var17;
|
double var48 = (double)var17;
|
||||||
double var26 = (double)var16;
|
double var26 = (double)var16;
|
||||||
var48 += var47 * 0.2D;
|
var48 += var47 * 0.2D;
|
||||||
var48 = var48 * (double)par6 / 16.0D;
|
var48 = var48 * (double)par6 / 16.0D;
|
||||||
double var28 = (double)par6 / 2.0D + var48 * 4.0D;
|
double var28 = (double)par6 / 2.0D + var48 * 4.0D;
|
||||||
double var30 = 0.0D;
|
double var30 = 0.0D;
|
||||||
double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
|
||||||
|
|
||||||
if (var32 < 0.0D)
|
if (var32 < 0.0D)
|
||||||
{
|
{
|
||||||
var32 *= 4.0D;
|
var32 *= 4.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
double var34 = this.noise1[var12] / 512.0D;
|
double var34 = this.noise1[var12] / 512.0D;
|
||||||
double var36 = this.noise2[var12] / 512.0D;
|
double var36 = this.noise2[var12] / 512.0D;
|
||||||
double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
|
double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
|
||||||
|
|
||||||
if (var38 < 0.0D)
|
if (var38 < 0.0D)
|
||||||
{
|
{
|
||||||
var30 = var34;
|
var30 = var34;
|
||||||
}
|
}
|
||||||
else if (var38 > 1.0D)
|
else if (var38 > 1.0D)
|
||||||
{
|
{
|
||||||
var30 = var36;
|
var30 = var36;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var30 = var34 + (var36 - var34) * var38;
|
var30 = var34 + (var36 - var34) * var38;
|
||||||
}
|
}
|
||||||
|
|
||||||
var30 -= var32;
|
var30 -= var32;
|
||||||
|
|
||||||
if (var46 > par6 - 4)
|
if (var46 > par6 - 4)
|
||||||
{
|
{
|
||||||
double var40 = (double)((float)(var46 - (par6 - 4)) / 3.0F);
|
double var40 = (double)((float)(var46 - (par6 - 4)) / 3.0F);
|
||||||
var30 = var30 * (1.0D - var40) + -10.0D * var40;
|
var30 = var30 * (1.0D - var40) + -10.0D * var40;
|
||||||
}
|
}
|
||||||
|
|
||||||
par1ArrayOfDouble[var12] = var30;
|
par1ArrayOfDouble[var12] = var30;
|
||||||
++var12;
|
++var12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1ArrayOfDouble;
|
return par1ArrayOfDouble;
|
||||||
}
|
}
|
||||||
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
|
||||||
{
|
{
|
||||||
byte var4 = 4;
|
byte var4 = 4;
|
||||||
byte var5 = 16;
|
byte var5 = 16;
|
||||||
byte var6 = 19;
|
byte var6 = 19;
|
||||||
int var7 = var4 + 1;
|
int var7 = var4 + 1;
|
||||||
byte var8 = 17;
|
byte var8 = 17;
|
||||||
int var9 = var4 + 1;
|
int var9 = var4 + 1;
|
||||||
this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5);
|
this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5);
|
||||||
this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9);
|
this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9);
|
||||||
|
|
||||||
for (int var10 = 0; var10 < var4; ++var10)
|
for (int var10 = 0; var10 < var4; ++var10)
|
||||||
{
|
{
|
||||||
for (int var11 = 0; var11 < var4; ++var11)
|
for (int var11 = 0; var11 < var4; ++var11)
|
||||||
{
|
{
|
||||||
for (int var12 = 0; var12 < var5; ++var12)
|
for (int var12 = 0; var12 < var5; ++var12)
|
||||||
{
|
{
|
||||||
double var13 = 0.125D;
|
double var13 = 0.125D;
|
||||||
double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0];
|
double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0];
|
||||||
double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0];
|
double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0];
|
||||||
double var19 = this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 0];
|
double var19 = this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 0];
|
||||||
double var21 = this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 0];
|
double var21 = this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 0];
|
||||||
double var23 = (this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 1] - var15) * var13;
|
double var23 = (this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 1] - var15) * var13;
|
||||||
double var25 = (this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 1] - var17) * var13;
|
double var25 = (this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 1] - var17) * var13;
|
||||||
double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13;
|
double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13;
|
||||||
double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13;
|
double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13;
|
||||||
|
|
||||||
for (int var31 = 0; var31 < 8; ++var31)
|
for (int var31 = 0; var31 < 8; ++var31)
|
||||||
{
|
{
|
||||||
double var32 = 0.25D;
|
double var32 = 0.25D;
|
||||||
double var34 = var15;
|
double var34 = var15;
|
||||||
double var36 = var17;
|
double var36 = var17;
|
||||||
double var38 = (var19 - var15) * var32;
|
double var38 = (var19 - var15) * var32;
|
||||||
double var40 = (var21 - var17) * var32;
|
double var40 = (var21 - var17) * var32;
|
||||||
|
|
||||||
for (int var42 = 0; var42 < 4; ++var42)
|
for (int var42 = 0; var42 < 4; ++var42)
|
||||||
{
|
{
|
||||||
int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31;
|
int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31;
|
||||||
short var44 = 128;
|
short var44 = 128;
|
||||||
var43 -= var44;
|
var43 -= var44;
|
||||||
double var45 = 0.25D;
|
double var45 = 0.25D;
|
||||||
double var49 = (var36 - var34) * var45;
|
double var49 = (var36 - var34) * var45;
|
||||||
double var47 = var34 - var49;
|
double var47 = var34 - var49;
|
||||||
|
|
||||||
for (int var51 = 0; var51 < 4; ++var51)
|
for (int var51 = 0; var51 < 4; ++var51)
|
||||||
{
|
{
|
||||||
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
|
||||||
{
|
{
|
||||||
par3ArrayOfByte[var43 += var44] = 0;
|
par3ArrayOfByte[var43 += var44] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var34 += var38;
|
var34 += var38;
|
||||||
var36 += var40;
|
var36 += var40;
|
||||||
}
|
}
|
||||||
|
|
||||||
var15 += var23;
|
var15 += var23;
|
||||||
var17 += var25;
|
var17 += var25;
|
||||||
var19 += var27;
|
var19 += var27;
|
||||||
var21 += var29;
|
var21 += var29;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -417,12 +418,12 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
|
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
|
|
||||||
BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
|
BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
|
||||||
return biomegenbase == null ? null : (biomegenbase == BiomeGenBase.swampland && par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.hasStructureAt(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : biomegenbase.getSpawnableList(par1EnumCreatureType));
|
return biomegenbase == null ? null : (biomegenbase == BiomeGenBase.swampland && par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.hasStructureAt(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : biomegenbase.getSpawnableList(par1EnumCreatureType));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChunkPosition findClosestStructure(World var1, String var2,
|
public ChunkPosition findClosestStructure(World var1, String var2,
|
||||||
|
|||||||
@@ -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,182 +8,175 @@ 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();
|
||||||
|
if (properties == null)
|
||||||
this.skyRenderer =new limboSkyProvider();
|
properties = DDProperties.instance();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IRenderHandler getSkyRenderer()
|
public IRenderHandler getSkyRenderer()
|
||||||
{
|
{
|
||||||
return this.skyRenderer;
|
return this.skyRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void registerWorldChunkManager()
|
|
||||||
{
|
|
||||||
super.worldChunkMgr = new WorldChunkManagerHell(mod_pocketDim.limboBiome,1,1);
|
|
||||||
//this.dimensionId = ConfigAtum.dimensionID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BiomeGenBase getBiomeGenForCoords(int x, int z)
|
protected void registerWorldChunkManager()
|
||||||
|
{
|
||||||
|
super.worldChunkMgr = new WorldChunkManagerHell(mod_pocketDim.limboBiome,1,1);
|
||||||
|
//this.dimensionId = ConfigAtum.dimensionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BiomeGenBase getBiomeGenForCoords(int x, int z)
|
||||||
|
{
|
||||||
|
return mod_pocketDim.limboBiome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canRespawnHere()
|
||||||
|
{
|
||||||
|
return properties.HardcoreLimboEnabled && properties.LimboEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBlockHighHumidity(int x, int y, int z)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canSnowAt(int x, int y, int z)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void generateLightBrightnessTable()
|
||||||
|
{
|
||||||
|
float modifier = 0.0F;
|
||||||
|
|
||||||
|
for (int steps = 0; steps <= 15; ++steps)
|
||||||
{
|
{
|
||||||
return mod_pocketDim.limboBiome;
|
float var3 = 1.0F - (float)steps / 15.0F;
|
||||||
|
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
||||||
|
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChunkCoordinates getSpawnPoint()
|
||||||
|
{
|
||||||
|
|
||||||
|
return this.getRandomizedSpawnPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
public float calculateCelestialAngle(long par1, float par3)
|
||||||
|
{
|
||||||
|
int var4 = (int)(par1 % 24000L);
|
||||||
|
float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
|
||||||
|
|
||||||
|
if (var5 < 0.0F)
|
||||||
|
{
|
||||||
|
++var5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canRespawnHere()
|
if (var5 > 1.0F)
|
||||||
{
|
{
|
||||||
|
--var5;
|
||||||
|
}
|
||||||
|
|
||||||
return mod_pocketDim.hardcoreLimbo&&mod_pocketDim.isLimboActive;
|
float var6 = var5;
|
||||||
}
|
var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D);
|
||||||
public boolean isBlockHighHumidity(int x, int y, int z)
|
var5 = var6 + (var5 - var6) / 3.0F;
|
||||||
{
|
return 0;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public int getMoonPhase(long par1, float par3)
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean canSnowAt(int x, int y, int z)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void generateLightBrightnessTable()
|
|
||||||
{
|
|
||||||
float modifier = 0.0F;
|
|
||||||
|
|
||||||
for (int steps = 0; steps <= 15; ++steps)
|
|
||||||
{
|
|
||||||
float var3 = 1.0F - (float)steps / 15.0F;
|
|
||||||
this.lightBrightnessTable[steps] = ((0.0F + var3) / (var3 * 3.0F + 1.0F) * (1.0F - modifier) + modifier)*3;
|
|
||||||
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChunkCoordinates getSpawnPoint()
|
|
||||||
{
|
|
||||||
|
|
||||||
return this.getRandomizedSpawnPoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
public float calculateCelestialAngle(long par1, float par3)
|
|
||||||
{
|
|
||||||
int var4 = (int)(par1 % 24000L);
|
|
||||||
float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
|
|
||||||
|
|
||||||
if (var5 < 0.0F)
|
|
||||||
{
|
|
||||||
++var5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (var5 > 1.0F)
|
|
||||||
{
|
|
||||||
--var5;
|
|
||||||
}
|
|
||||||
|
|
||||||
float var6 = var5;
|
|
||||||
var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D);
|
|
||||||
var5 = var6 + (var5 - var6) / 3.0F;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public int getMoonPhase(long par1, float par3)
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
@Override
|
||||||
public String getSaveFolder()
|
public String getSaveFolder()
|
||||||
{
|
{
|
||||||
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
|
return (dimensionId == 0 ? null : "DimensionalDoors/Limbo" + dimensionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
||||||
{
|
{
|
||||||
return worldObj.getHeight()/4-800;
|
return worldObj.getHeight()/4-800;
|
||||||
}
|
}
|
||||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
||||||
{
|
{
|
||||||
setCloudRenderer( new CloudRenderBlank());
|
setCloudRenderer( new CloudRenderBlank());
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
||||||
|
|
||||||
}
|
}
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public Vec3 getFogColor(float par1, float par2)
|
public Vec3 getFogColor(float par1, float par2)
|
||||||
{
|
{
|
||||||
return this.worldObj.getWorldVec3Pool().getVecFromPool((double).2, (double).2, (double).2);
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double).2, (double).2, (double).2);
|
||||||
|
|
||||||
}
|
}
|
||||||
public int getRespawnDimension(EntityPlayerMP player)
|
public int getRespawnDimension(EntityPlayerMP player)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IChunkProvider createChunkGenerator()
|
public IChunkProvider createChunkGenerator()
|
||||||
{
|
{
|
||||||
return new LimboGenerator(worldObj, 45);
|
return new LimboGenerator(worldObj, 45);
|
||||||
}
|
}
|
||||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ChunkCoordinates getRandomizedSpawnPoint()
|
|
||||||
{
|
|
||||||
ChunkCoordinates var5 = new ChunkCoordinates(0,0,0);
|
|
||||||
|
|
||||||
|
|
||||||
int spawnFuzz = 10000;
|
|
||||||
int spawnFuzzHalf = spawnFuzz / 2;
|
|
||||||
|
|
||||||
{
|
|
||||||
var5.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
|
||||||
var5.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
|
||||||
var5.posY = 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
return var5;
|
|
||||||
|
|
||||||
|
|
||||||
|
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChunkCoordinates getRandomizedSpawnPoint()
|
||||||
|
{
|
||||||
|
ChunkCoordinates var5 = new ChunkCoordinates(0,0,0);
|
||||||
|
|
||||||
|
|
||||||
|
int spawnFuzz = 10000;
|
||||||
|
int spawnFuzzHalf = spawnFuzz / 2;
|
||||||
|
|
||||||
|
{
|
||||||
|
var5.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||||
|
var5.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||||
|
var5.posY = 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,8 +92,7 @@ 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,16 +100,16 @@ 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
|
||||||
{
|
{
|
||||||
respawnDim= dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
|
respawnDim= dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dimHelper.getWorld(respawnDim)==null)
|
if (dimHelper.getWorld(respawnDim)==null)
|
||||||
{
|
{
|
||||||
dimHelper.initDimension(respawnDim);
|
dimHelper.initDimension(respawnDim);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,10 @@ 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
|
||||||
|
public void onPacketData(INetworkManager manager,
|
||||||
|
Packet250CustomPayload packet, Player player) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPacketData(INetworkManager manager,
|
|
||||||
Packet250CustomPayload packet, Player player) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -22,253 +23,261 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderDimRail extends TileEntitySpecialRenderer
|
public class RenderDimRail extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
|
||||||
|
|
||||||
/**
|
public RenderDimRail()
|
||||||
* Renders the dimdoor.
|
{
|
||||||
*/
|
if (properties == null)
|
||||||
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
|
properties = DDProperties.instance();
|
||||||
{
|
}
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
private static DDProperties properties = null;
|
||||||
catch(Exception e)
|
|
||||||
{
|
/**
|
||||||
e.printStackTrace();
|
* Renders the dimdoor.
|
||||||
}
|
*/
|
||||||
|
public void renderDimDoorTileEntity(TileEntityDimDoor tile, double x, double y, double z, float par8)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
float playerX = (float)this.tileEntityRenderer.playerX;
|
float playerX = (float)this.tileEntityRenderer.playerX;
|
||||||
float playerY = (float)this.tileEntityRenderer.playerY;
|
float playerY = (float)this.tileEntityRenderer.playerY;
|
||||||
float playerZ = (float)this.tileEntityRenderer.playerZ;
|
float playerZ = (float)this.tileEntityRenderer.playerZ;
|
||||||
|
|
||||||
float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
float distance = (float) tile.getDistanceFrom(playerX, playerY, playerZ);
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
Random rand = new Random(31100L);
|
Random rand = new Random(31100L);
|
||||||
float var13 = 0.75F;
|
float var13 = 0.75F;
|
||||||
|
|
||||||
for (int count = 0; count < 16; ++count)
|
for (int count = 0; count < 16; ++count)
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
float var15 = (float)(16 - count);
|
float var15 = (float)(16 - count);
|
||||||
float var16 = 0.2625F;
|
float var16 = 0.2625F;
|
||||||
float var17 = 1.0F / (var15 + 1.0F);
|
float var17 = 1.0F / (var15 + 1.0F);
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
this.bindTextureByName("/RIFT.png");
|
this.bindTextureByName("/RIFT.png");
|
||||||
var17 = 0.1F;
|
var17 = 0.1F;
|
||||||
var15 = 25.0F;
|
var15 = 25.0F;
|
||||||
var16 = 0.125F;
|
var16 = 0.125F;
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
this.bindTextureByName("/WARP.png");
|
this.bindTextureByName("/WARP.png");
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||||
var16 = .5F;
|
var16 = .5F;
|
||||||
}
|
}
|
||||||
|
|
||||||
float startY = (float)(+(y + (double)var13));
|
float startY = (float)(+(y + (double)var13));
|
||||||
float ratioY = startY + ActiveRenderInfo.objectY;
|
float ratioY = startY + ActiveRenderInfo.objectY;
|
||||||
float ratioY2 = startY + var15 + ActiveRenderInfo.objectY;
|
float ratioY2 = startY + var15 + ActiveRenderInfo.objectY;
|
||||||
float yConverted = ratioY / ratioY2;
|
float yConverted = ratioY / ratioY2;
|
||||||
|
|
||||||
float startZ = (float)(+(z + (double)var13));
|
float startZ = (float)(+(z + (double)var13));
|
||||||
float ratioZ = startZ + ActiveRenderInfo.objectZ;
|
float ratioZ = startZ + ActiveRenderInfo.objectZ;
|
||||||
float ratioZ2 = startZ + var15 + ActiveRenderInfo.objectZ;
|
float ratioZ2 = startZ + var15 + ActiveRenderInfo.objectZ;
|
||||||
float zConverted = ratioZ / ratioZ2;
|
float zConverted = ratioZ / ratioZ2;
|
||||||
|
|
||||||
float startX = (float)(+(x + (double)var13));
|
float startX = (float)(+(x + (double)var13));
|
||||||
float ratioX = startX + ActiveRenderInfo.objectX;
|
float ratioX = startX + ActiveRenderInfo.objectX;
|
||||||
float ratioX2 = startX + var15 + ActiveRenderInfo.objectX;
|
float ratioX2 = startX + var15 + ActiveRenderInfo.objectX;
|
||||||
float xConverted = ratioX / ratioX2;
|
float xConverted = ratioX / ratioX2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
yConverted += (float)(y + (double)var13);
|
yConverted += (float)(y + (double)var13);
|
||||||
xConverted += (float)(x + (double)var13);
|
xConverted += (float)(x + (double)var13);
|
||||||
zConverted += (float)(z + (double)var13);
|
zConverted += (float)(z + (double)var13);
|
||||||
|
|
||||||
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
|
GL11.glTranslatef( (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F,0, 0.0F);
|
||||||
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
|
GL11.glTranslatef(0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F, 0.0F);
|
||||||
|
|
||||||
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
GL11.glTranslatef(0,0, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F);
|
||||||
|
|
||||||
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||||
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||||
GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||||
GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
|
||||||
switch ((tile.orientation%4)+4)
|
switch ((tile.orientation%4)+4)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 1.0F, 0.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(1.0F, 0.0F, 0.0F, 0.0F));
|
||||||
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 0.0F, 1.0F));
|
||||||
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
GL11.glTexGen(GL11.GL_Q, GL11.GL_OBJECT_PLANE, this.getFloatBuffer(0.0F, 0.0F, 1.0F, 0.0F));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
|
GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
|
GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
|
GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
|
||||||
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
|
GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glLoadIdentity();
|
GL11.glLoadIdentity();
|
||||||
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
|
GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 200000L) / 200000.0F*var15, 0.0F);
|
||||||
GL11.glScalef(var16, var16, var16);
|
GL11.glScalef(var16, var16, var16);
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef((float)(count * count * 4321 + count * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||||
|
|
||||||
Tessellator var24 = Tessellator.instance;
|
Tessellator var24 = Tessellator.instance;
|
||||||
var24.startDrawingQuads();
|
var24.startDrawingQuads();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
float var21 = rand.nextFloat() * 0.5F + 0.1F;
|
||||||
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
float var22 = rand.nextFloat() * 0.4F + 0.4F;
|
||||||
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
float var23 = rand.nextFloat() * 0.6F + 0.5F;
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
var23 = 1.0F;
|
var23 = 1.0F;
|
||||||
var22 = 1.0F;
|
var22 = 1.0F;
|
||||||
yConverted = 1.0F;
|
yConverted = 1.0F;
|
||||||
}
|
}
|
||||||
var24.setColorRGBA_F(var21 * var17, var22 * var17, var23 * var17, 1.0F);
|
var24.setColorRGBA_F(var21 * var17, var22 * var17, var23 * var17, 1.0F);
|
||||||
if(tile.openOrClosed)
|
if(tile.openOrClosed)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (tile.orientation)
|
switch (tile.orientation)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
||||||
var24.addVertex(x+.01F, y-1 , z);
|
var24.addVertex(x+.01F, y-1 , z);
|
||||||
var24.addVertex(x+.01, y-1, z+1.0D);
|
var24.addVertex(x+.01, y-1, z+1.0D);
|
||||||
var24.addVertex(x+.01 , y+1 , z + 1.0D);
|
var24.addVertex(x+.01 , y+1 , z + 1.0D);
|
||||||
var24.addVertex(x+.01 , y+1 , z);
|
var24.addVertex(x+.01 , y+1 , z);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
var24.addVertex(x , y+1 , z+.01);
|
var24.addVertex(x , y+1 , z+.01);
|
||||||
var24.addVertex(x+1 , y+1 , z+.01);
|
var24.addVertex(x+1 , y+1 , z+.01);
|
||||||
var24.addVertex(x+1, y-1, z+.01);
|
var24.addVertex(x+1, y-1, z+.01);
|
||||||
var24.addVertex(x, y-1, z+.01);
|
var24.addVertex(x, y-1, z+.01);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2: //
|
case 2: //
|
||||||
var24.addVertex(x+.99 , y+1 , z);
|
var24.addVertex(x+.99 , y+1 , z);
|
||||||
var24.addVertex(x+.99 , y+1 , z + 1.0D);
|
var24.addVertex(x+.99 , y+1 , z + 1.0D);
|
||||||
var24.addVertex(x+.99, y-1, z+1.0D);
|
var24.addVertex(x+.99, y-1, z+1.0D);
|
||||||
var24.addVertex(x+.99, y-1, z);
|
var24.addVertex(x+.99, y-1, z);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
var24.addVertex(x, y-1, z+.99);
|
var24.addVertex(x, y-1, z+.99);
|
||||||
var24.addVertex(x+1, y-1, z+.99);
|
var24.addVertex(x+1, y-1, z+.99);
|
||||||
var24.addVertex(x+1 , y+1 , z+.99);
|
var24.addVertex(x+1 , y+1 , z+.99);
|
||||||
var24.addVertex(x , y+1 , z+.99);
|
var24.addVertex(x , y+1 , z+.99);
|
||||||
break;
|
break;
|
||||||
case 4://
|
case 4://
|
||||||
// GL11.glTranslatef();
|
// GL11.glTranslatef();
|
||||||
|
|
||||||
var24.addVertex(x+.15F, y-1 , z);
|
var24.addVertex(x+.15F, y-1 , z);
|
||||||
var24.addVertex(x+.15, y-1, z+1.0D);
|
var24.addVertex(x+.15, y-1, z+1.0D);
|
||||||
var24.addVertex(x+.15 , y+1 , z + 1.0D);
|
var24.addVertex(x+.15 , y+1 , z + 1.0D);
|
||||||
var24.addVertex(x+.15 , y+1 , z);
|
var24.addVertex(x+.15 , y+1 , z);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
var24.addVertex(x , y+1 , z+.15);
|
var24.addVertex(x , y+1 , z+.15);
|
||||||
var24.addVertex(x+1 , y+1 , z+.15);
|
var24.addVertex(x+1 , y+1 , z+.15);
|
||||||
var24.addVertex(x+1, y-1, z+.15);
|
var24.addVertex(x+1, y-1, z+.15);
|
||||||
var24.addVertex(x, y-1, z+.15);
|
var24.addVertex(x, y-1, z+.15);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 6: //
|
case 6: //
|
||||||
var24.addVertex(x+.85 , y+1 , z);
|
var24.addVertex(x+.85 , y+1 , z);
|
||||||
var24.addVertex(x+.85 , y+1 , z + 1.0D);
|
var24.addVertex(x+.85 , y+1 , z + 1.0D);
|
||||||
var24.addVertex(x+.85, y-1, z+1.0D);
|
var24.addVertex(x+.85, y-1, z+1.0D);
|
||||||
var24.addVertex(x+.85, y-1, z);
|
var24.addVertex(x+.85, y-1, z);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
var24.addVertex(x, y-1, z+.85);
|
var24.addVertex(x, y-1, z+.85);
|
||||||
var24.addVertex(x+1, y-1, z+.85);
|
var24.addVertex(x+1, y-1, z+.85);
|
||||||
var24.addVertex(x+1 , y+1 , z+.85);
|
var24.addVertex(x+1 , y+1 , z+.85);
|
||||||
var24.addVertex(x , y+1 , z+.85);
|
var24.addVertex(x , y+1 , z+.85);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var24.draw();
|
var24.draw();
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glDisable(GL11.GL_BLEND);
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
|
GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
|
GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
|
GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
|
GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FloatBuffer getFloatBuffer(float par1, float par2, float par3, float par4)
|
private FloatBuffer getFloatBuffer(float par1, float par2, float par3, float par4)
|
||||||
{
|
{
|
||||||
this.field_76908_a.clear();
|
this.field_76908_a.clear();
|
||||||
this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
|
this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
|
||||||
this.field_76908_a.flip();
|
this.field_76908_a.flip();
|
||||||
return this.field_76908_a;
|
return this.field_76908_a;
|
||||||
}
|
}
|
||||||
|
|
||||||
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