mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-22 16:29:16 +00:00
36 lines
1.9 KiB
Diff
36 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
|
|
Date: Mon, 20 Nov 2023 19:32:31 +0000
|
|
Subject: [PATCH] Consistent Explosion Radius
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index 81284ec481ac6cc82d2b1171d1772c107d1a5a0c..0dd0397036309c881f955b78ba3934e33bcf18fd 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -76,6 +76,7 @@ public class Explosion {
|
|
public boolean wasCanceled = false;
|
|
public float yield;
|
|
// CraftBukkit end
|
|
+ private final boolean consistentRadius; // Sakura - consistent explosion radius
|
|
|
|
// Paper start - optimise collisions
|
|
private static final double[] CACHED_RAYS;
|
|
@@ -450,6 +451,7 @@ public class Explosion {
|
|
this.largeExplosionParticles = emitterParticle;
|
|
this.explosionSound = soundEvent;
|
|
this.yield = this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F; // CraftBukkit
|
|
+ this.consistentRadius = world.localConfig().config(BlockPos.containing(x, y, z)).consistentRadius; // Sakura - consistent explosion radius
|
|
}
|
|
|
|
private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity entity) {
|
|
@@ -558,7 +560,7 @@ public class Explosion {
|
|
final double incZ = CACHED_RAYS[ray + 2];
|
|
|
|
ray += 3;
|
|
- float power = this.radius * (0.7F + this.level.random.nextFloat() * 0.6F);
|
|
+ float power = this.radius * (0.7F + (this.consistentRadius ? 0.7F : this.level.random.nextFloat()) * 0.6F); // Sakura - consistent explosion radius
|
|
do {
|
|
final int blockX = Mth.floor(currX);
|
|
final int blockY = Mth.floor(currY);
|