Skip to content

Commit

Permalink
Hexagon apparently
Browse files Browse the repository at this point in the history
  • Loading branch information
SammySemicolon committed Nov 21, 2023
1 parent e66b1c2 commit 8d71787
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ParticleRegistry {

public static RegistryObject<LodestoneDirectionalParticleType> SQUARE = PARTICLES.register("square", LodestoneDirectionalParticleType::new);
public static RegistryObject<LodestoneDirectionalParticleType> CIRCLE = PARTICLES.register("circle", LodestoneDirectionalParticleType::new);
public static RegistryObject<LodestoneDirectionalParticleType> HEXAGON = PARTICLES.register("hexagon", LodestoneDirectionalParticleType::new);

public static RegistryObject<SimpleParticleType> SCYTHE_CUT_ATTACK_PARTICLE = PARTICLES.register("scythe_cut_attack", () -> new SimpleParticleType(true));
public static RegistryObject<SimpleParticleType> SCYTHE_SWEEP_ATTACK_PARTICLE = PARTICLES.register("scythe_sweep_attack", () -> new SimpleParticleType(true));
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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();
}

Expand Down Expand Up @@ -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<LodestoneWorldParticleActor> 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)
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/malum/particles/hexagon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"textures": [
"malum:hexagon"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8d71787

Please sign in to comment.