Files
Purpur/patches/server/0288-Config-to-remove-explosion-radius-clamp.patch
granny 0b95a8072a Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@5436d44 Deprecate several Keyed#getKey methods (#10357)
PaperMC/Paper@a7f1dc6 Change online mode default for Velocity configuration (#10413)
PaperMC/Paper@37db2d7 [ci skip] Update book page/char limit for book meta doc (#10415)
PaperMC/Paper@526795b Update patches to handle vineflower decompiler (#10406)
PaperMC/Paper@8fe90de [ci skip] Referenced InventoryDragEvent in documentation of InventoryClickEvent (#10395)
PaperMC/Paper@46d462b Fix StackOverflowException thrown on shutdown (Fixes #10404) (#10408)
PaperMC/Paper@f061e76 Fix hit criteria advancement triggered before changing state (#10409)
PaperMC/Paper@3263470 Add color transition and clone functions to ParticleBuilder (#10342)
PaperMC/Paper@4445d23 Deprecate ItemStack#setType & add ItemStack#withType (#10290)
2024-04-12 17:48:06 -07:00

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 5dcfb077fc58a92f32425aaafb82d6b41d488e13..9b5da37a532595541eaac0a4607aff9045a20ff3 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 70b3c2fc1bd9f31d79079828a5de22a40d9cceba..9759c3aa4dab2a1ea3ab62ee026d6ad93a488ff7 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;