b11354767d
Moved all configuration variables from mod_pocketDim to DDProperties (formerly DimDoorsConfig). Changed property names to be clearer in config file, modified some comments, and generally cleaned up the config file. Fixed some missing properties and variables that were reading from the wrong properties. Modified the order in which mod_pocketDim instantiated some of its static fields so that they would load after properties are read. Almost all classes load after properties are read. Fixed indentation across various files and replaced references to properties in mod_pocketDim with references to DDProperties.
126 lines
2.8 KiB
Java
126 lines
2.8 KiB
Java
package StevenDimDoors.mod_pocketDim.world;
|
|
|
|
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
|
import net.minecraft.util.Vec3;
|
|
import net.minecraft.world.WorldProvider;
|
|
import net.minecraft.world.biome.WorldChunkManagerHell;
|
|
import net.minecraft.world.chunk.IChunkProvider;
|
|
import net.minecraftforge.common.DimensionManager;
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
public class pocketProvider extends WorldProvider
|
|
|
|
{
|
|
public int exitXCoord;
|
|
public int exitYCoord;
|
|
public int exitZCoord;
|
|
public int exitDimID;
|
|
public boolean hasNoSky = true;
|
|
|
|
public boolean isSavingSchematic= false;
|
|
public int dimToSave;
|
|
private static DDProperties properties = null;
|
|
|
|
public pocketProvider()
|
|
{
|
|
this.hasNoSky=true;
|
|
if (properties == null)
|
|
properties = DDProperties.instance();
|
|
}
|
|
|
|
@Override
|
|
protected void registerWorldChunkManager()
|
|
{
|
|
super.worldChunkMgr = new WorldChunkManagerHell(mod_pocketDim.pocketBiome,1,1);
|
|
//this.dimensionId = ConfigAtum.dimensionID;
|
|
}
|
|
@Override
|
|
public String getSaveFolder()
|
|
{
|
|
return (dimensionId == 0 ? null : "DimensionalDoors/pocketDimID" + dimensionId);
|
|
}
|
|
|
|
public void saveAsSchematic(int id)
|
|
{
|
|
this.isSavingSchematic=true;
|
|
this.dimensionId=id;
|
|
|
|
}
|
|
|
|
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
|
{
|
|
setCloudRenderer( new CloudRenderBlank());
|
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
@Override
|
|
public Vec3 getFogColor(float par1, float par2)
|
|
{
|
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
|
|
|
}
|
|
@Override
|
|
public double getHorizon()
|
|
{
|
|
return worldObj.getHeight();
|
|
}
|
|
@Override
|
|
public IChunkProvider createChunkGenerator()
|
|
{
|
|
return new pocketGenerator(worldObj, dimensionId, false);
|
|
}
|
|
@Override
|
|
public boolean canSnowAt(int x, int y, int z)
|
|
{
|
|
return false;
|
|
}
|
|
public boolean canBlockFreeze(int x, int y, int z, boolean byWater)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public String getDimensionName()
|
|
{
|
|
return "PocketDim " + this.dimensionId;
|
|
}
|
|
|
|
|
|
public int getRespawnDimension(EntityPlayerMP player)
|
|
{
|
|
int respawnDim;
|
|
|
|
if (properties.LimboEnabled)
|
|
{
|
|
respawnDim = properties.LimboDimensionID;
|
|
}
|
|
else
|
|
{
|
|
respawnDim= dimHelper.dimList.get(this.dimensionId).exitDimLink.destDimID;
|
|
}
|
|
|
|
if (dimHelper.getWorld(respawnDim)==null)
|
|
{
|
|
dimHelper.initDimension(respawnDim);
|
|
}
|
|
return respawnDim;
|
|
}
|
|
|
|
public boolean canRespawnHere()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
}
|