Start migration
This commit is contained in:
parent
6630ce0cab
commit
47ed597358
491 changed files with 12045 additions and 11953 deletions
|
@ -2,18 +2,19 @@ package ru.betterend.particle;
|
|||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.particle.AnimatedParticle;
|
||||
import net.minecraft.client.particle.SimpleAnimatedParticle;
|
||||
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 net.minecraft.client.particle.SpriteSet;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.particles.SimpleParticleType;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ParticleJungleSpore extends AnimatedParticle {
|
||||
|
||||
protected ParticleJungleSpore(ClientWorld world, double x, double y, double z, SpriteProvider sprites, double r, double g, double b) {
|
||||
public class ParticleJungleSpore extends SimpleAnimatedParticle {
|
||||
|
||||
protected ParticleJungleSpore(ClientLevel world, double x, double y, double z, SpriteSet sprites, double r,
|
||||
double g, double b) {
|
||||
super(world, x, y, z, sprites, 0);
|
||||
setSprite(sprites.getSprite(random));
|
||||
this.maxAge = MHelper.randRange(150, 300, random);
|
||||
|
@ -22,11 +23,11 @@ public class ParticleJungleSpore extends AnimatedParticle {
|
|||
this.setSpriteForAge(spriteProvider);
|
||||
this.setColorAlpha(0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
|
||||
int ticks = this.age % 30;
|
||||
if (ticks == 0) {
|
||||
this.velocityX = random.nextGaussian() * 0.02;
|
||||
|
@ -34,36 +35,34 @@ public class ParticleJungleSpore extends AnimatedParticle {
|
|||
this.velocityZ = random.nextGaussian() * 0.02;
|
||||
ticks = 0;
|
||||
}
|
||||
|
||||
|
||||
if (this.age <= 30) {
|
||||
float delta = ticks / 30F;
|
||||
this.setColorAlpha(delta);
|
||||
}
|
||||
else if (this.age >= this.maxAge) {
|
||||
} else if (this.age >= this.maxAge) {
|
||||
this.setColorAlpha(0);
|
||||
}
|
||||
else if (this.age >= this.maxAge - 30) {
|
||||
} else if (this.age >= this.maxAge - 30) {
|
||||
this.setColorAlpha((this.maxAge - this.age) / 30F);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.setColorAlpha(1);
|
||||
}
|
||||
|
||||
|
||||
this.velocityY -= 0.001F;
|
||||
this.velocityX *= 0.99F;
|
||||
this.velocityZ *= 0.99F;
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public static class FactoryJungleSpore implements ParticleFactory<DefaultParticleType> {
|
||||
private final SpriteProvider sprites;
|
||||
public static class FactoryJungleSpore implements ParticleFactory<SimpleParticleType> {
|
||||
private final SpriteSet sprites;
|
||||
|
||||
public FactoryJungleSpore(SpriteProvider sprites) {
|
||||
public FactoryJungleSpore(SpriteSet sprites) {
|
||||
this.sprites = sprites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle createParticle(DefaultParticleType type, ClientWorld world, double x, double y, double z, double vX, double vY, double vZ) {
|
||||
public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z,
|
||||
double vX, double vY, double vZ) {
|
||||
return new ParticleJungleSpore(world, x, y, z, sprites, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue