Files
Purpur/patches/server/0056-Add-wither-skeleton-takes-wither-damage-option.patch
William Blake Galbreath 89c9c902b1 Add axe actionable options
2021-07-06 01:01:33 -05:00

39 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Tue, 14 Jan 2020 19:43:40 -0600
Subject: [PATCH] Add wither skeleton takes wither damage option
diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
index 8212ee2cc1242c0a3626f3643c455f3be0de18c2..aaf6f43c0f37a51a7b2db57b8da4336530664afe 100644
--- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
@@ -139,6 +139,6 @@ public class WitherSkeleton extends AbstractSkeleton {
@Override
public boolean canBeAffected(MobEffectInstance effect) {
- return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect);
+ return (level.purpurConfig.witherSkeletonTakesWitherDamage || effect.getEffect() != MobEffects.WITHER) && super.canBeAffected(effect); // Purpur
}
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index ceac72f608a9023480464d293d9582792ab9d2fa..5ef65a767b1a052cfeadcb612c2d7578eee38bf0 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1307,6 +1307,7 @@ public class PurpurWorldConfig {
public boolean witherSkeletonRidable = false;
public boolean witherSkeletonRidableInWater = false;
public double witherSkeletonMaxHealth = 20.0D;
+ public boolean witherSkeletonTakesWitherDamage = false;
private void witherSkeletonSettings() {
witherSkeletonRidable = getBoolean("mobs.wither_skeleton.ridable", witherSkeletonRidable);
witherSkeletonRidableInWater = getBoolean("mobs.wither_skeleton.ridable-in-water", witherSkeletonRidableInWater);
@@ -1316,6 +1317,7 @@ public class PurpurWorldConfig {
set("mobs.wither_skeleton.attributes.max_health", oldValue);
}
witherSkeletonMaxHealth = getDouble("mobs.wither_skeleton.attributes.max_health", witherSkeletonMaxHealth);
+ witherSkeletonTakesWitherDamage = getBoolean("mobs.wither_skeleton.takes-wither-damage", witherSkeletonTakesWitherDamage);
}
public boolean wolfRidable = false;