Added pixie trail particles that keep crashing

Prevented underground liquid poison/spring water lakes from generating in the Origin Valley, Nether, and Promised Land

Nothing happened here...
This commit is contained in:
Matt Caughey 2013-11-16 20:47:48 -05:00 committed by Adubbz
parent 73e4abdb25
commit 15f0bd2f98
19 changed files with 192 additions and 10 deletions

View file

@ -37,6 +37,7 @@ import biomesoplenty.entities.render.RenderRosester;
import biomesoplenty.entities.render.RenderWasp;
import biomesoplenty.particles.EntityDandelionFX;
import biomesoplenty.particles.EntityMagicTreeFX;
import biomesoplenty.particles.EntityPixieTrailFX;
import biomesoplenty.particles.EntitySteamFX;
import cpw.mods.fml.client.registry.RenderingRegistry;
@ -132,6 +133,10 @@ public class ClientProxy extends CommonProxy {
{
entityfx = new EntityMagicTreeFX(mc.theWorld, x, y, z, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03));
}
else if (string == "pixietrail")
{
entityfx = new EntityPixieTrailFX(mc.theWorld, x, y, z, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(rand, -0.03, 0.03));
}
mc.effectRenderer.addEffect(entityfx);
}

View file

@ -446,6 +446,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
public boolean generateQuicksand;
public boolean generateSponge;
public boolean generateMossySkystone;
public boolean generateUndergroundLakes;
public BiomeDecoratorBOP(BiomeGenBase par1BiomeGenBase)
{
@ -687,6 +688,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
generateQuicksand = false;
generateSponge = false;
generateMossySkystone = false;
generateUndergroundLakes = true;
biome = par1BiomeGenBase;
}
@ -775,10 +777,13 @@ public class BiomeDecoratorBOP extends BiomeDecorator
{
if (var9999 == 1)
{
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
var4 = randomGenerator.nextInt(randomGenerator.nextInt(randomGenerator.nextInt(32) + 8) + 8);
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
(new WorldGenLakes(Fluids.springWater.get().blockID)).generate(currentWorld, randomGenerator, var3, var4, var5);
if (generateUndergroundLakes)
{
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
var4 = randomGenerator.nextInt(randomGenerator.nextInt(randomGenerator.nextInt(32) + 8) + 8);
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
(new WorldGenLakes(Fluids.springWater.get().blockID)).generate(currentWorld, randomGenerator, var3, var4, var5);
}
}
}
}
@ -802,10 +807,13 @@ public class BiomeDecoratorBOP extends BiomeDecorator
{
if (var9998 == 1)
{
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
var4 = randomGenerator.nextInt(randomGenerator.nextInt(randomGenerator.nextInt(32) + 8) + 8);
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
(new WorldGenLakes(Fluids.liquidPoison.get().blockID)).generate(currentWorld, randomGenerator, var3, var4, var5);
if (generateUndergroundLakes)
{
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
var4 = randomGenerator.nextInt(randomGenerator.nextInt(randomGenerator.nextInt(32) + 8) + 8);
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
(new WorldGenLakes(Fluids.liquidPoison.get().blockID)).generate(currentWorld, randomGenerator, var3, var4, var5);
}
}
}
}

View file

@ -29,6 +29,7 @@ public class BiomeGenOriginValley extends BiomeGenBase
customBiomeDecorator.stalagmitesPerChunk = -999;
customBiomeDecorator.stalactitesPerChunk = -999;
customBiomeDecorator.minersDelightPerChunk = -999;
customBiomeDecorator.generateUndergroundLakes = false;
}
/**

View file

@ -22,6 +22,7 @@ public class BiomeGenNetherBase extends BiomeGenBase
customBiomeDecorator.gravesPerChunk = 1;
customBiomeDecorator.burningBlossomsPerChunk = 1;
customBiomeDecorator.waspHivesPerChunk = 1;
customBiomeDecorator.generateUndergroundLakes = false;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();

View file

@ -22,6 +22,7 @@ public class BiomeGenNetherBlood extends BiomeGenBase
fillerBlock = (byte)Blocks.flesh.get().blockID;
customBiomeDecorator.gravesPerChunk = 1;
customBiomeDecorator.waspHivesPerChunk = 1;
customBiomeDecorator.generateUndergroundLakes = false;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();

View file

@ -23,6 +23,7 @@ public class BiomeGenNetherBone extends BiomeGenBase
customBiomeDecorator.boneSpines2PerChunk = 12;
customBiomeDecorator.gravesPerChunk = 1;
customBiomeDecorator.waspHivesPerChunk = 1;
customBiomeDecorator.generateUndergroundLakes = false;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();

View file

@ -22,6 +22,7 @@ public class BiomeGenNetherDesert extends BiomeGenBase
customBiomeDecorator.thornsPerChunk = 10;
customBiomeDecorator.gravesPerChunk = 1;
customBiomeDecorator.waspHivesPerChunk = 1;
customBiomeDecorator.generateUndergroundLakes = false;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();

View file

@ -34,6 +34,7 @@ public class BiomeGenNetherGarden extends BiomeGenBase
customBiomeDecorator.gravesPerChunk = 1;
customBiomeDecorator.burningBlossomsPerChunk = 8;
customBiomeDecorator.waspHivesPerChunk = 1;
customBiomeDecorator.generateUndergroundLakes = false;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();

View file

@ -32,6 +32,7 @@ public class BiomeGenNetherLava extends BiomeGenBase
customBiomeDecorator.gravesPerChunk = 1;
customBiomeDecorator.burningBlossomsPerChunk = 4;
customBiomeDecorator.waspHivesPerChunk = 1;
customBiomeDecorator.generateUndergroundLakes = false;
customBiomeDecorator.generateAsh = true;
spawnableMonsterList.clear();
spawnableCreatureList.clear();

View file

@ -48,6 +48,7 @@ public class BiomeGenPromisedLandForest extends BiomeGenBase implements IWCFog
spawnableCaveCreatureList.clear();
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.generateMossySkystone = true;
customBiomeDecorator.generateUndergroundLakes = false;
//customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);

View file

@ -44,6 +44,7 @@ public class BiomeGenPromisedLandPlains extends BiomeGenBase implements IWCFog
spawnableCaveCreatureList.clear();
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.generateMossySkystone = true;
customBiomeDecorator.generateUndergroundLakes = false;
//customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);

View file

@ -43,6 +43,7 @@ public class BiomeGenPromisedLandShrub extends BiomeGenBase implements IWCFog
spawnableCaveCreatureList.clear();
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.generateMossySkystone = true;
customBiomeDecorator.generateUndergroundLakes = false;
//customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);

View file

@ -49,6 +49,7 @@ public class BiomeGenPromisedLandSwamp extends BiomeGenBase implements IWCFog
spawnableCaveCreatureList.clear();
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.generateMossySkystone = true;
customBiomeDecorator.generateUndergroundLakes = false;
//customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);

View file

@ -149,7 +149,10 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
{
if (!(world.getBlockId(x, y - 1, z) == Blocks.leaves1.get().blockID && world.getBlockMetadata(x, y - 1, z) == 2))
{
BiomesOPlenty.proxy.spawnParticle("magictree", x + random.nextFloat(), y + 0.9F, z + random.nextFloat());
if (random.nextInt(5) == 0)
{
BiomesOPlenty.proxy.spawnParticle("magictree", x + random.nextFloat(), y + 0.9F, z + random.nextFloat());
}
}
}

View file

@ -1,5 +1,6 @@
package biomesoplenty.entities;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Items;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
@ -88,6 +89,20 @@ public class EntityPixie extends EntityFlyingMob
this.entityDropItem(new ItemStack(Items.miscItems.get(), 1, 11), 0.0F);
}
}
@Override
public void onEntityUpdate()
{
super.onEntityUpdate();
for (int i = 0; i < 3; i++)
{
if (this.rand.nextInt(3) == 0)
{
BiomesOPlenty.proxy.spawnParticle("pixietrail", this.posX + (this.rand.nextDouble()) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.rand.nextDouble()) * (double)this.width);
}
}
}
@Override
protected String getLivingSound()

View file

@ -87,7 +87,7 @@ public class EntityMagicTreeFX extends EntityFX
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(75);
tessellator.setBrightness(150);
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F);
tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);

View file

@ -0,0 +1,140 @@
package biomesoplenty.particles;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Direction;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class EntityPixieTrailFX extends EntityFX
{
private static final String texture = "biomesoplenty:textures/particles/pixietrail.png";
float pixieTrailParticleScale;
public EntityPixieTrailFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
{
this(par1World, par2, par4, par6, par8, par10, par12, 1.0F);
}
public EntityPixieTrailFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14)
{
super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += par8;
this.motionY += par10;
this.motionZ += par12;
this.particleScale *= 0.75F;
this.particleScale *= par14;
this.pixieTrailParticleScale = this.particleScale;
this.particleMaxAge = (int)((8.0D / (Math.random() * 0.8D + 0.2D)) * 8);
this.particleMaxAge = (int)((float)this.particleMaxAge * par14);
this.particleAge = (particleMaxAge / 2) + (int)((particleMaxAge / 2) * par1World.rand.nextInt(7));
this.noClip = false;
}
@Override
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
float f = (particleAge + par2) / particleMaxAge * 32.0F;
if (f < 0.0F)
{
f = 0.0F;
}
if (f > 1.0F)
{
f = 1.0F;
}
particleScale = particleScale * f;
tessellator.draw();
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(texture));
float f6 = (float)this.particleTextureIndexX / 16.0F;
float f7 = f6 + 0.0624375F;
float f8 = (float)this.particleTextureIndexY / 16.0F;
float f9 = f8 + 0.0624375F;
float f10 = 0.1F * this.particleScale;
if (this.particleIcon != null)
{
f6 = this.particleIcon.getMinU();
f7 = this.particleIcon.getMaxU();
f8 = this.particleIcon.getMinV();
f9 = this.particleIcon.getMaxV();
}
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(175);
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F);
tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);
tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8);
tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8);
tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9);
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("textures/particle/particles.png"));
tessellator.startDrawingQuads();
}
@Override
public void onUpdate()
{
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
if (particleAge++ >= particleMaxAge)
{
this.setDead();
}
this.setParticleTextureIndex(7 - particleAge * 8 / particleMaxAge);
this.moveEntity(motionX, motionY, motionZ);
if (posY == prevPosY)
{
motionX *= 1.1D;
motionZ *= 1.1D;
}
motionX *= 0.9599999785423279D;
motionY *= 0.9599999785423279D;
motionZ *= 0.9599999785423279D;
if (onGround)
{
motionX *= 0.699999988079071D;
motionZ *= 0.699999988079071D;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B