Skip to content

Commit

Permalink
how many fucking times am i going to polish these trails
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor4t committed Nov 2, 2022
1 parent a919cdf commit db509c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
8 changes: 3 additions & 5 deletions src/main/java/ladysnake/effective/client/Effective.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ladysnake.effective.client;

import com.sammy.lodestone.systems.rendering.particle.type.LodestoneParticleType;
import ladysnake.effective.client.particle.*;
import ladysnake.effective.client.particle.types.ColoredParticleType;
import ladysnake.effective.client.particle.types.SplashParticleType;
import ladysnake.effective.client.render.entity.model.SplashBottomModel;
import ladysnake.effective.client.render.entity.model.SplashBottomRimModel;
Expand Down Expand Up @@ -58,7 +56,7 @@ public class Effective implements ClientModInitializer {
public static DefaultParticleType GLOW_DROPLET;
public static DefaultParticleType GLOW_RIPPLE;
public static DefaultParticleType GLOW_WATERFALL_CLOUD;
public static AllayTwinkParticleType ALLAY_TWINKLE;
public static AllayTwinkleParticleType ALLAY_TWINKLE;

// sound events
public static SoundEvent AMBIENCE_WATERFALL = new SoundEvent(new Identifier(MODID, "ambience.waterfall"));
Expand Down Expand Up @@ -96,8 +94,8 @@ public void onInitializeClient() {
ParticleFactoryRegistry.getInstance().register(Effective.GLOW_RIPPLE, GlowRippleParticle.DefaultFactory::new);
GLOW_WATERFALL_CLOUD = Registry.register(Registry.PARTICLE_TYPE, "effective:glow_waterfall_cloud", FabricParticleTypes.simple(true));
ParticleFactoryRegistry.getInstance().register(Effective.GLOW_WATERFALL_CLOUD, GlowWaterfallCloudParticle.DefaultFactory::new);
ALLAY_TWINKLE = Registry.register(Registry.PARTICLE_TYPE, "effective:allay_twinkle", new AllayTwinkParticleType());
ParticleFactoryRegistry.getInstance().register(Effective.ALLAY_TWINKLE, AllayTwinkParticleType.Factory::new);
ALLAY_TWINKLE = Registry.register(Registry.PARTICLE_TYPE, "effective:allay_twinkle", new AllayTwinkleParticleType());
ParticleFactoryRegistry.getInstance().register(Effective.ALLAY_TWINKLE, AllayTwinkleParticleType.Factory::new);

// sound events
AMBIENCE_WATERFALL = Registry.register(Registry.SOUND_EVENT, AMBIENCE_WATERFALL.getId(), AMBIENCE_WATERFALL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.MathHelper;

public class AllayTwinkParticle extends FrameSetParticle {
public AllayTwinkParticle(ClientWorld world, WorldParticleEffect data, FabricSpriteProviderImpl spriteSet, double x, double y, double z, double xd, double yd, double zd) {
public class AllayTwinkleParticle extends FrameSetParticle {
public AllayTwinkleParticle(ClientWorld world, WorldParticleEffect data, FabricSpriteProviderImpl spriteSet, double x, double y, double z, double xd, double yd, double zd) {
super(world, data, spriteSet, x, y, z, xd, yd, zd);
addFrames(0, 5);
setMaxAge(frameSet.size()*5);
setMaxAge(frameSet.size()*3);
this.scale = 0.12f;
}
@Override
public void tick() {
super.tick();
if (age < frameSet.size()*5) {
setSprite(frameSet.get(MathHelper.floor(age/5f)));
this.scale = 0.12f;
if (age < frameSet.size()*3) {
setSprite(frameSet.get(MathHelper.floor(age/3f)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

import javax.annotation.Nullable;

public class AllayTwinkParticleType extends ParticleType<WorldParticleEffect> {
public AllayTwinkParticleType() {
public class AllayTwinkleParticleType extends ParticleType<WorldParticleEffect> {
public AllayTwinkleParticleType() {
super(false, WorldParticleEffect.DESERIALIZER);
}

Expand All @@ -32,7 +32,7 @@ public Factory(SpriteProvider sprite) {
@Nullable
@Override
public Particle createParticle(WorldParticleEffect data, ClientWorld world, double x, double y, double z, double mx, double my, double mz) {
return new AllayTwinkParticle(world, data, (FabricSpriteProviderImpl) sprite, x, y, z, mx, my, mz);
return new AllayTwinkleParticle(world, data, (FabricSpriteProviderImpl) sprite, x, y, z, mx, my, mz);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ public void render(T livingEntity, float entityYaw, float tickDelta, MatrixStack

// twinkles
if ((allayEntity.getRandom().nextInt(100) + 1) <= EffectiveConfig.allayTwinkleDensity && EffectiveUtils.isGoingFast(allayEntity) && !MinecraftClient.getInstance().isPaused()) {
float spreadDivider = 4f;
ParticleBuilders.create(Effective.ALLAY_TWINKLE)
.setColor(new Color(data.color), new Color(data.color))
.setAlpha(0.9f).setScale(0.06f).setLifetime(15)
.setMotion(0, 0.05f, 0)
.spawn(allayEntity.world, allayEntity.getClientCameraPosVec(MinecraftClient.getInstance().getTickDelta()).x + allayEntity.getRandom().nextGaussian() / 3f, allayEntity.getClientCameraPosVec(MinecraftClient.getInstance().getTickDelta()).y - 0.2f + allayEntity.getRandom().nextGaussian() / 3f, allayEntity.getClientCameraPosVec(MinecraftClient.getInstance().getTickDelta()).z + allayEntity.getRandom().nextGaussian() / 3f);
.spawn(allayEntity.world, allayEntity.getClientCameraPosVec(MinecraftClient.getInstance().getTickDelta()).x + allayEntity.getRandom().nextGaussian() / spreadDivider, allayEntity.getClientCameraPosVec(MinecraftClient.getInstance().getTickDelta()).y - 0.2f + allayEntity.getRandom().nextGaussian() / spreadDivider, allayEntity.getClientCameraPosVec(MinecraftClient.getInstance().getTickDelta()).z + allayEntity.getRandom().nextGaussian() / spreadDivider);
}
}
}
Expand Down

0 comments on commit db509c6

Please sign in to comment.