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 20330eb commit 0f5f7f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/main/java/hantonik/fbp/mixin/MixinParticleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ private <T extends IParticleData> void makeParticle(T particleData, double x, do

if (FancyBlockParticles.CONFIG.terrain.isFancyBreakingParticles() && !(callback.getReturnValue() instanceof FBPDiggingParticle)) {
if (particleData.getType() == ParticleTypes.BLOCK) {
DiggingParticle original = (DiggingParticle) callback.getReturnValue();
if (callback.getReturnValue() instanceof DiggingParticle) {
DiggingParticle original = (DiggingParticle) callback.getReturnValue();

callback.setReturnValue(null);
callback.setReturnValue(null);

if (this.level.getFluidState(original.pos).isEmpty())
if (FancyBlockParticles.CONFIG.isBlockParticlesEnabled(((BlockParticleData) particleData).getState().getBlock()) && !(FancyBlockParticles.CONFIG.global.isFreezeEffect() && !FancyBlockParticles.CONFIG.terrain.isSpawnWhileFrozen()))
callback.setReturnValue(new FBPDiggingParticle.Provider(original.pos, original.getQuadSize(1) * 5.0F, null, original.sprite, original.rCol, original.gCol, original.bCol).createParticle((BlockParticleData) particleData, this.level, x, y, z, 0, 0, 0));
if (this.level.getFluidState(original.pos).isEmpty())
if (FancyBlockParticles.CONFIG.isBlockParticlesEnabled(((BlockParticleData) particleData).getState().getBlock()) && !(FancyBlockParticles.CONFIG.global.isFreezeEffect() && !FancyBlockParticles.CONFIG.terrain.isSpawnWhileFrozen()))
callback.setReturnValue(new FBPDiggingParticle.Provider(original.pos, original.getQuadSize(1) * 5.0F, null, original.sprite, original.rCol, original.gCol, original.bCol).createParticle((BlockParticleData) 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.16.5-latest": "16.5.0.1-beta"
"1.16.5-latest": "16.5.0.2-beta"
},

"1.16.5": {
"16.5.0.2-beta": "Fix error while adding FBPTerrainParticle",
"16.5.0.1-beta": "Fix particles becoming dark",
"16.5.0.0-beta": "Backport to Minecraft 1.16.5"
}
Expand Down

0 comments on commit 0f5f7f1

Please sign in to comment.