Files
Purpur/patches/server/0170-Config-for-wither-explosion-radius.patch
Ben Kerllenevich 0ae1daa043 fix compile
2021-12-05 18:18:14 -05:00

40 lines
2.5 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 a66e9826b8283366cec5adb54f79efee47d9df22..6cf8b12e94c17a8111eef5cc0157e4df594f15dc 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java
@@ -97,7 +97,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
// CraftBukkit start
// this.level.createExplosion(this, this.locX(), this.locY(), this.locZ(), 1.0F, false, explosion_effect);
- 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 17ad853b6a151d220f880613c46e15e6e6823af7..c20e8ca37fbd8ec2046c1d5e3aee8bde57763ac9 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2084,6 +2084,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);
@@ -2103,6 +2104,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;