summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java')
-rwxr-xr-xsrc/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java68
1 files changed, 43 insertions, 25 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java b/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java
index 7e492bc..6157927 100755
--- a/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java
+++ b/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java
@@ -16,7 +16,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class EntityShadowsFX extends EntityFX {
- float moteParticleScale;
+ float moteParticleScale;
ResourceLocation texture;
/**
@@ -29,10 +29,11 @@ public class EntityShadowsFX extends EntityFX {
* @param texture
*/
public EntityShadowsFX(World world, double x, double y, double z,
- float size, float maxAge, ResourceLocation texture) {
+ float size, float maxAge,
+ ResourceLocation texture) {
super(world, x, y, z, 0D, 0D, 0D);
- particleMaxAge =
- (int) (28D / (Math.random() * 0.3D + 0.7D) * maxAge);
+ particleMaxAge = (int) (28D / (Math.random() * 0.3D + 0.7D)
+ * maxAge);
particleGravity = 0F;
motionX = motionY = motionZ = 0;
particleScale *= size;
@@ -52,8 +53,9 @@ public class EntityShadowsFX extends EntityFX {
* @param maxZ
*/
@Override
- public void renderParticle(Tessellator tessellator, float partialTicks,
- float minX, float minY, float minZ, float maxX, float maxZ) {
+ public void renderParticle(Tessellator tessellator,
+ float partialTicks, float minX, float minY,
+ float minZ, float maxX, float maxZ) {
tessellator.draw();
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GL11.glColor4f(1, 1, 1, 1);
@@ -64,14 +66,22 @@ public class EntityShadowsFX extends EntityFX {
float y = (float) (posY - interpPosY);
float z = (float) (posZ - interpPosZ);
tessellator.setColorRGBA_F(0F, 0F, 0F, 0.5F);
- tessellator.addVertexWithUV(x - minX * scale - maxX * scale,
- y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0);
- tessellator.addVertexWithUV(x - minX * scale + maxX * scale,
- y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0);
- tessellator.addVertexWithUV(x + minX * scale + maxX * scale,
- y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1);
- tessellator.addVertexWithUV(x + minX * scale - maxX * scale,
- y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1);
+ tessellator.addVertexWithUV(
+ x - minX * scale - maxX * scale,
+ y - minY * scale,
+ z - minZ * scale - maxZ * scale, 0, 0);
+ tessellator.addVertexWithUV(
+ x - minX * scale + maxX * scale,
+ y + minY * scale,
+ z - minZ * scale + maxZ * scale, 1, 0);
+ tessellator.addVertexWithUV(
+ x + minX * scale + maxX * scale,
+ y + minY * scale,
+ z + minZ * scale + maxZ * scale, 1, 1);
+ tessellator.addVertexWithUV(
+ x + minX * scale - maxX * scale,
+ y - minY * scale,
+ z + minZ * scale - maxZ * scale, 0, 1);
tessellator.draw();
tessellator.startDrawingQuads();
}
@@ -87,22 +97,30 @@ public class EntityShadowsFX extends EntityFX {
motionX = motionY = motionZ = 0;
if (particleAge++ >= particleMaxAge)
setDead();
- AxisAlignedBB axisalignedbb =
- boundingBox.expand(16.0D, 16.0D, 16.0D);
- List<?> list1 = worldObj.getEntitiesWithinAABB(Entity.class,
- axisalignedbb);
- if (!worldObj.isRemote && list1 != null && !list1.isEmpty()) {
+ AxisAlignedBB axisalignedbb = boundingBox.expand(16.0D,
+ 16.0D, 16.0D);
+ List<?> list1 = worldObj.getEntitiesWithinAABB(
+ Entity.class, axisalignedbb);
+ if (!worldObj.isRemote && list1 != null
+ && !list1.isEmpty()) {
Iterator<?> iterator = list1.iterator();
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
- if (entity != null && posX <= entity.posX + 0.5F
- && posX >= entity.posX - 0.5F
- && posZ <= entity.posZ + 0.5F
- && posZ >= entity.posZ - 0.5F)
- entity.attackEntityFrom(DamageSourceList.shadows,
+ if (entity != null
+ && posX <= entity.posX
+ + 0.5F
+ && posX >= entity.posX
+ - 0.5F
+ && posZ <= entity.posZ
+ + 0.5F
+ && posZ >= entity.posZ
+ - 0.5F)
+ entity.attackEntityFrom(
+ DamageSourceList.shadows,
100F);
if (entity instanceof EntityThrowable)
- ((EntityThrowable) entity).setDead();
+ ((EntityThrowable) entity)
+ .setDead();
}
}
}