mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-22 05:12:24 +00:00
The great format and clean up. IMPORTANT: Read below.
All devs and contributors should use the provided formatter settings. If your IDE does not support the format, the rules are simple, it is the default java formatting rules, with 200char line lengths and 1 extra line after class definitions.
This commit is contained in:
1 parent
906c730a3c
commit
4cfcc874dc
136 files changed
+10365
-11272
No files matched your search
@@ -14,141 +14,125 @@ import com.cricketcraft.chisel.utils.General;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EntityBallOMossFX extends EntityFX
|
||||
{
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
public class EntityBallOMossFX extends EntityFX {
|
||||
|
||||
float u0, u1, v0, v1;
|
||||
IIcon icon;
|
||||
IIcon iconPlus = new IIcon()
|
||||
{
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconWidth()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
float u0, u1, v0, v1;
|
||||
IIcon icon;
|
||||
IIcon iconPlus = new IIcon() {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconHeight()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconWidth() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinU()
|
||||
{
|
||||
return u0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxU()
|
||||
{
|
||||
return u1;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinU() {
|
||||
return u0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedU(double d0)
|
||||
{
|
||||
return (float) (u0 + d0 * (u1 - u0) / 16.0f);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxU() {
|
||||
return u1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinV()
|
||||
{
|
||||
return v0;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedU(double d0) {
|
||||
return (float) (u0 + d0 * (u1 - u0) / 16.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxV()
|
||||
{
|
||||
return v1;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMinV() {
|
||||
return v0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedV(double d0)
|
||||
{
|
||||
return (float) (v0 + d0 * (v1 - v0) / 16.0f);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getMaxV() {
|
||||
return v1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getIconName()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getInterpolatedV(double d0) {
|
||||
return (float) (v0 + d0 * (v1 - v0) / 16.0f);
|
||||
}
|
||||
|
||||
};
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getIconName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public EntityBallOMossFX(World world, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y + 0.5, z, 0, 0, 0);
|
||||
};
|
||||
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.4 + 0.4 * General.rand.nextDouble();
|
||||
public EntityBallOMossFX(World world, double x, double y, double z) {
|
||||
super(world, x, y + 0.5, z, 0, 0, 0);
|
||||
|
||||
particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5;
|
||||
if(General.rand.nextInt(10) == 0)
|
||||
particleMaxAge += General.rand.nextDouble() * 40.0;
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.4 + 0.4 * General.rand.nextDouble();
|
||||
|
||||
motionX = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
motionY = (General.rand.nextDouble() * 0.5) * 0.7;
|
||||
motionZ = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
particleGravity = 2.0f;
|
||||
particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5;
|
||||
if (General.rand.nextInt(10) == 0)
|
||||
particleMaxAge += General.rand.nextDouble() * 40.0;
|
||||
|
||||
// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
|
||||
motionX = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
motionY = (General.rand.nextDouble() * 0.5) * 0.7;
|
||||
motionZ = (General.rand.nextDouble() - 0.5) * 0.7;
|
||||
particleGravity = 2.0f;
|
||||
|
||||
icon = ModItems.itemBallOMoss.getIconFromDamage(0);
|
||||
float width = 4.0f + General.rand.nextFloat() * 8.0f;
|
||||
float uu = General.rand.nextFloat() * (16.0f - width);
|
||||
float vv = General.rand.nextFloat() * (16.0f - width);
|
||||
u0 = icon.getInterpolatedU(uu);
|
||||
u1 = icon.getInterpolatedU(uu + width);
|
||||
v0 = icon.getInterpolatedV(vv);
|
||||
v1 = icon.getInterpolatedV(vv + width);
|
||||
// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
|
||||
|
||||
setParticleIcon(iconPlus);
|
||||
}
|
||||
icon = ModItems.itemBallOMoss.getIconFromDamage(0);
|
||||
float width = 4.0f + General.rand.nextFloat() * 8.0f;
|
||||
float uu = General.rand.nextFloat() * (16.0f - width);
|
||||
float vv = General.rand.nextFloat() * (16.0f - width);
|
||||
u0 = icon.getInterpolatedU(uu);
|
||||
u1 = icon.getInterpolatedU(uu + width);
|
||||
v0 = icon.getInterpolatedV(vv);
|
||||
v1 = icon.getInterpolatedV(vv + width);
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
setParticleIcon(iconPlus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY)
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
|
||||
double remaining = particleMaxAge - particleAge;
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(remaining < 5)
|
||||
{
|
||||
particleAlpha = (float) (remaining / 5.0);
|
||||
} else
|
||||
{
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
}
|
||||
double remaining = particleMaxAge - particleAge;
|
||||
|
||||
if (remaining < 5) {
|
||||
particleAlpha = (float) (remaining / 5.0);
|
||||
} else {
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,60 +7,55 @@ import net.minecraft.world.World;
|
||||
import com.cricketcraft.chisel.block.BlockGrimstone;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
|
||||
public class EntityGrimstoneFX extends EntityFX
|
||||
{
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
public class EntityGrimstoneFX extends EntityFX {
|
||||
|
||||
public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
|
||||
noClip = true;
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
noClip = true;
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY)
|
||||
{
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(particleAge < fadetime)
|
||||
particleAlpha = particleAge / fadetime;
|
||||
else if(particleAge + fadetime >= particleMaxAge)
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else
|
||||
particleAlpha = 1.0f;
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
if (particleAge < fadetime)
|
||||
particleAlpha = particleAge / fadetime;
|
||||
else if (particleAge + fadetime >= particleMaxAge)
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else
|
||||
particleAlpha = 1.0f;
|
||||
|
||||
}
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(particleAge++ >= particleMaxAge)
|
||||
{
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,60 +7,55 @@ import net.minecraft.world.World;
|
||||
import com.cricketcraft.chisel.block.BlockHolystone;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
|
||||
public class EntityHolystoneFX extends EntityFX
|
||||
{
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
public class EntityHolystoneFX extends EntityFX {
|
||||
|
||||
public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z)
|
||||
{
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
float initialScale;
|
||||
float angleOffset;
|
||||
static final float fadetime = 20f;
|
||||
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
initialScale = 1.0f + 1.0f * General.rand.nextFloat();
|
||||
angleOffset = rand.nextFloat() * 360;
|
||||
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 80;
|
||||
|
||||
noClip = true;
|
||||
setPosition(x, y, z);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
noClip = true;
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
setParticleIcon(block.iconStar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY)
|
||||
{
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(particleAge < fadetime)
|
||||
particleAlpha = particleAge / fadetime;
|
||||
else if(particleAge + fadetime >= particleMaxAge)
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else
|
||||
particleAlpha = 1.0f;
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
if (particleAge < fadetime)
|
||||
particleAlpha = particleAge / fadetime;
|
||||
else if (particleAge + fadetime >= particleMaxAge)
|
||||
particleAlpha = (particleMaxAge - particleAge) / fadetime;
|
||||
else
|
||||
particleAlpha = 1.0f;
|
||||
|
||||
}
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(particleAge++ >= particleMaxAge)
|
||||
{
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,120 +9,109 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.cricketcraft.chisel.block.BlockSnakestoneObsidian;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
|
||||
public class EntitySnakestoneObsidianFX extends EntityFX
|
||||
{
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
public class EntitySnakestoneObsidianFX extends EntityFX {
|
||||
|
||||
public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z)
|
||||
{
|
||||
super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0);
|
||||
BlockSnakestoneObsidian block;
|
||||
double tx, ty, tz;
|
||||
double speed;
|
||||
|
||||
block = b;
|
||||
public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z) {
|
||||
super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0);
|
||||
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.04 + 0.04 * General.rand.nextDouble();
|
||||
block = b;
|
||||
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 40;
|
||||
particleScale = 0.5f + 0.5f * General.rand.nextFloat();
|
||||
speed = 0.04 + 0.04 * General.rand.nextDouble();
|
||||
|
||||
tx = x + General.rand.nextDouble();
|
||||
ty = y + General.rand.nextDouble();
|
||||
tz = z + General.rand.nextDouble();
|
||||
switch(General.rand.nextInt(6))
|
||||
{
|
||||
case 0:
|
||||
tx = x;
|
||||
break;
|
||||
case 1:
|
||||
tx = x + 1;
|
||||
break;
|
||||
case 2:
|
||||
ty = y;
|
||||
break;
|
||||
case 3:
|
||||
ty = y + 1;
|
||||
break;
|
||||
case 4:
|
||||
tz = z;
|
||||
break;
|
||||
case 5:
|
||||
tz = z + 1;
|
||||
break;
|
||||
}
|
||||
particleMaxAge = (int) (Math.random() * 10.0D) + 40;
|
||||
|
||||
double dx = (tx - posX) * 3;
|
||||
double dy = (ty - posY) * 3;
|
||||
double dz = (tz - posZ) * 3;
|
||||
tx = x + General.rand.nextDouble();
|
||||
ty = y + General.rand.nextDouble();
|
||||
tz = z + General.rand.nextDouble();
|
||||
switch (General.rand.nextInt(6)) {
|
||||
case 0:
|
||||
tx = x;
|
||||
break;
|
||||
case 1:
|
||||
tx = x + 1;
|
||||
break;
|
||||
case 2:
|
||||
ty = y;
|
||||
break;
|
||||
case 3:
|
||||
ty = y + 1;
|
||||
break;
|
||||
case 4:
|
||||
tz = z;
|
||||
break;
|
||||
case 5:
|
||||
tz = z + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
setPosition(posX + dx, posY + dy, posZ + dz);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
double dx = (tx - posX) * 3;
|
||||
double dy = (ty - posY) * 3;
|
||||
double dz = (tz - posZ) * 3;
|
||||
|
||||
noClip = true;
|
||||
setPosition(posX + dx, posY + dy, posZ + dz);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
|
||||
}
|
||||
noClip = true;
|
||||
|
||||
@Override
|
||||
public int getFXLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY)
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(particleAge++ >= particleMaxAge)
|
||||
{
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
||||
}
|
||||
|
||||
double dx = tx - posX;
|
||||
double dy = ty - posY;
|
||||
double dz = tz - posZ;
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (particleAge++ >= particleMaxAge) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
double distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
if(distance == 0)
|
||||
{
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
if(distance < 0.4)
|
||||
{
|
||||
particleAlpha = (float) (distance / 0.4);
|
||||
} else if(particleAge < 20)
|
||||
{
|
||||
particleAlpha = 1.0f * particleAge / 20;
|
||||
} else
|
||||
{
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
double dx = tx - posX;
|
||||
double dy = ty - posY;
|
||||
double dz = tz - posZ;
|
||||
|
||||
if(distance < speed)
|
||||
{
|
||||
speed = distance;
|
||||
}
|
||||
double distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
if (distance == 0) {
|
||||
setDead();
|
||||
return;
|
||||
}
|
||||
if (distance < 0.4) {
|
||||
particleAlpha = (float) (distance / 0.4);
|
||||
} else if (particleAge < 20) {
|
||||
particleAlpha = 1.0f * particleAge / 20;
|
||||
} else {
|
||||
particleAlpha = 1.0f;
|
||||
}
|
||||
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
if (distance < speed) {
|
||||
speed = distance;
|
||||
}
|
||||
|
||||
double px = posX + dx / distance * speed;
|
||||
double py = posY + dy / distance * speed;
|
||||
double pz = posZ + dz / distance * speed;
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
|
||||
setPosition(px, py, pz);
|
||||
}
|
||||
double px = posX + dx / distance * speed;
|
||||
double py = posY + dy / distance * speed;
|
||||
double pz = posZ + dz / distance * speed;
|
||||
|
||||
setPosition(px, py, pz);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user