Fixed #82 hardcoded biome id
Fixed biome registration Fixed default biome id from 24 to 95 Code cleanup
This commit is contained in:
parent
97ac427d12
commit
dfbd452b1a
7 changed files with 158 additions and 237 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.util.ChatComponentText;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||
|
@ -109,9 +110,9 @@ import cr0s.warpdrive.network.PacketHandler;
|
|||
import cr0s.warpdrive.render.ClientCameraHandler;
|
||||
import cr0s.warpdrive.render.RenderOverlayCamera;
|
||||
import cr0s.warpdrive.world.BiomeSpace;
|
||||
import cr0s.warpdrive.world.HyperSpaceProvider;
|
||||
import cr0s.warpdrive.world.HyperSpaceWorldProvider;
|
||||
import cr0s.warpdrive.world.HyperSpaceWorldGenerator;
|
||||
import cr0s.warpdrive.world.SpaceProvider;
|
||||
import cr0s.warpdrive.world.SpaceWorldProvider;
|
||||
import cr0s.warpdrive.world.SpaceWorldGenerator;
|
||||
|
||||
@Mod(modid = WarpDrive.MODID, name = "WarpDrive", version = WarpDrive.VERSION, dependencies = "after:IC2API;" + " after:CoFHCore;" + " after:ComputerCraft;"
|
||||
|
@ -864,13 +865,14 @@ public class WarpDrive implements LoadingCallback {
|
|||
}
|
||||
|
||||
private static void registerSpaceDimension() {
|
||||
spaceBiome = (new BiomeSpace(24)).setColor(0).setDisableRain().setBiomeName("Space");
|
||||
DimensionManager.registerProviderType(WarpDriveConfig.G_SPACE_PROVIDER_ID, SpaceProvider.class, true);
|
||||
spaceBiome = (new BiomeSpace(WarpDriveConfig.G_SPACE_BIOME_ID)).setColor(0).setDisableRain().setBiomeName("Space");
|
||||
BiomeDictionary.registerBiomeType(spaceBiome, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.WASTELAND);
|
||||
DimensionManager.registerProviderType(WarpDriveConfig.G_SPACE_PROVIDER_ID, SpaceWorldProvider.class, true);
|
||||
DimensionManager.registerDimension(WarpDriveConfig.G_SPACE_DIMENSION_ID, WarpDriveConfig.G_SPACE_PROVIDER_ID);
|
||||
}
|
||||
|
||||
private static void registerHyperSpaceDimension() {
|
||||
DimensionManager.registerProviderType(WarpDriveConfig.G_HYPERSPACE_PROVIDER_ID, HyperSpaceProvider.class, true);
|
||||
DimensionManager.registerProviderType(WarpDriveConfig.G_HYPERSPACE_PROVIDER_ID, HyperSpaceWorldProvider.class, true);
|
||||
DimensionManager.registerDimension(WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID, WarpDriveConfig.G_HYPERSPACE_PROVIDER_ID);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ public class WarpDriveConfig {
|
|||
|
||||
// Mod configuration (see loadWarpDriveConfig() for comments/definitions)
|
||||
// General
|
||||
public static int G_SPACE_BIOME_ID = 95;
|
||||
public static int G_SPACE_PROVIDER_ID = 14;
|
||||
public static int G_SPACE_DIMENSION_ID = -2;
|
||||
public static int G_HYPERSPACE_PROVIDER_ID = 15;
|
||||
|
@ -303,6 +304,8 @@ public class WarpDriveConfig {
|
|||
config.load();
|
||||
|
||||
// General
|
||||
G_SPACE_BIOME_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "space_biome_id", G_SPACE_BIOME_ID, "Space biome ID").getInt());
|
||||
G_SPACE_PROVIDER_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "space_provider_id", G_SPACE_PROVIDER_ID, "Space dimension provider ID").getInt());
|
||||
G_SPACE_DIMENSION_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.IProgressUpdate;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
@ -13,77 +13,49 @@ import net.minecraft.world.chunk.IChunkProvider;
|
|||
import net.minecraft.world.gen.ChunkProviderGenerate;
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
|
||||
public class HyperSpaceGenerator extends ChunkProviderGenerate implements IChunkProvider {
|
||||
public class HyperSpaceGenerator extends ChunkProviderGenerate {
|
||||
private World worldObj;
|
||||
private Random rand;
|
||||
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
|
||||
|
||||
/**
|
||||
* Reference to the World object.
|
||||
*/
|
||||
private World worldObj;
|
||||
|
||||
public HyperSpaceGenerator(World par1World, long par2) {
|
||||
super(par1World, par2, false);
|
||||
rand = new Random();
|
||||
this.worldObj = par1World;
|
||||
|
||||
public HyperSpaceGenerator(World worldObj, long par2) {
|
||||
super(worldObj, par2, false);
|
||||
rand = new Random(par2);
|
||||
this.worldObj = worldObj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Chunk provideChunk(int par1, int par2) {
|
||||
this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L);
|
||||
Block[] var3 = new Block[32768];
|
||||
this.biomesForGeneration[0] = WarpDrive.spaceBiome;
|
||||
// this.biomesForGeneration[0] = WarpDrive.spaceBiome;
|
||||
// this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
|
||||
this.biomesForGeneration[0] = WarpDrive.spaceBiome;
|
||||
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
|
||||
Chunk var4 = new Chunk(worldObj, var3, par1, par2);
|
||||
var4.generateSkylightMap();
|
||||
return var4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk loadChunk(int var1, int var2) {
|
||||
// TODO Auto-generated method stub
|
||||
return this.provideChunk(var1, var2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void populate(IChunkProvider var1, int var2, int var3) {
|
||||
// super.populate(var1, var2, var3);
|
||||
// Generate chunk population
|
||||
// GameRegistry.generateWorld(var2, var3, worldObj, var1, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveChunks(boolean var1, IProgressUpdate var2) {
|
||||
return super.saveChunks(var1, var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSave() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.canSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String makeString() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.makeString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getLoadedChunkCount() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getLoadedChunkCount();
|
||||
public ChunkPosition func_147416_a(World var1, String var2, int var3, int var4, int var5) {
|
||||
// no structure generation
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void recreateStructures(int var1, int var2) {
|
||||
// TODO Auto-generated method stub
|
||||
// no structure generation
|
||||
}
|
||||
}
|
|
@ -16,38 +16,34 @@ import cr0s.warpdrive.WarpDrive;
|
|||
import cr0s.warpdrive.config.WarpDriveConfig;
|
||||
import cr0s.warpdrive.render.RenderBlank;
|
||||
|
||||
public class HyperSpaceProvider extends WorldProvider {
|
||||
public int exitXCoord;
|
||||
public int exitYCoord;
|
||||
public int exitZCoord;
|
||||
public int exitDimID;
|
||||
|
||||
public HyperSpaceProvider() {
|
||||
public class HyperSpaceWorldProvider extends WorldProvider {
|
||||
|
||||
public HyperSpaceWorldProvider() {
|
||||
this.worldChunkMgr = new WorldChunkManagerHell(WarpDrive.spaceBiome, 0.0F);
|
||||
this.hasNoSky = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDimensionName() {
|
||||
return "Hyperspace";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canRespawnHere() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public float getStarBrightness(float par1) {
|
||||
return 0F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSurfaceWorld() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getAverageGroundLevel() {
|
||||
return 1;
|
||||
|
@ -57,100 +53,99 @@ public class HyperSpaceProvider extends WorldProvider {
|
|||
public double getHorizon() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateWeather() {
|
||||
super.resetRainAndThunder();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiomeGenForCoords(int x, int z) {
|
||||
return WarpDrive.spaceBiome;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) {
|
||||
super.setAllowedSpawnTypes(true, true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float calculateCelestialAngle(long par1, float par3) {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void generateLightBrightnessTable() {
|
||||
float var1 = 0.0F;
|
||||
|
||||
for (int var2 = 0; var2 <= 15; ++var2) {
|
||||
float var3 = 1.0F - var2 / 15.0F;
|
||||
this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1;
|
||||
float f = 0.0F;
|
||||
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
float f1 = 1.0F - i / 15.0F;
|
||||
this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public String getSaveFolder() {
|
||||
return (dimensionId == 0 ? null : "WarpDriveHyperSpace" + dimensionId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canCoordinateBeSpawn(int par1, int par2) {
|
||||
int var3 = this.worldObj.getTopSolidOrLiquidBlock(par1, par2);
|
||||
return var3 != 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||
setCloudRenderer(new RenderBlank());
|
||||
setSkyRenderer(new RenderBlank());
|
||||
return Vec3.createVectorHelper(1.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Vec3 getFogColor(float par1, float par2) {
|
||||
return Vec3.createVectorHelper(0.1D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean isSkyColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getEntrancePortalLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRespawnDimension(EntityPlayerMP player) {
|
||||
return WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IChunkProvider createChunkGenerator() {
|
||||
return new HyperSpaceGenerator(worldObj, 46);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getRandomizedSpawnPoint() {
|
||||
ChunkCoordinates var5 = new ChunkCoordinates(this.worldObj.getSpawnPoint());
|
||||
// boolean isAdventure = worldObj.getWorldInfo().getGameType() ==
|
||||
// EnumGameType.ADVENTURE;
|
||||
ChunkCoordinates var5 = new ChunkCoordinates(worldObj.getSpawnPoint());
|
||||
// boolean isAdventure = worldObj.getWorldInfo().getGameType() == EnumGameType.ADVENTURE;
|
||||
int spawnFuzz = 100;
|
||||
int spawnFuzzHalf = spawnFuzz / 2;
|
||||
{
|
||||
var5.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
var5.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
var5.posX += worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
var5.posZ += worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
var5.posY = 200;
|
||||
}
|
||||
|
||||
|
||||
if (worldObj.isAirBlock(var5.posX, var5.posY, var5.posZ)) {
|
||||
worldObj.setBlock(var5.posX, var5.posY, var5.posZ, Blocks.stone, 0, 2);
|
||||
worldObj.setBlock(var5.posX + 1, var5.posY + 1, var5.posZ, Blocks.glass, 0, 2);
|
||||
|
@ -165,25 +160,25 @@ public class HyperSpaceProvider extends WorldProvider {
|
|||
worldObj.setBlock(var5.posX, var5.posY, var5.posZ, WarpDrive.blockAir, 15, 2);
|
||||
worldObj.setBlock(var5.posX, var5.posY + 1, var5.posZ, WarpDrive.blockAir, 15, 2);
|
||||
}
|
||||
|
||||
|
||||
return var5;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getWorldHasVoidParticles() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDaytime() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canDoLightning(Chunk chunk) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canDoRainSnowIce(Chunk chunk) {
|
||||
return false;
|
|
@ -1,7 +1,3 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package cr0s.warpdrive.world;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -9,7 +5,6 @@ import java.util.Random;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.IProgressUpdate;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
@ -19,82 +14,48 @@ import net.minecraft.world.gen.ChunkProviderGenerate;
|
|||
import cr0s.warpdrive.WarpDrive;
|
||||
|
||||
public class SpaceGenerator extends ChunkProviderGenerate {
|
||||
private World worldObj;
|
||||
private Random rand;
|
||||
private BiomeGenBase[] biomesForGeneration = new BiomeGenBase[1];
|
||||
|
||||
/**
|
||||
* Reference to the World object.
|
||||
*/
|
||||
private World worldObj;
|
||||
|
||||
public SpaceGenerator(World par1World, long par2) {
|
||||
super(par1World, par2, false);
|
||||
rand = new Random();
|
||||
this.worldObj = par1World;
|
||||
|
||||
public SpaceGenerator(World worldObj, long par2) {
|
||||
super(worldObj, par2, false);
|
||||
rand = new Random(par2);
|
||||
this.worldObj = worldObj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Chunk provideChunk(int par1, int par2) {
|
||||
this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L);
|
||||
Block[] var3 = new Block[32768];
|
||||
this.biomesForGeneration[0] = WarpDrive.spaceBiome;
|
||||
// this.biomesForGeneration[0] = WarpDrive.spaceBiome;
|
||||
// this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
|
||||
this.biomesForGeneration[0] = WarpDrive.spaceBiome;
|
||||
Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
|
||||
Chunk var4 = new Chunk(worldObj, var3, par1, par2);
|
||||
var4.generateSkylightMap();
|
||||
return var4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Chunk loadChunk(int var1, int var2) {
|
||||
// TODO Auto-generated method stub
|
||||
return this.provideChunk(var1, var2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void populate(IChunkProvider var1, int var2, int var3) {
|
||||
// super.populate(var1, var2, var3);
|
||||
// Generate chunk population
|
||||
// GameRegistry.generateWorld(var2, var3, worldObj, var1, var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveChunks(boolean var1, IProgressUpdate var2) {
|
||||
return super.saveChunks(var1, var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSave() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.canSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String makeString() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.makeString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChunkPosition func_147416_a(World var1, String var2, int var3, int var4, int var5) {
|
||||
// TODO Auto-generated method stub
|
||||
// no structure generation
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLoadedChunkCount() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getLoadedChunkCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateStructures(int var1, int var2) {
|
||||
// TODO Auto-generated method stub
|
||||
// no structure generation
|
||||
}
|
||||
}
|
|
@ -71,10 +71,10 @@ public class SpaceSkyRenderer extends IRenderHandler {
|
|||
|
||||
@Override
|
||||
public void render(float partialTicks, WorldClient world, Minecraft mc) {
|
||||
SpaceProvider spaceProvider = null;
|
||||
SpaceWorldProvider spaceProvider = null;
|
||||
|
||||
if (world.provider instanceof SpaceProvider) {
|
||||
spaceProvider = (SpaceProvider) world.provider;
|
||||
if (world.provider instanceof SpaceWorldProvider) {
|
||||
spaceProvider = (SpaceWorldProvider) world.provider;
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
|
|
@ -14,188 +14,176 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.render.RenderBlank;
|
||||
|
||||
public class SpaceProvider extends WorldProvider {
|
||||
public int exitXCoord;
|
||||
public int exitYCoord;
|
||||
public int exitZCoord;
|
||||
public int exitDimID;
|
||||
|
||||
public SpaceProvider() {
|
||||
public class SpaceWorldProvider extends WorldProvider {
|
||||
|
||||
public SpaceWorldProvider() {
|
||||
this.worldChunkMgr = new WorldChunkManagerHell(WarpDrive.spaceBiome, 0.0F);
|
||||
this.hasNoSky = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDimensionName() {
|
||||
return "Space";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canRespawnHere() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public float getStarBrightness(float par1) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSurfaceWorld() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getAverageGroundLevel() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getHorizon() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateWeather() {
|
||||
this.worldObj.getWorldInfo().setRainTime(0);
|
||||
this.worldObj.getWorldInfo().setRaining(false);
|
||||
this.worldObj.getWorldInfo().setThunderTime(0);
|
||||
this.worldObj.getWorldInfo().setThundering(false);
|
||||
super.resetRainAndThunder();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BiomeGenBase getBiomeGenForCoords(int x, int z) {
|
||||
return WarpDrive.spaceBiome;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) {
|
||||
super.setAllowedSpawnTypes(true, true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float calculateCelestialAngle(long par1, float par3) {
|
||||
return 0F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void generateLightBrightnessTable() {
|
||||
/*
|
||||
* float var1 = 0.1F;
|
||||
*
|
||||
* for (int var2 = 0; var2 <= 15; ++var2) { float var3 = 1.0F -
|
||||
* (float)var2 / 15.0F; this.lightBrightnessTable[var2] = (1.0F - var3)
|
||||
* / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1; }
|
||||
*/
|
||||
float var1 = 0.0F;
|
||||
|
||||
for (int var2 = 0; var2 <= 15; ++var2) {
|
||||
float var3 = 1.0F - var2 / 15.0F;
|
||||
this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1;
|
||||
float f = 0.0F; // 0.1F
|
||||
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
float f1 = 1.0F - i / 15.0F;
|
||||
this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public String getSaveFolder() {
|
||||
return (dimensionId == 0 ? null : "WarpDriveSpace" + dimensionId);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @Override public boolean canCoordinateBeSpawn(int par1, int par2) { int
|
||||
* var3 = this.worldObj.getFirstUncoveredBlock(par1, par2); return var3 !=
|
||||
* 0; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean canCoordinateBeSpawn(int par1, int par2) {
|
||||
Block var3 = worldObj.getTopSolidOrLiquidBlock(par1, par2);
|
||||
return var3 != 0;
|
||||
}
|
||||
/**/
|
||||
|
||||
@Override
|
||||
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) {
|
||||
setCloudRenderer(new RenderBlank());
|
||||
// setSkyRenderer(new SpaceSkyRenderer());
|
||||
return Vec3.createVectorHelper(0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Vec3 getFogColor(float par1, float par2) {
|
||||
return Vec3.createVectorHelper(0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSkyColored() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getEntrancePortalLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRespawnDimension(EntityPlayerMP player) {
|
||||
return 0; // respawn on Earth
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IChunkProvider createChunkGenerator() {
|
||||
return new SpaceGenerator(worldObj, 45);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canBlockFreeze(int x, int y, int z, boolean byWater) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @Override public ChunkCoordinates getRandomizedSpawnPoint() {
|
||||
* ChunkCoordinates var5 = new
|
||||
* ChunkCoordinates(this.worldObj.getSpawnPoint());
|
||||
*
|
||||
* //boolean isAdventure = worldObj.getWorldInfo().getGameType() ==
|
||||
* EnumGameType.ADVENTURE; int spawnFuzz = 1000; int spawnFuzzHalf =
|
||||
* spawnFuzz / 2;
|
||||
*
|
||||
* { var5.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
* var5.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
* var5.posY = 200; }
|
||||
*
|
||||
* if (worldObj.isAirBlock(var5.posX, var5.posY, var5.posZ)) {
|
||||
* worldObj.setBlock(var5.posX, var5.posY, var5.posZ, Block.stone.blockID,
|
||||
* 0, 2);
|
||||
*
|
||||
* worldObj.setBlock(var5.posX + 1, var5.posY + 1, var5.posZ,
|
||||
* Block.glass.blockID, 0, 2); worldObj.setBlock(var5.posX + 1, var5.posY +
|
||||
* 2, var5.posZ, Block.glass.blockID, 0, 2);
|
||||
*
|
||||
* worldObj.setBlock(var5.posX - 1, var5.posY + 1, var5.posZ,
|
||||
* Block.glass.blockID, 0, 2); worldObj.setBlock(var5.posX - 1, var5.posY +
|
||||
* 2, var5.posZ, Block.glass.blockID, 0, 2);
|
||||
*
|
||||
* worldObj.setBlock(var5.posX, var5.posY + 1, var5.posZ + 1,
|
||||
* Block.glass.blockID, 0, 2); worldObj.setBlock(var5.posX, var5.posY + 2,
|
||||
* var5.posZ + 1, Block.glass.blockID, 0, 2);
|
||||
*
|
||||
* worldObj.setBlock(var5.posX, var5.posY + 1, var5.posZ - 1,
|
||||
* Block.glass.blockID, 0, 2); worldObj.setBlock(var5.posX, var5.posY + 3,
|
||||
* var5.posZ - 1, Block.glass.blockID, 0, 2);
|
||||
*
|
||||
* //worldObj.setBlockWithNotify(var5.posX, var5.posY + 3, var5.posZ,
|
||||
* Block.glass.blockID); } return var5; }
|
||||
*/
|
||||
@Override
|
||||
public ChunkCoordinates getRandomizedSpawnPoint() {
|
||||
ChunkCoordinates var5 = new ChunkCoordinates(worldObj.getSpawnPoint());
|
||||
|
||||
//boolean isAdventure = worldObj.getWorldInfo().getGameType() == EnumGameType.ADVENTURE;
|
||||
int spawnFuzz = 1000;
|
||||
int spawnFuzzHalf = spawnFuzz / 2;
|
||||
|
||||
{
|
||||
var5.posX += worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
var5.posZ += worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf;
|
||||
var5.posY = 200;
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock(var5.posX, var5.posY, var5.posZ)) {
|
||||
worldObj.setBlock(var5.posX, var5.posY, var5.posZ, Blocks.stone, 0, 2);
|
||||
|
||||
worldObj.setBlock(var5.posX + 1, var5.posY + 1, var5.posZ, Blocks.glass, 0, 2);
|
||||
worldObj.setBlock(var5.posX + 1, var5.posY + 2, var5.posZ, Blocks.glass, 0, 2);
|
||||
|
||||
worldObj.setBlock(var5.posX - 1, var5.posY + 1, var5.posZ, Blocks.glass, 0, 2);
|
||||
worldObj.setBlock(var5.posX - 1, var5.posY + 2, var5.posZ, Blocks.glass, 0, 2);
|
||||
|
||||
worldObj.setBlock(var5.posX, var5.posY + 1, var5.posZ + 1, Blocks.glass, 0, 2);
|
||||
worldObj.setBlock(var5.posX, var5.posY + 2, var5.posZ + 1, Blocks.glass, 0, 2);
|
||||
|
||||
worldObj.setBlock(var5.posX, var5.posY + 1, var5.posZ - 1, Blocks.glass, 0, 2);
|
||||
worldObj.setBlock(var5.posX, var5.posY + 3, var5.posZ - 1, Blocks.glass, 0, 2);
|
||||
|
||||
// worldObj.setBlockWithNotify(var5.posX, var5.posY + 3, var5.posZ, Block.glass.blockID);
|
||||
}
|
||||
return var5;
|
||||
}
|
||||
/**/
|
||||
|
||||
@Override
|
||||
public boolean getWorldHasVoidParticles() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDaytime() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canDoLightning(Chunk chunk) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canDoRainSnowIce(Chunk chunk) {
|
||||
return false;
|
Loading…
Reference in a new issue