From 8d717873ac7e03bf30a69d413f7ffde80612e17e Mon Sep 17 00:00:00 2001 From: SammySemicolon <69329424+SammySemicolon@users.noreply.github.com> Date: Sun, 19 Nov 2023 18:37:07 +0100 Subject: [PATCH] Hexagon apparently --- .../registry/client/ParticleRegistry.java | 2 ++ .../SpiritCrucibleParticleEffects.java | 19 ++++++++++-------- .../assets/malum/particles/hexagon.json | 5 +++++ .../malum/textures/particle/hexagon.png | Bin 0 -> 198 bytes 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/assets/malum/particles/hexagon.json create mode 100644 src/main/resources/assets/malum/textures/particle/hexagon.png diff --git a/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java b/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java index b0b63fd7a..8546c4347 100644 --- a/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java +++ b/src/main/java/com/sammy/malum/registry/client/ParticleRegistry.java @@ -29,6 +29,7 @@ public class ParticleRegistry { public static RegistryObject SQUARE = PARTICLES.register("square", LodestoneDirectionalParticleType::new); public static RegistryObject CIRCLE = PARTICLES.register("circle", LodestoneDirectionalParticleType::new); + public static RegistryObject HEXAGON = PARTICLES.register("hexagon", LodestoneDirectionalParticleType::new); public static RegistryObject SCYTHE_CUT_ATTACK_PARTICLE = PARTICLES.register("scythe_cut_attack", () -> new SimpleParticleType(true)); public static RegistryObject SCYTHE_SWEEP_ATTACK_PARTICLE = PARTICLES.register("scythe_sweep_attack", () -> new SimpleParticleType(true)); @@ -45,6 +46,7 @@ public static void registerParticleFactory(RegisterParticleProvidersEvent event) Minecraft.getInstance().particleEngine.register(SQUARE.get(), LodestoneDirectionalParticleType.Factory::new); Minecraft.getInstance().particleEngine.register(CIRCLE.get(), LodestoneDirectionalParticleType.Factory::new); + Minecraft.getInstance().particleEngine.register(HEXAGON.get(), LodestoneDirectionalParticleType.Factory::new); Minecraft.getInstance().particleEngine.register(SCYTHE_CUT_ATTACK_PARTICLE.get(), ScytheAttackParticle.Factory::new); Minecraft.getInstance().particleEngine.register(SCYTHE_SWEEP_ATTACK_PARTICLE.get(), ScytheAttackParticle.Factory::new); diff --git a/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java b/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java index ca7c23058..e2d23c8f5 100644 --- a/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java +++ b/src/main/java/com/sammy/malum/visual_effects/SpiritCrucibleParticleEffects.java @@ -24,6 +24,7 @@ import java.util.function.*; import static com.sammy.malum.visual_effects.SpiritLightSpecs.spiritLightSpecs; +import static net.minecraft.util.Mth.nextFloat; public class SpiritCrucibleParticleEffects { @@ -45,14 +46,14 @@ public static void passiveCrucibleParticles(SpiritCrucibleCoreBlockEntity crucib } } if (recipe != null) { - var lightSpecs = spiritLightSpecs(level, itemPos, activeSpiritType, LodestoneParticleRegistry.STAR_PARTICLE); + var lightSpecs = spiritLightSpecs(level, itemPos, activeSpiritType, ParticleRegistry.STAR); lightSpecs.getBuilder() .setSpinData(SpinParticleData.create(0).setSpinOffset((level.getGameTime() * 0.05f) % 6.28f).setEasing(Easing.CUBIC_IN, Easing.EXPO_IN).build()) - .modifyData(WorldParticleBuilder::getScaleData, d -> d.multiplyValue(1.7f)) - .modifyData(WorldParticleBuilder::getTransparencyData, d -> d.multiplyValue(0.5f)); + .modifyData(WorldParticleBuilder::getScaleData, d -> d.multiplyValue(2f)) + .modifyData(WorldParticleBuilder::getTransparencyData, d -> d.multiplyValue(0.25f)); lightSpecs.getBloomBuilder() - .modifyData(WorldParticleBuilder::getScaleData, d -> d.multiplyValue(1.3f)) - .modifyData(WorldParticleBuilder::getTransparencyData, d -> d.multiplyValue(0.75f)); + .modifyData(WorldParticleBuilder::getScaleData, d -> d.multiplyValue(2f)) + .modifyData(WorldParticleBuilder::getTransparencyData, d -> d.multiplyValue(0.5f)); lightSpecs.spawnParticles(); } @@ -101,10 +102,12 @@ public static void spiritCatalyzerParticles(SpiritCatalyzerCoreBlockEntity catal sparkParticles.spawnParticlesRaw(); } if (level.getGameTime() % 10L == 0) { - velocity = targetPos.subtract(startPos).normalize().scale(0.05f); + velocity = targetPos.subtract(startPos).normalize().scale(0.02f * targetPos.distanceTo(startPos)); final Consumer behavior = p -> p.setParticleMotion(p.getParticleSpeed().scale(0.98f)); - DirectionalParticleBuilder.create(ParticleRegistry.CIRCLE) - .setTransparencyData(GenericParticleData.create(0.6f, 0.2f, 0f).setEasing(Easing.SINE_IN_OUT, Easing.SINE_IN).build()) + final SpinParticleData spinData = SpinParticleData.createRandomDirection(random, RandomHelper.randomBetween(random, 0.1f, 0.2f)).randomSpinOffset(random).build(); + DirectionalParticleBuilder.create(ParticleRegistry.HEXAGON) + .setTransparencyData(GenericParticleData.create(0.6f, 0.4f, 0f).setEasing(Easing.SINE_IN_OUT, Easing.SINE_IN).build()) + .setSpinData(spinData) .setScaleData(GenericParticleData.create(0.15f, 0).setEasing(Easing.SINE_IN_OUT).build()) .setColorData(spiritType.createMainColorData().build()) .setLifetime(60) diff --git a/src/main/resources/assets/malum/particles/hexagon.json b/src/main/resources/assets/malum/particles/hexagon.json new file mode 100644 index 000000000..a2f0d6b1d --- /dev/null +++ b/src/main/resources/assets/malum/particles/hexagon.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "malum:hexagon" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/malum/textures/particle/hexagon.png b/src/main/resources/assets/malum/textures/particle/hexagon.png new file mode 100644 index 0000000000000000000000000000000000000000..375fdc169136bf6c202bd81450defb045b076060 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`-JULvAr}63CwmJq2=cf*)tS@2 zxk&C@(kf$7)5peKyHBcd|9V+7AxLX=^8$T`bLO)-uK&8o+F`Kth}PP#0$-Rq3|bB_ zJ(o#;Z=0T-%beu!cah<;*XGA=SZFcakmbyla?s%3tI2Rf?DXb^3sk0jHa}1(e9)XXw%H95^)$ee6e&#lh^PjnY8q_d)Pc=;eI*Y;6)z4*}Q$iC10{|y^N^bxF literal 0 HcmV?d00001