2013-05-07 18:08:35 +00:00
|
|
|
package biomesoplenty.world;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
import net.minecraft.util.ChunkCoordinates;
|
|
|
|
import net.minecraft.util.MathHelper;
|
|
|
|
import net.minecraft.util.Vec3;
|
|
|
|
import net.minecraft.world.WorldProvider;
|
|
|
|
import net.minecraft.world.chunk.IChunkProvider;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.api.Biomes;
|
|
|
|
import biomesoplenty.api.Blocks;
|
|
|
|
import biomesoplenty.configuration.BOPConfiguration;
|
2013-05-03 13:00:44 +00:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
public class WorldProviderPromised extends WorldProvider
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
public boolean hasNoSky = false;
|
|
|
|
|
|
|
|
@Override
|
2013-05-03 13:00:44 +00:00
|
|
|
public void registerWorldChunkManager()
|
|
|
|
{
|
2013-05-18 15:06:30 +00:00
|
|
|
if (Biomes.promisedLandForest.isPresent() || Biomes.promisedLandPlains.isPresent() || Biomes.promisedLandSwamp.isPresent())
|
2013-05-07 19:33:36 +00:00
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
worldChunkMgr = new WorldChunkManagerPromised(worldObj);
|
2013-05-07 19:33:36 +00:00
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
dimensionId = BOPConfiguration.promisedLandDimID;
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getDimensionName()
|
2013-05-03 13:00:44 +00:00
|
|
|
{
|
|
|
|
return "Promised Land";
|
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
|
|
|
|
@Override
|
2013-05-03 13:00:44 +00:00
|
|
|
public boolean canRespawnHere()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
@Override
|
|
|
|
public float calculateCelestialAngle(long par1, float par3)
|
|
|
|
{
|
|
|
|
return 1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float getCloudHeight()
|
|
|
|
{
|
|
|
|
return 0.0F;
|
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
public boolean darkenSkyDuringRain()
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canCoordinateBeSpawn(int par1, int par2)
|
|
|
|
{
|
|
|
|
int var3 = worldObj.getFirstUncoveredBlock(par1, par2);
|
|
|
|
return var3 == Blocks.holyGrass.get().blockID;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ChunkCoordinates getEntrancePortalLocation()
|
|
|
|
{
|
|
|
|
return new ChunkCoordinates(100, 50, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getAverageGroundLevel()
|
|
|
|
{
|
|
|
|
return 64;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public double getHorizon()
|
|
|
|
{
|
|
|
|
return 0.0D;
|
|
|
|
}
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public boolean hasVoidParticles(boolean var1)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public boolean isSkyColored()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public double getVoidFogYFactor()
|
|
|
|
{
|
|
|
|
return 1.0D;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2013-05-03 13:00:44 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public Vec3 getFogColor(float par1, float par2)
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
|
|
|
float var3 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
|
|
|
|
|
|
|
|
if (var3 < 0.0F)
|
|
|
|
{
|
|
|
|
var3 = 0.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (var3 > 1.0F)
|
|
|
|
{
|
|
|
|
var3 = 1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
float var4 = 1.0F;
|
|
|
|
float var5 = 0.91764705882F;
|
|
|
|
float var6 = 0.4F;
|
|
|
|
var4 *= var3 * 3.94F + 0.06F;
|
|
|
|
var5 *= var3 * 0.94F + 0.06F;
|
|
|
|
var6 *= var3 * 0.91F + 0.09F;
|
|
|
|
return worldObj.getWorldVec3Pool().getVecFromPool(var4, var5, var6);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)
|
|
|
|
{
|
|
|
|
allowPeaceful = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getWelcomeMessage()
|
|
|
|
{
|
|
|
|
return "Entering the Promised Land";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getDepartMessage()
|
|
|
|
{
|
|
|
|
return "Leaving the Promised Land";
|
|
|
|
}
|
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
@Override
|
|
|
|
public IChunkProvider createChunkGenerator()
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
return new ChunkProviderPromised(worldObj, worldObj.getSeed());
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
}
|