Files
Purpur/patches/server/0158-Config-for-wither-explosion-radius.patch
granny d05e78bdb1 drop two config options in favor of PurpurExtras impl
dropped options:
- `mobs.snow_golem.drop-pumpkin-when-sheared`
- `mobs.sheep.jeb-shear-random-color`
2024-01-07 16:58:34 -08:00

40 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <ben@omega24.dev>
Date: Thu, 29 Apr 2021 14:39:07 -0400
Subject: [PATCH] Config for wither explosion radius
diff --git a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
index d57ef27df0a3597416564f8723b4b986413ad314..aa5ce9625bf23885a55521cbb4d994b684a5cf61 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
@@ -98,7 +98,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
if (!this.level().isClientSide) {
// CraftBukkit start
// this.level().explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB);
- ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.level().purpurConfig.witherExplosionRadius, false); // Purpur
this.level().getCraftServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 960dfb5f343bc0c1dcd17271594e33471a191b83..cd1fd91c9b0c1e4627f918d97338c1e87bcc0601 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2290,6 +2290,7 @@ public class PurpurWorldConfig {
public boolean witherBypassMobGriefing = false;
public boolean witherTakeDamageFromWater = false;
public boolean witherCanRideVehicles = false;
+ public float witherExplosionRadius = 1.0F;
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
@@ -2310,6 +2311,7 @@ public class PurpurWorldConfig {
witherBypassMobGriefing = getBoolean("mobs.wither.bypass-mob-griefing", witherBypassMobGriefing);
witherTakeDamageFromWater = getBoolean("mobs.wither.takes-damage-from-water", witherTakeDamageFromWater);
witherCanRideVehicles = getBoolean("mobs.wither.can-ride-vehicles", witherCanRideVehicles);
+ witherExplosionRadius = (float) getDouble("mobs.wither.explosion-radius", witherExplosionRadius);
}
public boolean witherSkeletonRidable = false;