mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
46 lines
2.2 KiB
Diff
46 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
|
|
|
|
Co-authored-by: Encode42 <me@encode42.dev>
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index c0d39afe5b80159ed9aaca4ddd4763d707882f2e..55414d53061663038f05d68c327f595abb2b0e44 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -86,7 +86,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.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur
|
|
this.x = x;
|
|
this.y = y;
|
|
this.z = z;
|
|
@@ -137,7 +137,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 : 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 de2f5ebfc48b4ea20fa8e194c1c7766d89c287de..d3eaf4c2983d16dcfed9f6b376b462d24b11be7f 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -216,6 +216,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;
|