diff --git a/src/main/java/ladysnake/effective/client/Effective.java b/src/main/java/ladysnake/effective/client/Effective.java index 5d08c2ca..5d52926b 100644 --- a/src/main/java/ladysnake/effective/client/Effective.java +++ b/src/main/java/ladysnake/effective/client/Effective.java @@ -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; @@ -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")); @@ -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); diff --git a/src/main/java/ladysnake/effective/client/particle/AllayTwinkParticle.java b/src/main/java/ladysnake/effective/client/particle/AllayTwinkleParticle.java similarity index 63% rename from src/main/java/ladysnake/effective/client/particle/AllayTwinkParticle.java rename to src/main/java/ladysnake/effective/client/particle/AllayTwinkleParticle.java index f91c63a7..4cda80e2 100644 --- a/src/main/java/ladysnake/effective/client/particle/AllayTwinkParticle.java +++ b/src/main/java/ladysnake/effective/client/particle/AllayTwinkleParticle.java @@ -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))); } } diff --git a/src/main/java/ladysnake/effective/client/particle/AllayTwinkParticleType.java b/src/main/java/ladysnake/effective/client/particle/AllayTwinkleParticleType.java similarity index 82% rename from src/main/java/ladysnake/effective/client/particle/AllayTwinkParticleType.java rename to src/main/java/ladysnake/effective/client/particle/AllayTwinkleParticleType.java index cb53e3ee..d39cbacc 100644 --- a/src/main/java/ladysnake/effective/client/particle/AllayTwinkParticleType.java +++ b/src/main/java/ladysnake/effective/client/particle/AllayTwinkleParticleType.java @@ -11,8 +11,8 @@ import javax.annotation.Nullable; -public class AllayTwinkParticleType extends ParticleType { - public AllayTwinkParticleType() { +public class AllayTwinkleParticleType extends ParticleType { + public AllayTwinkleParticleType() { super(false, WorldParticleEffect.DESERIALIZER); } @@ -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); } } } diff --git a/src/main/java/ladysnake/effective/mixin/allays/AllayLivingEntityRendererMixin.java b/src/main/java/ladysnake/effective/mixin/allays/AllayLivingEntityRendererMixin.java index d5dce33f..c7136a5c 100644 --- a/src/main/java/ladysnake/effective/mixin/allays/AllayLivingEntityRendererMixin.java +++ b/src/main/java/ladysnake/effective/mixin/allays/AllayLivingEntityRendererMixin.java @@ -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); } } }