Fogginess can now be changed per biome alongside the colour

This commit is contained in:
Adubbz 2013-11-04 11:40:43 +11:00
parent 481acce122
commit 88ad2285dc
19 changed files with 910 additions and 541 deletions

View File

@ -20,7 +20,7 @@ public class BOPFMLLoadingPlugin implements IFMLLoadingPlugin
@Override
public String[] getASMTransformerClass()
{
return new String[] {BOPBiomeColourBlending.class.getName(), BOPFogColour.class.getName()};
return new String[] {BOPBiomeColourBlending.class.getName(), BOPFogColour.class.getName(), BOPFogDistance.class.getName()};
}
@Override

View File

@ -26,7 +26,7 @@ import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import org.w3c.dom.css.RGBColor;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
public class BOPFogColour implements IClassTransformer
{
@ -45,7 +45,7 @@ public class BOPFogColour implements IClassTransformer
if (name.equals("bfe"))
{
return patchEntityRenderer(newname, bytes, false);
return patchEntityRenderer(newname, bytes, true);
}
return bytes;
@ -179,9 +179,9 @@ public class BOPFogColour implements IClassTransformer
BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z);
int colour = 0;
if (biome instanceof IFogColour)
if (biome instanceof IBOPFog)
{
colour = ((IFogColour)biome).getFogColour();
colour = ((IBOPFog)biome).getFogColour();
}
else
{
@ -207,7 +207,6 @@ public class BOPFogColour implements IClassTransformer
{
int x = MathHelper.floor_double(entity.posX);
int z = MathHelper.floor_double(entity.posZ);
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
int multiplier = getFogBlendColour(world, partialRenderTick, x, z);

View File

@ -0,0 +1,213 @@
package biomesoplenty.asm;
import static org.objectweb.asm.Opcodes.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.ForgeDummyContainer;
import org.lwjgl.opengl.GL11;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.FrameNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.LineNumberNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import biomesoplenty.interfaces.IBOPFog;
public class BOPFogDistance implements IClassTransformer
{
private static int fogX, fogZ;
private static boolean fogInit;
private static float storedFinalFogCloseness;
@Override
public byte[] transform(String name, String newname, byte[] bytes)
{
if (name.equals("net.minecraft.client.renderer.EntityRenderer"))
{
return patchEntityRenderer(newname, bytes, false);
}
if (name.equals("bfe"))
{
return patchEntityRenderer(newname, bytes, true);
}
return bytes;
}
public static byte[] patchEntityRenderer(String name, byte[] bytes, boolean obfuscated)
{
String targetMethodName = "";
if (obfuscated)
targetMethodName ="a";
else
targetMethodName ="setupFog";
ClassNode classNode = new ClassNode();
ClassReader classReader = new ClassReader(bytes);
classReader.accept(classNode, 0);
Iterator<MethodNode> methods = classNode.methods.iterator();
while (methods.hasNext())
{
MethodNode m = methods.next();
int fdiv_index = -1;
if (m.name.equals(targetMethodName) && (m.desc.equals("(IF)V")))
{
AbstractInsnNode currentNode = null;
AbstractInsnNode targetNode = null;
Iterator<AbstractInsnNode> iter = m.instructions.iterator();
int index = -1;
int timesFound = 0;
while (iter.hasNext())
{
index++;
currentNode = iter.next();
if (currentNode.getOpcode() == ALOAD)
{
if (timesFound == 22)
{
targetNode = currentNode;
fdiv_index = index;
break;
}
else
{
timesFound++;
}
}
}
System.out.println(m.instructions.get(fdiv_index - 1).getOpcode());
/*
mv.visitMethodInsn(INVOKESTATIC, "org/lwjgl/opengl/GL11", "glFogf", "(IF)V");
mv.visitLabel(l71);
mv.visitLineNumber(1922, l71);
mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mv.visitVarInsn(ALOAD, 3);
mv.visitVarInsn(FLOAD, 6);
mv.visitMethodInsn(INVOKESTATIC, "biomesoplenty/asm/BOPFogDistance", "setBiomeFogDistance", "(Lnet/minecraft/entity/Entity;F)V");
mv.visitLabel(l32);
*/
InsnList toInject = new InsnList();
toInject.add(new FrameNode(Opcodes.F_SAME, 0, null, 0, null));
toInject.add(new VarInsnNode(ALOAD, 3));
toInject.add(new VarInsnNode(ILOAD, 1));
toInject.add(new VarInsnNode(FLOAD, 6));
if (obfuscated)
toInject.add(new MethodInsnNode(INVOKESTATIC, "biomesoplenty/asm/BOPFogDistance", "setBiomeFogDistance", "(Lnn;F)V"));
else
toInject.add(new MethodInsnNode(INVOKESTATIC, "biomesoplenty/asm/BOPFogDistance", "setBiomeFogDistance", "(Lnet/minecraft/entity/Entity;IF)V"));
m.instructions.insertBefore(m.instructions.get(fdiv_index), toInject);
break;
}
}
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
classNode.accept(writer);
return writer.toByteArray();
}
public static void setBiomeFogDistance(Entity entity, int distance, float farPlaneDistance)
{
World world = entity.worldObj;
int playerX = MathHelper.floor_double(entity.posX);
int playerZ = MathHelper.floor_double(entity.posZ);
if (playerX == fogX && playerZ == fogZ && fogInit)
{
if (distance < 0)
{
GL11.glFogf(GL11.GL_FOG_START, 0.0F);
GL11.glFogf(GL11.GL_FOG_END, farPlaneDistance * 0.8F);
}
else
{
GL11.glFogf(GL11.GL_FOG_START, farPlaneDistance * (storedFinalFogCloseness / 10));
GL11.glFogf(GL11.GL_FOG_END, Math.min(farPlaneDistance, 192.0F) * storedFinalFogCloseness);
}
return;
}
fogInit = true;
int blenddistance = Minecraft.getMinecraft().gameSettings.fancyGraphics ? ForgeDummyContainer.blendRanges[Minecraft.getMinecraft().gameSettings.renderDistance] : 0;
int divider = 0;
float fogCloseness = 0.0F;
for (int x = -blenddistance; x <= blenddistance; ++x)
{
for (int z = -blenddistance; z <= blenddistance; ++z)
{
BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z);
if (biome instanceof IBOPFog)
{
fogCloseness += ((IBOPFog)biome).getFogCloseness();
}
else
{
fogCloseness += 1.0F;
}
divider++;
}
}
float finalFogCloseness = fogCloseness / divider;
System.out.println(finalFogCloseness);
fogX = playerX;
fogZ = playerZ;
storedFinalFogCloseness = finalFogCloseness;
if (distance < 0)
{
GL11.glFogf(GL11.GL_FOG_START, 0.0F);
GL11.glFogf(GL11.GL_FOG_END, farPlaneDistance * 0.8F);
}
else
{
GL11.glFogf(GL11.GL_FOG_START, farPlaneDistance * (finalFogCloseness / 10));
GL11.glFogf(GL11.GL_FOG_END, Math.min(farPlaneDistance, 192.0F) * finalFogCloseness);
}
}
}

View File

@ -8,9 +8,9 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
public class BiomeGenCrag extends BiomeGenBase implements IFogColour
public class BiomeGenCrag extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
@ -82,4 +82,11 @@ public class BiomeGenCrag extends BiomeGenBase implements IFogColour
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -13,10 +13,10 @@ import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.WorldGenDeadlands;
public class BiomeGenDeadlands extends BiomeGenBase implements IFogColour
public class BiomeGenDeadlands extends BiomeGenBase implements IBOPFog
{
private WorldGenerator theWorldGenerator;
private BiomeDecoratorBOP customBiomeDecorator;
@ -107,4 +107,11 @@ public class BiomeGenDeadlands extends BiomeGenBase implements IFogColour
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -12,11 +12,11 @@ import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.WorldGenMoss;
import biomesoplenty.worldgen.tree.WorldGenSequoia;
public class BiomeGenFungiForest extends BiomeGenBase implements IFogColour
public class BiomeGenFungiForest extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
@ -139,4 +139,11 @@ public class BiomeGenFungiForest extends BiomeGenBase implements IFogColour
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -3,10 +3,8 @@ package biomesoplenty.biomes;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.worldgen.tree.WorldGenJacaranda;

View File

@ -7,10 +7,7 @@ import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.worldgen.WorldGenMarsh;
public class BiomeGenMarsh extends BiomeGenBase
{

View File

@ -11,13 +11,13 @@ import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.configuration.configfile.BOPConfigurationMain;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.realtree.WorldGenRealMagic;
import biomesoplenty.worldgen.tree.WorldGenMystic1;
import biomesoplenty.worldgen.tree.WorldGenMystic2;
import biomesoplenty.worldgen.tree.WorldGenSwampTall;
public class BiomeGenMysticGrove extends BiomeGenBase implements IFogColour
public class BiomeGenMysticGrove extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
@ -133,4 +133,11 @@ public class BiomeGenMysticGrove extends BiomeGenBase implements IFogColour
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -12,11 +12,11 @@ import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.tree.WorldGenOminous1;
import biomesoplenty.worldgen.tree.WorldGenOminous2;
public class BiomeGenOminousWoods extends BiomeGenBase implements IFogColour
public class BiomeGenOminousWoods extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
@ -118,4 +118,11 @@ public class BiomeGenOminousWoods extends BiomeGenBase implements IFogColour
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -13,12 +13,12 @@ import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.tree.WorldGenOminous1;
import biomesoplenty.worldgen.tree.WorldGenOminous3;
import biomesoplenty.worldgen.tree.WorldGenOminous4;
public class BiomeGenOminousWoodsThick extends BiomeGenBase implements IFogColour
public class BiomeGenOminousWoodsThick extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
@ -122,4 +122,11 @@ public class BiomeGenOminousWoodsThick extends BiomeGenBase implements IFogColou
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -9,7 +9,6 @@ import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.configuration.configfile.BOPConfigurationMain;
import biomesoplenty.worldgen.WorldGenRedwoodShrub;
import biomesoplenty.worldgen.realtree.WorldGenRealRedwood;
import biomesoplenty.worldgen.realtree.WorldGenRealRedwood2;
import biomesoplenty.worldgen.tree.WorldGenRedwoodTree;

View File

@ -12,123 +12,139 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.tree.WorldGenMassiveTree;
public class BiomeGenSacredSprings extends BiomeGenBase implements IFogColour
public class BiomeGenSacredSprings extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenSacredSprings(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 30;
customBiomeDecorator.grassPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 1;
customBiomeDecorator.waterlilyPerChunk = 5;
customBiomeDecorator.violetsPerChunk = 1;
customBiomeDecorator.hotSpringsPerChunk = 1;
customBiomeDecorator.generatePumpkins = false;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));
}
@SuppressWarnings("unchecked")
public BiomeGenSacredSprings(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 30;
customBiomeDecorator.grassPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 1;
customBiomeDecorator.waterlilyPerChunk = 5;
customBiomeDecorator.violetsPerChunk = 1;
customBiomeDecorator.hotSpringsPerChunk = 1;
customBiomeDecorator.generatePumpkins = false;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class,
12, 6, 6));
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(150) == 0 ? new WorldGenMassiveTree(false) : new WorldGenShrub(0, 0);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(150) == 0 ? new WorldGenMassiveTree(false)
: new WorldGenShrub(0, 0);
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = par2Random.nextInt(75);
int var55 = 12 + par2Random.nextInt(6);
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = par2Random.nextInt(75);
for (int var66 = 0; var66 < var55; ++var66)
{
int var77 = par3 + par2Random.nextInt(16);
int var88 = par2Random.nextInt(28) + 4;
int var99 = par4 + par2Random.nextInt(16);
int var100 = par1World.getBlockId(var77, var88, var99);
int var55 = 12 + par2Random.nextInt(6);
if (var100 == Block.stone.blockID)
{
par1World.setBlock(var77, var88, var99, Blocks.amethystOre.get().blockID, 12, 2);
}
}
for (int var66 = 0; var66 < var55; ++var66)
{
int var77 = par3 + par2Random.nextInt(16);
int var88 = par2Random.nextInt(28) + 4;
int var99 = par4 + par2Random.nextInt(16);
int var100 = par1World.getBlockId(var77, var88, var99);
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(53) + 75;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
if (var100 == Block.stone.blockID)
{
par1World.setBlock(var77, var88, var99,
Blocks.amethystOre.get().blockID, 12, 2);
}
}
if (var10 == Block.stone.blockID || var10 == Block.dirt.blockID)
{
par1World.setBlock(var7, var8, var9, Block.waterMoving.blockID, 0, 2);
}
}
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(53) + 75;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 39259;
}
if (var10 == Block.stone.blockID || var10 == Block.dirt.blockID)
{
par1World.setBlock(var7, var8, var9, Block.waterMoving.blockID,
0, 2);
}
}
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 39259;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 8707327;
}
/**
* Provides the basic grass color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 39259;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 1995007;
else
{
par1 /= 3.0F;
/**
* Provides the basic foliage color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 39259;
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 8707327;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
{
return 1995007;
}
else
{
par1 /= 3.0F;
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F,
0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -10,7 +10,7 @@ import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.tree.WorldGenAutumn;
import biomesoplenty.worldgen.tree.WorldGenAutumn2;
import biomesoplenty.worldgen.tree.WorldGenAutumn2Big;
@ -18,90 +18,117 @@ import biomesoplenty.worldgen.tree.WorldGenDeadTree2;
import biomesoplenty.worldgen.tree.WorldGenMaple;
import biomesoplenty.worldgen.tree.WorldGenMapleBig;
public class BiomeGenSeasonalForest extends BiomeGenBase implements IFogColour
public class BiomeGenSeasonalForest extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenSeasonalForest(int par1)
{
super(par1);
spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 20;
customBiomeDecorator.grassPerChunk = 8;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.toadstoolsPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 4;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.waterReedsPerChunk = 4;
}
@SuppressWarnings("unchecked")
public BiomeGenSeasonalForest(int par1)
{
super(par1);
spawnableCreatureList
.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 20;
customBiomeDecorator.grassPerChunk = 8;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.toadstoolsPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 4;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.waterReedsPerChunk = 4;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(
Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(
Blocks.foliage.get().blockID, 1);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenAutumn2(false) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(6) == 0 ? new WorldGenAutumn2Big(false) : (par1Random.nextInt(6) == 0 ? new WorldGenMapleBig(false) : (par1Random.nextInt(3) == 0 ? new WorldGenMaple(false) : (par1Random.nextInt(5) == 0 ? new WorldGenDeadTree2(false) : (par1Random.nextInt(6) == 0 ? worldGeneratorBigTree : worldGeneratorTrees))))));
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + par2Random.nextInt(6);
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenAutumn2(false)
: (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false)
: (par1Random.nextInt(6) == 0 ? new WorldGenAutumn2Big(
false)
: (par1Random.nextInt(6) == 0 ? new WorldGenMapleBig(
false)
: (par1Random.nextInt(3) == 0 ? new WorldGenMaple(
false)
: (par1Random.nextInt(5) == 0 ? new WorldGenDeadTree2(
false)
: (par1Random
.nextInt(6) == 0 ? worldGeneratorBigTree
: worldGeneratorTrees))))));
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + par2Random.nextInt(6);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2);
}
}
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 11781186;
}
Block block = Block.blocksList[var10];
if (block != null
&& block.isGenMineableReplaceable(par1World, var7, var8,
var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID,
0, 2);
}
}
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 12502092;
//return 12502595;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16764548;
}
/**
* Provides the basic foliage color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 11781186;
}
/**
* Provides the basic grass color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 12502092;
// return 12502595;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16764548;
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -10,7 +10,7 @@ import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.tree.WorldGenAutumn;
import biomesoplenty.worldgen.tree.WorldGenAutumn2;
import biomesoplenty.worldgen.tree.WorldGenDeadTree2;
@ -18,90 +18,117 @@ import biomesoplenty.worldgen.tree.WorldGenMaple;
import biomesoplenty.worldgen.tree.WorldGenTaiga10;
import biomesoplenty.worldgen.tree.WorldGenTaiga5;
public class BiomeGenSeasonalSpruceForest extends BiomeGenBase implements IFogColour
public class BiomeGenSeasonalSpruceForest extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenSeasonalSpruceForest(int par1)
{
super(par1);
spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 20;
customBiomeDecorator.grassPerChunk = 8;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.toadstoolsPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 4;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.waterReedsPerChunk = 2;
}
@SuppressWarnings("unchecked")
public BiomeGenSeasonalSpruceForest(int par1)
{
super(par1);
spawnableCreatureList
.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 20;
customBiomeDecorator.grassPerChunk = 8;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.toadstoolsPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 4;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.waterReedsPerChunk = 2;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(
Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(
Blocks.foliage.get().blockID, 1);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenAutumn2(false) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(2) == 0 ? new WorldGenTaiga5(false) : (par1Random.nextInt(4) == 0 ? new WorldGenTaiga10(false) : (par1Random.nextInt(3) == 0 ? new WorldGenMaple(false) : (par1Random.nextInt(5) == 0 ? new WorldGenDeadTree2(false) : (par1Random.nextInt(6) == 0 ? worldGeneratorBigTree : worldGeneratorTrees))))));
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + par2Random.nextInt(6);
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenAutumn2(false)
: (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false)
: (par1Random.nextInt(2) == 0 ? new WorldGenTaiga5(
false)
: (par1Random.nextInt(4) == 0 ? new WorldGenTaiga10(
false)
: (par1Random.nextInt(3) == 0 ? new WorldGenMaple(
false)
: (par1Random.nextInt(5) == 0 ? new WorldGenDeadTree2(
false)
: (par1Random
.nextInt(6) == 0 ? worldGeneratorBigTree
: worldGeneratorTrees))))));
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + par2Random.nextInt(6);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2);
}
}
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 11781186;
}
Block block = Block.blocksList[var10];
if (block != null
&& block.isGenMineableReplaceable(par1World, var7, var8,
var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID,
0, 2);
}
}
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 12502092;
//return 12502595;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16764548;
}
/**
* Provides the basic foliage color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 11781186;
}
/**
* Provides the basic grass color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 12502092;
// return 12502595;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16764548;
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -13,118 +13,137 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.tree.WorldGenRainforest1;
public class BiomeGenTropicalRainforest extends BiomeGenBase implements IFogColour
public class BiomeGenTropicalRainforest extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenTropicalRainforest(int par1)
{
super(par1);
spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 12;
customBiomeDecorator.grassPerChunk = 9;
customBiomeDecorator.highGrassPerChunk = 4;
customBiomeDecorator.reedsPerChunk = 10;
customBiomeDecorator.waterlilyPerChunk = 2;
customBiomeDecorator.orangeFlowersPerChunk = 10;
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.generateMelons = true;
customBiomeDecorator.sproutsPerChunk = 2;
customBiomeDecorator.generateQuicksand = true;
customBiomeDecorator.poisonIvyPerChunk = 4;
customBiomeDecorator.lilyflowersPerChunk = 2;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.wheatGrassPerChunk = 5;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));
waterColorMultiplier = 6160128;
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
@SuppressWarnings("unchecked")
public BiomeGenTropicalRainforest(int par1)
{
super(par1);
spawnableMonsterList
.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 12;
customBiomeDecorator.grassPerChunk = 9;
customBiomeDecorator.highGrassPerChunk = 4;
customBiomeDecorator.reedsPerChunk = 10;
customBiomeDecorator.waterlilyPerChunk = 2;
customBiomeDecorator.orangeFlowersPerChunk = 10;
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.generateMelons = true;
customBiomeDecorator.sproutsPerChunk = 2;
customBiomeDecorator.generateQuicksand = true;
customBiomeDecorator.poisonIvyPerChunk = 4;
customBiomeDecorator.lilyflowersPerChunk = 2;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.wheatGrassPerChunk = 5;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class,
12, 6, 6));
waterColorMultiplier = 6160128;
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 6, 2);
}
}
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(5) == 0 ? new WorldGenTrees(false, 4 + par1Random.nextInt(7), 3, 3, true) : new WorldGenRainforest1(false);
}
Block block = Block.blocksList[var10];
if (block != null
&& block.isGenMineableReplaceable(par1World, var7, var8,
var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9,
Blocks.amethystOre.get().blockID, 6, 2);
}
}
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 11002176;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(5) == 0 ? new WorldGenTrees(false,
4 + par1Random.nextInt(7), 3, 3, true)
: new WorldGenRainforest1(false);
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 8970560;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16228194;
}
/**
* Provides the basic grass color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 11002176;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 11128415;
else
{
par1 /= 3.0F;
/**
* Provides the basic foliage color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 8970560;
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16228194;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
{
return 11128415;
}
else
{
par1 /= 3.0F;
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F,
0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -12,98 +12,114 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.entities.EntityJungleSpider;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.WorldGenTropicsShrub;
import biomesoplenty.worldgen.tree.WorldGenPalmTree1;
public class BiomeGenTropics extends BiomeGenBase implements IFogColour
public class BiomeGenTropics extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenTropics(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 12;
customBiomeDecorator.grassPerChunk = 7;
customBiomeDecorator.wheatGrassPerChunk = 4;
customBiomeDecorator.flowersPerChunk = 10;
customBiomeDecorator.sandPerChunk = 50;
customBiomeDecorator.sandPerChunk2 = 50;
customBiomeDecorator.orangeFlowersPerChunk = 10;
customBiomeDecorator.whiteFlowersPerChunk = 4;
customBiomeDecorator.sunflowersPerChunk = 2;
customBiomeDecorator.hibiscusPerChunk = 45;
customBiomeDecorator.shrubsPerChunk = 4;
customBiomeDecorator.generatePumpkins = false;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));
spawnableCreatureList.clear();
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
@SuppressWarnings("unchecked")
public BiomeGenTropics(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 12;
customBiomeDecorator.grassPerChunk = 7;
customBiomeDecorator.wheatGrassPerChunk = 4;
customBiomeDecorator.flowersPerChunk = 10;
customBiomeDecorator.sandPerChunk = 50;
customBiomeDecorator.sandPerChunk2 = 50;
customBiomeDecorator.orangeFlowersPerChunk = 10;
customBiomeDecorator.whiteFlowersPerChunk = 4;
customBiomeDecorator.sunflowersPerChunk = 2;
customBiomeDecorator.hibiscusPerChunk = 45;
customBiomeDecorator.shrubsPerChunk = 4;
customBiomeDecorator.generatePumpkins = false;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class,
12, 6, 6));
spawnableCreatureList.clear();
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 6, 2);
}
}
}
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenPalmTree1() : (par1Random.nextInt(2) == 0 ? new WorldGenTropicsShrub() : new WorldGenShrub(0,0));
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 7724287;
}
Block block = Block.blocksList[var10];
if (block != null
&& block.isGenMineableReplaceable(par1World, var7, var8,
var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9,
Blocks.amethystOre.get().blockID, 6, 2);
}
}
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 507391;
else
{
par1 /= 3.0F;
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenPalmTree1()
: (par1Random.nextInt(2) == 0 ? new WorldGenTropicsShrub()
: new WorldGenShrub(0, 0));
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 7724287;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
{
return 507391;
}
else
{
par1 /= 3.0F;
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F,
0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -7,89 +7,103 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IFogColour;
import biomesoplenty.interfaces.IBOPFog;
import biomesoplenty.worldgen.WorldGenWasteland;
import biomesoplenty.worldgen.WorldGenWasteland2;
import biomesoplenty.worldgen.tree.WorldGenDeadTree3;
public class BiomeGenWasteland extends BiomeGenBase implements IFogColour
public class BiomeGenWasteland extends BiomeGenBase implements IBOPFog
{
private BiomeDecoratorBOP customBiomeDecorator;
private BiomeDecoratorBOP customBiomeDecorator;
public BiomeGenWasteland(int par1)
{
super(par1);
topBlock = (byte)Blocks.driedDirt.get().blockID;
fillerBlock = (byte)Blocks.driedDirt.get().blockID;
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 1;
customBiomeDecorator.deadGrassPerChunk = 14;
customBiomeDecorator.poisonWaterPerChunk = 10;
waterColorMultiplier = 15073024;
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
}
public BiomeGenWasteland(int par1)
{
super(par1);
topBlock = (byte) Blocks.driedDirt.get().blockID;
fillerBlock = (byte) Blocks.driedDirt.get().blockID;
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 1;
customBiomeDecorator.deadGrassPerChunk = 14;
customBiomeDecorator.poisonWaterPerChunk = 10;
waterColorMultiplier = 15073024;
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenWasteland() : (par1Random.nextInt(4) == 0 ? new WorldGenWasteland2() : new WorldGenDeadTree3(false));
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenWasteland()
: (par1Random.nextInt(4) == 0 ? new WorldGenWasteland2()
: new WorldGenDeadTree3(false));
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 10330232;
}
/**
* Provides the basic grass color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 10330232;
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 10067541;
}
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 5662280;
}
/**
* Provides the basic foliage color based on the biome temperature and
* rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 10067541;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 10465942;
else
{
par1 /= 3.0F;
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 5662280;
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
{
return 10465942;
}
else
{
par1 /= 3.0F;
if (par1 > 1.0F)
{
par1 = 1.0F;
}
if (par1 < -1.0F)
{
par1 = -1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F,
0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -1,6 +1,8 @@
package biomesoplenty.interfaces;
public interface IFogColour
public interface IBOPFog
{
public int getFogColour();
public float getFogCloseness();
}