mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-17 13:00:04 +08:00
57 lines
3.1 KiB
Diff
57 lines
3.1 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/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
index 8a8895abe609b3be02aa896c40e4a2a240fd86f3..cf6330694b811cef743763e0915824df8f75fe27 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
@@ -109,6 +109,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
|
|
public EnderDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
|
|
super(EntityType.ENDER_DRAGON, world);
|
|
+ this.explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // Purpur - moved instantiation from field
|
|
this.fightOrigin = BlockPos.ZERO;
|
|
this.growlTime = 100;
|
|
this.nodes = new Node[24];
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index e35ebb5b923c2f63e37e5dae006bc4a030e49bb7..dcc3b333f3647631e2fb695d0854036d3bc009be 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 == null || 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) { // 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 785e4f56c82beb993fc980b9039f184eec98a409..2bafe37662ee22dc9f24cf3d5dd198416b495ee7 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;
|