Skip to content

Commit

Permalink
Fix a crash on Freeze effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Hantonik committed Jun 17, 2024
1 parent 36f9bc5 commit 32d28e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Common/src/main/java/hantonik/fbp/particle/FBPFlameParticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public FBPFlameParticle(ClientLevel level, double x, double y, double z, double
}

@Override
public Particle scale(float scale) {
public FBPFlameParticle scale(float scale) {
super.scale(scale);

this.startSize = this.quadSize;
Expand Down Expand Up @@ -287,7 +287,7 @@ private void addVertex(VertexConsumer buffer, Vector3d pos, float u, float v, in
}

@Nullable
private static FBPFlameParticle create(ClientLevel level, double x, double y, double z, double xd, double zd, boolean isSoulFire) {
private static FBPFlameParticle create(ClientLevel level, double x, double y, double z, double xd, double zd, float scale, boolean isSoulFire) {
if (FancyBlockParticles.CONFIG.global.isFreezeEffect())
return null;

Expand All @@ -296,7 +296,7 @@ private static FBPFlameParticle create(ClientLevel level, double x, double y, do
if (state.getBlock() instanceof TorchBlock || state.getBlock() instanceof CandleBlock)
y += 0.04D;

return new FBPFlameParticle(level, x, y - 0.06D, z, xd, FBPConstants.RANDOM.nextDouble() * 0.025D, zd, isSoulFire, !(state.getBlock() instanceof TorchBlock) && !(state.getBlock() instanceof CandleBlock));
return new FBPFlameParticle(level, x, y - 0.06D, z, xd, FBPConstants.RANDOM.nextDouble() * 0.025D, zd, isSoulFire, !(state.getBlock() instanceof TorchBlock) && !(state.getBlock() instanceof CandleBlock)).scale(scale);
}

@RequiredArgsConstructor
Expand All @@ -306,7 +306,7 @@ public static class Provider implements ParticleProvider<SimpleParticleType> {
@Nullable
@Override
public Particle createParticle(SimpleParticleType type, ClientLevel level, double x, double y, double z, double xd, double yd, double zd) {
return create(level, x, y, z, xd, zd, this.isSoulFire);
return create(level, x, y, z, xd, zd, 1.0F, this.isSoulFire);
}
}

Expand All @@ -315,7 +315,7 @@ public static class SmallFlameProvider implements ParticleProvider<SimpleParticl
@Nullable
@Override
public Particle createParticle(SimpleParticleType type, ClientLevel level, double x, double y, double z, double xd, double yd, double zd) {
return create(level, x, y, z, xd, zd, false).scale(0.5F);
return create(level, x, y, z, xd, zd, 0.5F, false);
}
}
}
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.20.4-latest": "20.4.0.0-beta"
"1.20.4-latest": "20.4.0.1-beta"
},

"1.20.4": {
"20.4.0.1-beta": "Fix a crash on Freeze effect",
"20.4.0.0-beta": "Backport to Minecraft 1.20.4",
"1.0.4.0-beta": "Add option to disable block breaking particles",
"1.0.3.1-beta": "Fix FBP Options Menu doesn't fix on the screen",
Expand Down

0 comments on commit 32d28e2

Please sign in to comment.