This repository has been archived by the owner on Aug 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Showing
7 changed files
with
89 additions
and
3 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
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
70 changes: 70 additions & 0 deletions
70
src/main/java/ladysnake/illuminations/client/particle/aura/PrismarineAuraParticle.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,70 @@ | ||
package ladysnake.illuminations.client.particle.aura; | ||
|
||
import ladysnake.illuminations.client.particle.PrismarineCrystalParticle; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.particle.Particle; | ||
import net.minecraft.client.particle.ParticleFactory; | ||
import net.minecraft.client.particle.SpriteProvider; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particle.DefaultParticleType; | ||
|
||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
public class PrismarineAuraParticle extends PrismarineCrystalParticle { | ||
public PrismarineAuraParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { | ||
super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); | ||
|
||
this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 2d, this.z + TwilightFireflyParticle.getWanderingDistance(this.random)); | ||
|
||
this.maxAge = ThreadLocalRandom.current().nextInt(100, 400); | ||
} | ||
|
||
public void tick() { | ||
if (this.age++ < this.maxAge) { | ||
this.colorAlpha = Math.min(1f, this.colorAlpha + 0.1f); | ||
} | ||
|
||
this.prevPosX = this.x; | ||
this.prevPosY = this.y; | ||
this.prevPosZ = this.z; | ||
|
||
this.move(this.velocityX, this.velocityY, this.velocityZ); | ||
|
||
if (this.age >= this.maxAge) { | ||
this.colorAlpha = Math.max(0f, this.colorAlpha - 0.1f); | ||
|
||
if (this.colorAlpha <= 0f) { | ||
this.markDead(); | ||
} | ||
} | ||
|
||
this.colorRed = 0.8f + (float) Math.sin(this.age / 10f) * 0.2f; | ||
// this.colorBlue = 0.9f + (float) Math.cos(this.age/10f) * 0.1f; | ||
|
||
this.prevAngle = this.angle; | ||
if (this.onGround) { | ||
this.velocityX = 0; | ||
this.velocityY = 0; | ||
this.velocityZ = 0; | ||
} | ||
|
||
if (this.velocityY != 0) { | ||
this.angle += Math.PI * Math.sin(rotationFactor * this.age) / 2; | ||
} | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public static class DefaultFactory implements ParticleFactory<DefaultParticleType> { | ||
private final SpriteProvider spriteProvider; | ||
|
||
public DefaultFactory(SpriteProvider spriteProvider) { | ||
this.spriteProvider = spriteProvider; | ||
} | ||
|
||
public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { | ||
return new PrismarineAuraParticle(clientWorld, d, e, f, g, h, i, this.spriteProvider); | ||
} | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/illuminations/materialmaps/particle/prismarine_aura.json
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,3 @@ | ||
{ | ||
"material": "canvas:emissive_no_diffuse" | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/illuminations/particles/prismarine_aura.json
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,7 @@ | ||
{ | ||
"textures": [ | ||
"illuminations:prismarine_crystal_0", | ||
"illuminations:prismarine_crystal_1", | ||
"illuminations:prismarine_crystal_2" | ||
] | ||
} |
Binary file added
BIN
+299 Bytes
src/main/resources/assets/illuminations/textures/entity/prismarine_crown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.