Edit Limbo monolith spawn rate and add new limbo ash particle effect.

This commit is contained in:
Waterpicker 2021-09-27 04:43:57 -05:00
parent 44d4a2894e
commit c954f39700
4 changed files with 50 additions and 2 deletions

View file

@ -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<RiftParticleEffect> 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);
}
}

View file

@ -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<DefaultParticleType> {
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);
}
}
}

View file

@ -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
)

View file

@ -0,0 +1,5 @@
{
"textures": [
"minecraft:generic_0"
]
}