Made puddle generation more rare, made them configurable and attempted to make the lighting less horrible on them

This commit is contained in:
Adubbz 2013-07-01 11:12:33 +10:00
parent c2fedeb749
commit 138da71fd6
5 changed files with 41 additions and 35 deletions

View file

@ -57,7 +57,7 @@ public class BlockPuddle extends Block
@Override
public void updateTick(World world, int x, int y, int z, Random par5Random)
{
if (!world.isRaining() && world.rand.nextInt(750) == 0)
if (!world.isRaining() && world.rand.nextInt(400) == 0)
{
world.setBlock(x, y, z, Block.dirt.blockID);
}

View file

@ -8,7 +8,7 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
public class BlockSkinRenderHelper
public class BlockWaterSkinRenderHelper
{
public static boolean renderMetadataBlock (Block block, int metadata, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
{
@ -55,10 +55,10 @@ public class BlockSkinRenderHelper
flag1 = false;
}
boolean flag2;
/*boolean flag2;
boolean flag3;
boolean flag4;
boolean flag5;
boolean flag5;*/
float f7;
int i1;
@ -77,7 +77,7 @@ public class BlockSkinRenderHelper
render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1);
render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1);
render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)];
@ -124,7 +124,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1);
render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1);
}
}*/
if (render.renderMinY <= 0.0D)
{
@ -192,7 +192,7 @@ public class BlockSkinRenderHelper
render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos);
render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1);
render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)];
@ -239,7 +239,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1);
render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1);
}
}*/
if (render.renderMaxY >= 1.0D)
{
@ -298,7 +298,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos);
render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)];
@ -345,7 +345,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos);
render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos);
}
}*/
if (render.renderMinZ <= 0.0D)
{
@ -415,7 +415,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos);
render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos);
render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)];
@ -462,7 +462,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos);
render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos);
}
}*/
if (render.renderMaxZ >= 1.0D)
{
@ -532,7 +532,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1);
render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1);
render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)];
@ -579,7 +579,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1);
render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1);
}
}*/
if (render.renderMinX <= 0.0D)
{
@ -649,7 +649,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1);
render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1);
render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)];
@ -696,7 +696,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1);
render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1);
}
}*/
if (render.renderMaxX >= 1.0D)
{
@ -896,10 +896,10 @@ public class BlockSkinRenderHelper
flag1 = false;
}
boolean flag2;
/*boolean flag2;
boolean flag3;
boolean flag4;
boolean flag5;
boolean flag5;*/
float f7;
int i1;
@ -918,7 +918,7 @@ public class BlockSkinRenderHelper
render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1);
render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1);
render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)];
@ -965,7 +965,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1);
render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1);
}
}*/
if (render.renderMinY <= 0.0D)
{
@ -1033,7 +1033,7 @@ public class BlockSkinRenderHelper
render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos);
render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1);
render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)];
@ -1080,7 +1080,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1);
render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1);
}
}*/
if (render.renderMaxY >= 1.0D)
{
@ -1137,7 +1137,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos);
render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)];
@ -1184,7 +1184,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos);
render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos);
}
}*/
if (render.renderMinZ <= 0.0D)
{
@ -1253,7 +1253,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos);
render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos);
render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)];
@ -1300,7 +1300,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos);
render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos);
}
}*/
if (render.renderMaxZ >= 1.0D)
{
@ -1369,7 +1369,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1);
render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1);
render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)];
@ -1416,7 +1416,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1);
render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1);
}
}*/
if (render.renderMinX <= 0.0D)
{
@ -1485,7 +1485,7 @@ public class BlockSkinRenderHelper
render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1);
render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1);
render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos);
flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
/*flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)];
flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)];
flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)];
flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)];
@ -1532,7 +1532,7 @@ public class BlockSkinRenderHelper
{
render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1);
render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1);
}
}*/
if (render.renderMaxX >= 1.0D)
{

View file

@ -31,7 +31,7 @@ public class PuddleRender implements ISimpleBlockRenderingHandler
renderer.setRenderBounds(0.0, 0.8135, 0.0, 1.0, 0.8880, 1.0);
Block liquidBlock = Block.blocksList[Block.waterStill.blockID];
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
BlockWaterSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
}
}
return true;

View file

@ -21,6 +21,7 @@ public class BOPConfiguration {
public static boolean vanillaEnhanced;
public static boolean netherOverride;
public static boolean springWaterPickup;
public static boolean rainCreatesPuddles;
public static int villageDistance;
@ -512,6 +513,7 @@ public class BOPConfiguration {
vanillaEnhanced = config.get("Biome Settings", "Enhanced Vanilla Biomes", true).getBoolean(false);
promisedLandDimID = config.get("Dimension Settings", "Promised Land Dimension ID", 20, null).getInt();
netherOverride = config.get("Dimension Settings", "Enable Nether Override", true).getBoolean(true);
rainCreatesPuddles = config.get("Miscellanious Settings", "Puddles have a chance of being spawned during the rain", true).getBoolean(true);
addToDefault = config.get("Biome Settings", "Add Biomes To Default World", false).getBoolean(true);

View file

@ -12,6 +12,7 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.ForgeDirection;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPConfiguration;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
@ -35,7 +36,7 @@ public class TickHandlerServer implements ITickHandler
Chunk chunk = worldserver.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos);
worldserver.theProfiler.endStartSection("tickChunk");
if (worldserver.provider.canDoRainSnowIce(chunk) && worldserver.rand.nextInt(1000) == 0)
if (worldserver.provider.canDoRainSnowIce(chunk) && worldserver.rand.nextInt(1500) == 0)
{
rand = rand * 3 + 1013904223;
int i1 = rand >> 2;
@ -43,9 +44,12 @@ public class TickHandlerServer implements ITickHandler
int k1 = i1 >> 8 & 15;
int l1 = worldserver.getPrecipitationHeight(j1 + k, k1 + l);
if (worldserver.isRaining() && canCreatePuddle(worldserver, j1 + k, l1, k1 + l))
if (BOPConfiguration.rainCreatesPuddles)
{
worldserver.setBlock(j1 + k, l1 - 1, k1 + l, Blocks.puddle.get().blockID);
if (worldserver.isRaining() && canCreatePuddle(worldserver, j1 + k, l1, k1 + l))
{
worldserver.setBlock(j1 + k, l1 - 1, k1 + l, Blocks.puddle.get().blockID);
}
}
}
}
@ -56,7 +60,7 @@ public class TickHandlerServer implements ITickHandler
BiomeGenBase biomegenbase = worldserver.getBiomeGenForCoords(par1, par3);
float f = biomegenbase.getFloatTemperature();
if (f > 0.15F)
if (f > 0.15F && f < 2.0F)
{
if (par2 >= 0 && par2 < 256 && worldserver.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10)
{