mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
dropped options: - `mobs.snow_golem.drop-pumpkin-when-sheared` - `mobs.sheep.jeb-shear-random-color`
45 lines
2.2 KiB
Diff
45 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Nico314159 <nicolino.will@gmail.com>
|
|
Date: Mon, 9 Jan 2023 19:45:55 -0500
|
|
Subject: [PATCH] Config to remove explosion radius clamp
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index 17abd085b3faf88e10a44a6c98af996892cc4e58..0c08a07d3d1efa35646dbaa5cc887bf9d62cae42 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -97,7 +97,7 @@ public class Explosion {
|
|
this.hitPlayers = Maps.newHashMap();
|
|
this.level = world;
|
|
this.source = entity;
|
|
- this.radius = (float) Math.max(power, 0.0); // CraftBukkit - clamp bad values
|
|
+ this.radius = (float) (world == null || world.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur
|
|
this.x = x;
|
|
this.y = y;
|
|
this.z = z;
|
|
@@ -425,7 +425,7 @@ public class Explosion {
|
|
|
|
public void explode() {
|
|
// CraftBukkit start
|
|
- if (this.radius < 0.1F) {
|
|
+ if ((this.level == null || this.level.purpurConfig.explosionClampRadius) && this.radius < 0.1F) { // Purpur
|
|
return;
|
|
}
|
|
// CraftBukkit end
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 36aa99f6dd6fad2185890e5a3e126ae3a14aff06..d809d6062e3ecfd8c86c7dcc712363430ed88923 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -213,6 +213,11 @@ public class PurpurWorldConfig {
|
|
entitySharedRandom = getBoolean("settings.entity.shared-random", entitySharedRandom);
|
|
}
|
|
|
|
+ public boolean explosionClampRadius = true;
|
|
+ private void explosionSettings() {
|
|
+ explosionClampRadius = getBoolean("gameplay-mechanics.clamp-explosion-radius", explosionClampRadius);
|
|
+ }
|
|
+
|
|
public boolean infinityWorksWithoutArrows = false;
|
|
public boolean infinityWorksWithNormalArrows = true;
|
|
public boolean infinityWorksWithSpectralArrows = false;
|