From c954f397009e7dcf5902f2619153433f95322b0e Mon Sep 17 00:00:00 2001 From: Waterpicker Date: Mon, 27 Sep 2021 04:43:57 -0500 Subject: [PATCH] Edit Limbo monolith spawn rate and add new limbo ash particle effect. --- .../dimdoors/particle/ModParticleTypes.java | 4 ++ .../particle/client/LimboAshParticle.java | 37 +++++++++++++++++++ .../org/dimdev/dimdoors/world/ModBiomes.java | 6 ++- .../assets/dimdoors/particles/limbo_ash.json | 5 +++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/dimdev/dimdoors/particle/client/LimboAshParticle.java create mode 100644 src/main/resources/assets/dimdoors/particles/limbo_ash.json diff --git a/src/main/java/org/dimdev/dimdoors/particle/ModParticleTypes.java b/src/main/java/org/dimdev/dimdoors/particle/ModParticleTypes.java index 08ced0a0..7636e4d4 100644 --- a/src/main/java/org/dimdev/dimdoors/particle/ModParticleTypes.java +++ b/src/main/java/org/dimdev/dimdoors/particle/ModParticleTypes.java @@ -1,5 +1,6 @@ package org.dimdev.dimdoors.particle; +import org.dimdev.dimdoors.particle.client.LimboAshParticle; import org.dimdev.dimdoors.particle.client.MonolithParticle; import org.dimdev.dimdoors.particle.client.RiftParticle; import org.dimdev.dimdoors.particle.client.RiftParticleEffect; @@ -17,15 +18,18 @@ import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes; public class ModParticleTypes { public static final DefaultParticleType MONOLITH = FabricParticleTypes.simple(true); public static final ParticleType RIFT = new RiftParticleType(); + public static final DefaultParticleType LIMBO_ASH = FabricParticleTypes.simple(false); public static void init() { Registry.register(Registry.PARTICLE_TYPE, new Identifier("dimdoors", "monolith"), MONOLITH); Registry.register(Registry.PARTICLE_TYPE, new Identifier("dimdoors", "rift"), RIFT); + Registry.register(Registry.PARTICLE_TYPE, new Identifier("dimdoors", "limbo_ash"), LIMBO_ASH); } @Environment(EnvType.CLIENT) public static void initClient() { ParticleFactoryRegistry.getInstance().register(MONOLITH, new MonolithParticle.Factory()); ParticleFactoryRegistry.getInstance().register(RIFT, RiftParticle.Factory::new); + ParticleFactoryRegistry.getInstance().register(LIMBO_ASH, LimboAshParticle.Factory::new); } } diff --git a/src/main/java/org/dimdev/dimdoors/particle/client/LimboAshParticle.java b/src/main/java/org/dimdev/dimdoors/particle/client/LimboAshParticle.java new file mode 100644 index 00000000..8a3064f7 --- /dev/null +++ b/src/main/java/org/dimdev/dimdoors/particle/client/LimboAshParticle.java @@ -0,0 +1,37 @@ +package org.dimdev.dimdoors.particle.client; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.particle.*; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.particle.DefaultParticleType; + +import java.util.Random; + +@Environment(EnvType.CLIENT) +public class LimboAshParticle extends AscendingParticle { + + protected LimboAshParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, float scaleMultiplier, SpriteProvider spriteProvider) { + super(world, x, y, z, 0.1F, 0.1F, 0.01F, velocityX, velocityY, velocityZ, scaleMultiplier, spriteProvider, 0.0F, 20, 0.0125F, false); + this.colorRed = 0.167F; + this.colorGreen = 0.141F; + this.colorBlue = 0.192F; + } + + @Environment(EnvType.CLIENT) + public static class Factory implements ParticleFactory { + private final SpriteProvider spriteProvider; + + public Factory(SpriteProvider spriteProvider) { + this.spriteProvider = spriteProvider; + } + + public Particle createParticle(DefaultParticleType defaultParticleType, ClientWorld clientWorld, double d, double e, double f, double g, double h, double i) { + Random random = clientWorld.random; + double j = (double)random.nextFloat() * 0.4D * (double)random.nextFloat() * 0.1D; + double k = (double)random.nextFloat() * 0.8D * (double)random.nextFloat() * 0.1D;// * 5.0D; + double l = (double)random.nextFloat() * 0.4D * (double)random.nextFloat() * 0.1D; + return new LimboAshParticle(clientWorld, d, e, f, j, k, l, 1.0F, this.spriteProvider); + } + } +} diff --git a/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java b/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java index 746fd4f2..07b6c88a 100644 --- a/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java +++ b/src/main/java/org/dimdev/dimdoors/world/ModBiomes.java @@ -1,9 +1,11 @@ package org.dimdev.dimdoors.world; +import net.minecraft.particle.ParticleTypes; import net.minecraft.world.biome.*; import org.dimdev.dimdoors.block.ModBlocks; import org.dimdev.dimdoors.entity.ModEntityTypes; import org.dimdev.dimdoors.mixin.accessor.BuiltinBiomesAccessor; +import org.dimdev.dimdoors.particle.ModParticleTypes; import org.dimdev.dimdoors.particle.client.RiftParticleEffect; import org.dimdev.dimdoors.sound.ModSoundEvents; import org.dimdev.dimdoors.world.feature.ModFeatures; @@ -96,7 +98,7 @@ public final class ModBiomes { .music(new MusicSound(ModSoundEvents.CREEPY, 0, 0, true)) .skyColor(0x404040) .grassColor(0) - .particleConfig(new BiomeParticleConfig(new RiftParticleEffect(0.2f, 2000), 0.003F)) + .particleConfig(new BiomeParticleConfig(ModParticleTypes.LIMBO_ASH, 0.118093334F)) .build() ) .generationSettings(new GenerationSettings.Builder() @@ -128,7 +130,7 @@ public final class ModBiomes { SpawnGroup.MONSTER, new SpawnSettings.SpawnEntry( ModEntityTypes.MONOLITH, - 1, + 100, 1, 1 ) diff --git a/src/main/resources/assets/dimdoors/particles/limbo_ash.json b/src/main/resources/assets/dimdoors/particles/limbo_ash.json new file mode 100644 index 00000000..5590ac4d --- /dev/null +++ b/src/main/resources/assets/dimdoors/particles/limbo_ash.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "minecraft:generic_0" + ] +}