mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Config to remove explosion radius clamp
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
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/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
||||
index 685ccfb73bf7125585ef90b6a0f51b2f81daa428..05fdb02b6f73c24f6985755effecf92c0b365cf0 100644
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/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 - Config to remove explosion radius clamp
|
||||
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 - Config to remove explosion radius clamp
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 0cc3e2a55712a809a3338b06ab23a3172334b1b3..7c468d3002a0b6fca37ae5a731c5f0456af35744 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -225,6 +225,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<Item> itemImmuneToCactus = new ArrayList<>();
|
||||
public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
||||
public List<Item> itemImmuneToFire = new ArrayList<>();
|
||||
Reference in New Issue
Block a user