-
Notifications
You must be signed in to change notification settings - Fork 0
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
9 changed files
with
110 additions
and
41 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
28 changes: 0 additions & 28 deletions
28
src/main/java/com/wenxin2/marioverse/client/particles/FirePoweredUpParticle.java
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
src/main/java/com/wenxin2/marioverse/client/particles/GlowingSuspendedTownParticle.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,79 @@ | ||
package com.wenxin2.marioverse.client.particles; | ||
|
||
import net.minecraft.client.multiplayer.ClientLevel; | ||
import net.minecraft.client.particle.GlowParticle; | ||
import net.minecraft.client.particle.Particle; | ||
import net.minecraft.client.particle.ParticleRenderType; | ||
import net.minecraft.client.particle.SpriteSet; | ||
import net.minecraft.client.particle.SuspendedTownParticle; | ||
import net.minecraft.core.particles.SimpleParticleType; | ||
import net.minecraft.util.Mth; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.api.distmarker.OnlyIn; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
public class GlowingSuspendedTownParticle extends GlowParticle { | ||
public GlowingSuspendedTownParticle(ClientLevel world, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, SpriteSet spriteSet) { | ||
super(world, x, y, z, xSpeed, ySpeed, zSpeed, spriteSet); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public ParticleRenderType getRenderType() { | ||
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; | ||
} | ||
|
||
@Override | ||
public int getLightColor(float partialTick) { | ||
float f = ((float)this.age + partialTick) / (float)this.lifetime; | ||
f = Mth.clamp(f, 0.0F, 1.0F); | ||
int i = super.getLightColor(partialTick); | ||
int j = i & 0xFF; | ||
int k = i >> 16 & 0xFF; | ||
j += (int)(f * 15.0F * 16.0F); | ||
if (j > 240) { | ||
j = 240; | ||
} | ||
|
||
return j | k << 16; | ||
} | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
public static class FireProvider extends GlowParticle.WaxOffProvider { | ||
private final SpriteSet sprite; | ||
public FireProvider(SpriteSet spriteSet) { | ||
super(spriteSet); | ||
this.sprite = spriteSet; | ||
} | ||
|
||
@Override | ||
public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { | ||
Particle particle = new GlowingSuspendedTownParticle(world, x, y, z, xSpeed, ySpeed, zSpeed, this.sprite); | ||
|
||
particle.setColor(1.0F, 1.0F, 1.0F); | ||
particle.scale(1.5F); | ||
particle.setParticleSpeed(0.0, 0.0, 0.0); | ||
return particle; | ||
} | ||
} | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
public static class GlowingProvider extends GlowParticle.WaxOffProvider { | ||
private final SpriteSet sprite; | ||
public GlowingProvider(SpriteSet spriteSet) { | ||
super(spriteSet); | ||
this.sprite = spriteSet; | ||
} | ||
|
||
@Override | ||
public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) { | ||
Particle particle = new GlowingSuspendedTownParticle(world, x, y, z, xSpeed, ySpeed, zSpeed, this.sprite); | ||
|
||
particle.setColor(1.0F, 1.0F, 1.0F); | ||
particle.setLifetime(world.random.nextInt(30) + 10); | ||
particle.setParticleSpeed(xSpeed * 0.02 / 2.0, ySpeed * 0.04, zSpeed * 0.02 / 2.0); | ||
return particle; | ||
} | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/main/resources/assets/marioverse/particles/glowing_star.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,5 @@ | ||
{ | ||
"textures": [ | ||
"marioverse:glowing_star" | ||
] | ||
} |
Binary file added
BIN
+481 Bytes
src/main/resources/assets/marioverse/textures/particle/glowing_star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.