2013-06-02 03:43:56 +02:00
|
|
|
package StevenDimDoors.mod_pocketDim.world;
|
2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
|
|
|
import net.minecraft.util.Vec3;
|
|
|
|
import net.minecraft.world.WorldProvider;
|
2013-05-10 22:05:11 +02:00
|
|
|
import net.minecraft.world.biome.WorldChunkManagerHell;
|
2013-02-18 03:46:16 +01:00
|
|
|
import net.minecraft.world.chunk.IChunkProvider;
|
2013-07-26 11:15:44 +02:00
|
|
|
import StevenDimDoors.mod_pocketDim.CloudRenderBlank;
|
|
|
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
|
|
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
|
|
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
|
|
|
import StevenDimDoors.mod_pocketDim.ticking.MonolithSpawner;
|
2013-02-18 03:46:16 +01:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
2013-07-26 11:31:59 +02:00
|
|
|
public class PocketProvider extends WorldProvider
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
|
|
|
public int exitXCoord;
|
|
|
|
public int exitYCoord;
|
|
|
|
public int exitZCoord;
|
|
|
|
public int exitDimID;
|
|
|
|
public boolean hasNoSky = true;
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-06-02 03:43:56 +02:00
|
|
|
public boolean isSavingSchematic= false;
|
|
|
|
public int dimToSave;
|
2013-07-26 11:15:44 +02:00
|
|
|
private DDProperties properties;
|
|
|
|
private MonolithSpawner spawner;
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-07-26 11:31:59 +02:00
|
|
|
public PocketProvider()
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
2013-07-26 11:15:44 +02:00
|
|
|
this.hasNoSky = true;
|
|
|
|
this.spawner = mod_pocketDim.spawner;
|
|
|
|
this.properties = mod_pocketDim.properties;
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-05-27 14:10:07 +02:00
|
|
|
@Override
|
2013-06-16 15:57:51 +02:00
|
|
|
protected void registerWorldChunkManager()
|
|
|
|
{
|
2013-05-27 14:10:07 +02:00
|
|
|
super.worldChunkMgr = new WorldChunkManagerHell(mod_pocketDim.pocketBiome,1,1);
|
2013-06-16 15:57:51 +02:00
|
|
|
//this.dimensionId = ConfigAtum.dimensionID;
|
|
|
|
}
|
|
|
|
|
2013-02-18 03:46:16 +01:00
|
|
|
@Override
|
|
|
|
public String getSaveFolder()
|
2013-06-16 15:57:51 +02:00
|
|
|
{
|
|
|
|
return (dimensionId == 0 ? null : "DimensionalDoors/pocketDimID" + dimensionId);
|
|
|
|
}
|
|
|
|
|
2013-06-02 03:43:56 +02:00
|
|
|
public void saveAsSchematic(int id)
|
|
|
|
{
|
|
|
|
this.isSavingSchematic=true;
|
|
|
|
this.dimensionId=id;
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-06-02 03:43:56 +02:00
|
|
|
}
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-02-18 03:46:16 +01:00
|
|
|
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
|
|
|
|
{
|
2013-06-16 15:57:51 +02:00
|
|
|
setCloudRenderer( new CloudRenderBlank());
|
|
|
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
}
|
2013-06-16 15:57:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2013-02-18 03:46:16 +01:00
|
|
|
@Override
|
|
|
|
public Vec3 getFogColor(float par1, float par2)
|
2013-06-16 15:57:51 +02:00
|
|
|
{
|
|
|
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0, (double)0, (double)0);
|
|
|
|
|
|
|
|
}
|
2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public double getHorizon()
|
2013-06-16 15:57:51 +02:00
|
|
|
{
|
|
|
|
return worldObj.getHeight();
|
|
|
|
}
|
|
|
|
|
2013-02-18 03:46:16 +01:00
|
|
|
@Override
|
|
|
|
public IChunkProvider createChunkGenerator()
|
|
|
|
{
|
2013-07-26 11:15:44 +02:00
|
|
|
return new PocketGenerator(worldObj, dimensionId, false, spawner);
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
2013-06-16 15:57:51 +02:00
|
|
|
|
|
|
|
@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;
|
|
|
|
}
|
2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getDimensionName()
|
|
|
|
{
|
2013-06-16 15:57:51 +02:00
|
|
|
//TODO: This should be a proper name. We need to show people proper names for things whenever possible.
|
|
|
|
//The question is whether this should be "Pocket Dimension" or "Pocket Dimension #" -- I'm not going to change
|
|
|
|
//it out of concern that it could break something. ~SenseiKiwi
|
2013-06-14 01:01:54 +02:00
|
|
|
return "PocketDim " + this.dimensionId;
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-02-18 03:46:16 +01:00
|
|
|
public int getRespawnDimension(EntityPlayerMP player)
|
|
|
|
{
|
2013-05-31 08:17:05 +02:00
|
|
|
int respawnDim;
|
2013-06-16 15:57:51 +02:00
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
if (properties.LimboEnabled)
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
2013-06-14 01:01:54 +02:00
|
|
|
respawnDim = properties.LimboDimensionID;
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
2013-06-02 07:46:31 +02:00
|
|
|
else
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
2013-08-01 01:34:08 +02:00
|
|
|
respawnDim = dimHelper.instance.getDimData(this.dimensionId).exitDimLink.destDimID;
|
2013-05-31 08:17:05 +02:00
|
|
|
}
|
2013-06-16 15:57:51 +02:00
|
|
|
|
|
|
|
if (dimHelper.getWorld(respawnDim) == null)
|
2013-05-31 08:17:05 +02:00
|
|
|
{
|
|
|
|
dimHelper.initDimension(respawnDim);
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
2013-05-31 08:17:05 +02:00
|
|
|
return respawnDim;
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
|
|
|
|
2013-06-16 15:57:51 +02:00
|
|
|
public boolean canRespawnHere()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|