Skip to content

Commit

Permalink
Added unique steam particles for the Thermal Calcite Vents
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Dec 13, 2023
1 parent e3ab0f8 commit 2872a3d
Show file tree
Hide file tree
Showing 17 changed files with 94 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static void registerParticleFactories(RegisterParticleProvidersEvent even
event.registerSpriteSet(ModParticles.LANDING_BLOOD.get(), DripParticleBOP.BloodLandProvider::new);
event.registerSpriteSet(ModParticles.PUS.get(), PusParticle.Provider::new);
event.registerSpriteSet(ModParticles.GLOWWORM.get(), GlowwormParticle.Provider::new);
event.registerSpriteSet(ModParticles.STEAM.get(), SteamParticle.Provider::new);
event.registerSpriteSet(ModParticles.JACARANDA_LEAVES.get(), (p_277215_) -> {
return (p_277217_, p_277218_, p_277219_, p_277220_, p_277221_, p_277222_, p_277223_, p_277224_) -> {
return new LeafParticle(p_277218_, p_277219_, p_277220_, p_277221_, p_277215_);
Expand Down
74 changes: 74 additions & 0 deletions src/main/java/biomesoplenty/client/particle/SteamParticle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*******************************************************************************
* Copyright 2022, the Glitchfiend Team.
* All rights reserved.
******************************************************************************/
package biomesoplenty.client.particle;

import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.*;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class SteamParticle extends TextureSheetParticle
{
SteamParticle(ClientLevel p_105856_, double p_105857_, double p_105858_, double p_105859_, double p_105860_, double p_105861_, double p_105862_)
{
super(p_105856_, p_105857_, p_105858_, p_105859_);
this.scale(2.0F);
this.setSize(0.25F, 0.25F);
this.lifetime = this.random.nextInt(50) + 280;
this.gravity = 3.0E-6F;
this.xd = p_105860_;
this.yd = p_105861_ + (double)(this.random.nextFloat() / 500.0F);
this.zd = p_105862_;
}

@Override
public void tick()
{
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;
if (this.age++ < this.lifetime && !(this.alpha <= 0.0F))
{
this.xd += (double)(this.random.nextFloat() / 5000.0F * (float)(this.random.nextBoolean() ? 1 : -1));
this.zd += (double)(this.random.nextFloat() / 5000.0F * (float)(this.random.nextBoolean() ? 1 : -1));
this.yd -= (double)this.gravity;
this.move(this.xd, this.yd, this.zd);
if (this.age >= this.lifetime - 60 && this.alpha > 0.01F)
{
this.alpha -= 0.01F;
}

}
else
{
this.remove();
}
}

@Override
public ParticleRenderType getRenderType() {
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
}

@OnlyIn(Dist.CLIENT)
public static class Provider implements ParticleProvider<SimpleParticleType>
{
private final SpriteSet sprites;

public Provider(SpriteSet p_105899_) {
this.sprites = p_105899_;
}

public Particle createParticle(SimpleParticleType p_105910_, ClientLevel p_105911_, double p_105912_, double p_105913_, double p_105914_, double p_105915_, double p_105916_, double p_105917_)
{
SteamParticle steamparticle = new SteamParticle(p_105911_, p_105912_, p_105913_, p_105914_, p_105915_, p_105916_, p_105917_);
steamparticle.setAlpha(0.5F);
steamparticle.pickSprite(this.sprites);
return steamparticle;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.common.block;

import biomesoplenty.api.damagesource.BOPDamageTypes;
import biomesoplenty.init.ModParticles;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource;
Expand Down Expand Up @@ -44,7 +45,7 @@ public void animateTick(BlockState stateIn, Level worldIn, BlockPos pos, RandomS
super.animateTick(stateIn, worldIn, pos, rand);
if (worldIn.getBlockState(pos.above()).getFluidState().getType() == Fluids.WATER && worldIn.getBlockState(pos.above()).getFluidState().getAmount() == 8)
{
worldIn.addAlwaysVisibleParticle(ParticleTypes.CAMPFIRE_SIGNAL_SMOKE, (double) (pos.getX() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), (double) (pos.getY() + 1.0D), (double) (pos.getZ() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), 0.0D, 0.02D, 0.0D);
worldIn.addAlwaysVisibleParticle(ModParticles.STEAM.get(), (double) (pos.getX() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), (double) (pos.getY() + 1.0D), (double) (pos.getZ() + 0.5D + ((rand.nextDouble() - rand.nextDouble()) / 6.0D)), 0.0D, 0.02D, 0.0D);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/biomesoplenty/init/ModParticles.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class ModParticles
public static final RegistryObject<SimpleParticleType> LANDING_BLOOD = register("landing_blood", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> PUS = register("pus", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> GLOWWORM = register("glowworm", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> STEAM = register("steam", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> JACARANDA_LEAVES = register("jacaranda_leaves", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> SNOWBLOSSOM_LEAVES = register("snowblossom_leaves", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> RED_MAPLE_LEAVES = register("red_maple_leaves", () -> new SimpleParticleType(false));
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/assets/biomesoplenty/particles/steam.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"textures": [
"biomesoplenty:steam_0",
"biomesoplenty:steam_1",
"biomesoplenty:steam_2",
"biomesoplenty:steam_3",
"biomesoplenty:steam_4",
"biomesoplenty:steam_5",
"biomesoplenty:steam_6",
"biomesoplenty:steam_7",
"biomesoplenty:steam_8",
"biomesoplenty:steam_9",
"biomesoplenty:steam_10",
"biomesoplenty:steam_11"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 2872a3d

Please sign in to comment.