From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nico314159 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/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java index bbbd451ff184be8fa13bd93d53c89a9502f9951a..913f7d5fd9823eea9fad2d4e6689511f8d0cfda6 100644 --- a/src/main/java/net/minecraft/world/level/ServerExplosion.java +++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java @@ -311,7 +311,7 @@ public class ServerExplosion implements Explosion { public ServerExplosion(ServerLevel world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, Vec3 pos, float power, boolean createFire, Explosion.BlockInteraction destructionType) { 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.center = pos; this.fire = createFire; this.blockInteraction = destructionType; @@ -666,7 +666,7 @@ public class ServerExplosion implements 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 2a44f924fbfaf175b1fd172d311bb4ea13f73e26..dc0759e6157aaaf1738c910848f2ccd4ae0a75b6 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -223,6 +223,11 @@ public class PurpurWorldConfig { infinityWorksWithoutArrows = getBoolean("gameplay-mechanics.infinity-bow.works-without-arrows", infinityWorksWithoutArrows); } + public boolean explosionClampRadius = true; + private void explosionSettings() { + explosionClampRadius = getBoolean("gameplay-mechanics.clamp-explosion-radius", explosionClampRadius); + } + public List itemImmuneToCactus = new ArrayList<>(); public List itemImmuneToExplosion = new ArrayList<>(); public List itemImmuneToFire = new ArrayList<>();