-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a91234
commit 654a75f
Showing
77 changed files
with
443 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/com/teammetallurgy/atum/client/particle/NebuFlameParticle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.teammetallurgy.atum.client.particle; | ||
|
||
import net.minecraft.client.particle.*; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particles.BasicParticleType; | ||
import net.minecraft.util.math.MathHelper; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class NebuFlameParticle extends DeceleratingParticle { | ||
|
||
public NebuFlameParticle(ClientWorld world, double x, double y, double z, double motionX, double motionY, double motionZ) { | ||
super(world, x, y, z, motionX, motionY, motionZ); | ||
} | ||
|
||
@Override | ||
@Nonnull | ||
public IParticleRenderType getRenderType() { | ||
return IParticleRenderType.PARTICLE_SHEET_OPAQUE; | ||
} | ||
|
||
@Override | ||
public void move(double x, double y, double z) { | ||
this.setBoundingBox(this.getBoundingBox().offset(x, y, z)); | ||
this.resetPositionToBB(); | ||
} | ||
|
||
@Override | ||
public float getScale(float scaleFactor) { | ||
float f = ((float) this.age + scaleFactor) / (float) this.maxAge; | ||
return this.particleScale * (1.0F - f * f * 0.5F); | ||
} | ||
|
||
@Override | ||
public int getBrightnessForRender(float partialTick) { | ||
float f = ((float) this.age + partialTick) / (float) this.maxAge; | ||
f = MathHelper.clamp(f, 0.0F, 1.0F); | ||
int i = super.getBrightnessForRender(partialTick); | ||
int j = i & 255; | ||
int k = i >> 16 & 255; | ||
j = j + (int) (f * 15.0F * 16.0F); | ||
if (j > 240) { | ||
j = 240; | ||
} | ||
|
||
return j | k << 16; | ||
} | ||
|
||
public static class Nebu implements IParticleFactory<BasicParticleType> { | ||
private final IAnimatedSprite spriteSet; | ||
|
||
public Nebu(IAnimatedSprite spriteSet) { | ||
this.spriteSet = spriteSet; | ||
} | ||
|
||
@Override | ||
public Particle makeParticle(@Nonnull BasicParticleType type, @Nonnull ClientWorld world, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { | ||
NebuFlameParticle nebuFireParticle = new NebuFlameParticle(world, x, y, z, xSpeed, ySpeed, zSpeed); | ||
nebuFireParticle.selectSpriteRandomly(this.spriteSet); | ||
return nebuFireParticle; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.