Skip to content

Commit

Permalink
Fix error while adding FBPTerrainParticle, closes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Hantonik committed Sep 20, 2024
1 parent 29d09c9 commit c95a232
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Common/src/main/java/hantonik/fbp/mixin/MixinParticleEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ private <T extends ParticleOptions> void makeParticle(T particleData, double x,

if (FancyBlockParticles.CONFIG.terrain.isFancyBreakingParticles() && !(callback.getReturnValue() instanceof FBPTerrainParticle)) {
if (particleData.getType() == ParticleTypes.BLOCK) {
var original = (TerrainParticle) callback.getReturnValue();
if (callback.getReturnValue() instanceof TerrainParticle original) {
callback.setReturnValue(null);

callback.setReturnValue(null);

if (this.level.getFluidState(original.pos).isEmpty())
if (FancyBlockParticles.CONFIG.isBlockParticlesEnabled(((BlockParticleOption) particleData).getState().getBlock()) && !(FancyBlockParticles.CONFIG.global.isFreezeEffect() && !FancyBlockParticles.CONFIG.terrain.isSpawnWhileFrozen()))
callback.setReturnValue(new FBPTerrainParticle.Provider(original.pos, original.getQuadSize(1) * 5.0F, null, original.sprite, original.rCol, original.gCol, original.bCol).createParticle((BlockParticleOption) particleData, this.level, x, y, z, 0, 0, 0));
if (this.level.getFluidState(original.pos).isEmpty())
if (FancyBlockParticles.CONFIG.isBlockParticlesEnabled(((BlockParticleOption) particleData).getState().getBlock()) && !(FancyBlockParticles.CONFIG.global.isFreezeEffect() && !FancyBlockParticles.CONFIG.terrain.isSpawnWhileFrozen()))
callback.setReturnValue(new FBPTerrainParticle.Provider(original.pos, original.getQuadSize(1) * 5.0F, null, original.sprite, original.rCol, original.gCol, original.bCol).createParticle((BlockParticleOption) particleData, this.level, x, y, z, 0, 0, 0));
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion update.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"homepage": "https://www.curseforge.com/minecraft/mc-mods/fbp-renewed",

"promos": {
"1.19.2-latest": "19.2.0.2-beta"
"1.19.2-latest": "19.2.0.3-beta"
},

"1.19.2": {
"19.2.0.3-beta": "Fix error while adding FBPTerrainParticle",
"19.2.0.2-beta": "Fix particles becoming dark",
"19.2.0.1-beta": "Fix snow particles not melting properly",
"19.2.0.0-beta": "Backport to Minecraft 1.19.2"
Expand Down

0 comments on commit c95a232

Please sign in to comment.