2021-07-10 06:49:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Wed, 2 Dec 2020 21:03:02 -0800
|
|
|
|
Subject: [PATCH] Add config for mobs immune to default effects
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
2024-04-12 21:14:06 +02:00
|
|
|
index 60c9bae18f277a90b464a6f1f55d074ed9046aff..f01ace6a6e517ff3d3cd66e69e2594ae3d702072 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -1172,7 +1172,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
2021-07-10 06:49:49 +02:00
|
|
|
if (this.getMobType() == MobType.UNDEAD) {
|
|
|
|
MobEffect mobeffectlist = effect.getEffect();
|
|
|
|
|
|
|
|
- if (mobeffectlist == MobEffects.REGENERATION || mobeffectlist == MobEffects.POISON) {
|
2024-01-19 13:22:30 +01:00
|
|
|
+ if ((mobeffectlist == MobEffects.REGENERATION || mobeffectlist == MobEffects.POISON) && this.level().paperConfig().entities.mobEffects.undeadImmuneToCertainEffects) { // Paper - Add config for mobs immune to default effects
|
2021-07-10 06:49:49 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
index bd9453a92e1b2eca0a6dc56aef921e31a18a20c3..25f611b35a5710c595574d2d6ed50c442ca55721 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -607,7 +607,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
2021-07-10 06:49:49 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeAffected(MobEffectInstance effect) {
|
|
|
|
- return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect);
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return effect.getEffect() == MobEffects.WITHER && this.level().paperConfig().entities.mobEffects.immuneToWitherEffect.wither ? false : super.canBeAffected(effect); // Paper - Add config for mobs immune to default effects
|
2021-07-10 06:49:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private class WitherDoNothingGoal extends Goal {
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
2024-01-19 13:22:30 +01:00
|
|
|
index 6241baccd3fdee59175f616cdf69d3873074f855..4d5cfaa58bdf4e6cb975134004d14c591f6e85fa 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
2023-09-22 09:24:44 +02:00
|
|
|
@@ -135,7 +135,7 @@ public class Spider extends Monster {
|
2021-07-10 06:49:49 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeAffected(MobEffectInstance effect) {
|
|
|
|
- return effect.getEffect() == MobEffects.POISON ? false : super.canBeAffected(effect);
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return effect.getEffect() == MobEffects.POISON && this.level().paperConfig().entities.mobEffects.spidersImmuneToPoisonEffect ? false : super.canBeAffected(effect); // Paper - Add config for mobs immune to default effects
|
2021-07-10 06:49:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isClimbing() {
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
|
2024-01-19 13:22:30 +01:00
|
|
|
index 62943d43b701d9ae6d955003f4e7658f76d5bdb3..20a65c11ededcd7170704b70118da6200151fbab 100644
|
2021-07-10 06:49:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
|
2023-09-22 09:24:44 +02:00
|
|
|
@@ -128,6 +128,6 @@ public class WitherSkeleton extends AbstractSkeleton {
|
2021-07-10 06:49:49 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canBeAffected(MobEffectInstance effect) {
|
|
|
|
- return effect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(effect);
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return effect.getEffect() == MobEffects.WITHER && this.level().paperConfig().entities.mobEffects.immuneToWitherEffect.witherSkeleton ? false : super.canBeAffected(effect); // Paper - Add config for mobs immune to default effects
|
2021-07-10 06:49:49 +02:00
|
|
|
}
|
|
|
|
}
|