mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
prepare for 1.21.4 update
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/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 5fb1b4ca45faaf9d172adb8f3a7879322ae29117..12ccac3893097d428c3c7f9cfdfc67e78dd9d691 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