mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-20 15:29:33 +00:00
36 lines
2.0 KiB
Diff
36 lines
2.0 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 154b636f04f979f4a3a2bc3a02a54258d3cf7646..0a612539f0fc1b447396a8146312cafa6569174f 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -75,6 +75,7 @@ public class Explosion {
|
|
public boolean wasCanceled = false;
|
|
public float yield;
|
|
// CraftBukkit end
|
|
+ private final boolean consistentRadius; // Sakura - consistent explosion radius
|
|
|
|
public static DamageSource getDefaultDamageSource(Level world, @Nullable Entity source) {
|
|
return world.damageSources().explosion(source, Explosion.getIndirectSourceEntityInternal(source));
|
|
@@ -112,6 +113,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
|
|
}
|
|
|
|
// Sakura start - optimise paper explosions
|
|
@@ -586,7 +588,7 @@ public class Explosion {
|
|
double d2 = CACHED_RAYS[ray + 2];
|
|
ray += 3;
|
|
// Paper end - optimise explosions
|
|
- float f = this.radius * (0.7F + this.level.random.nextFloat() * 0.6F);
|
|
+ float f = this.radius * (0.7F + (this.consistentRadius ? 0.7F : this.level.random.nextFloat()) * 0.6F); // Sakura - consistent explosion radius
|
|
double d4 = this.x;
|
|
double d5 = this.y;
|
|
double d6 = this.z;
|