Tweaked magic leaves

This commit is contained in:
Adubbz 2013-11-17 12:18:19 +11:00
parent 640b3c5935
commit 73e4abdb25
3 changed files with 90 additions and 74 deletions

View File

@ -1,11 +1,14 @@
package biomesoplenty;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelChicken;
import net.minecraft.client.model.ModelSlime;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.util.MathHelper;
import biomesoplenty.api.Items;
import biomesoplenty.blocks.renderers.BambooRenderer;
import biomesoplenty.blocks.renderers.FoliageRenderer;
@ -103,6 +106,8 @@ public class ClientProxy extends CommonProxy {
{
EntityFX entityfx = null;
Random rand = new Random();
if (string == "mud")
{
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get());
@ -125,12 +130,19 @@ public class ClientProxy extends CommonProxy {
}
else if (string == "magictree")
{
entityfx = new EntityMagicTreeFX(mc.theWorld, x, y, z, 0.0D, -0.02D, 0.0D);
entityfx = new EntityMagicTreeFX(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);
}
public static double generatRandomPositiveNegitiveValue(double max, double min)
{
Random rand = new Random();
double d = -min + (Math.random() * ((max - (-min)) + 1));
return d;
}
@Override
public int addArmor(String armor)
{

View File

@ -147,7 +147,10 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
if (world.getBlockId(x, y, z) == Blocks.leaves1.get().blockID && world.getBlockMetadata(x, y, z) == 2)
{
BiomesOPlenty.proxy.spawnParticle("magictree", x + random.nextFloat(), y, z + random.nextFloat());
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());
}
}
super.randomDisplayTick(world, x, y, z, random);

View File

@ -1,7 +1,11 @@
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;
@ -83,7 +87,7 @@ public class EntityMagicTreeFX extends EntityFX
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
tessellator.startDrawingQuads();
tessellator.setBrightness(240);
tessellator.setBrightness(75);
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);
@ -102,9 +106,6 @@ public class EntityMagicTreeFX extends EntityFX
tessellator.startDrawingQuads();
}
/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate()
{