mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Milk keeps beneficial effects (#1147)
This commit is contained in:
38
patches/server/0308-Milk-Keeps-Beneficial-Effects.patch
Normal file
38
patches/server/0308-Milk-Keeps-Beneficial-Effects.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Rhythmic <mc.ADHDMC@gmail.com>
|
||||
Date: Thu, 6 Oct 2022 10:41:01 -0700
|
||||
Subject: [PATCH] Milk Keeps Beneficial Effects
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 9dca0d694aa8fa7f8bec0d2504986085e0cc6fe9..ad4bd5fa9bcd085a1eb99c4da5fc95ebc126d028 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1096,6 +1096,7 @@ public abstract class LivingEntity extends Entity {
|
||||
for (flag = false; iterator.hasNext(); flag = true) {
|
||||
// CraftBukkit start
|
||||
MobEffectInstance effect = (MobEffectInstance) iterator.next();
|
||||
+ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level.purpurConfig.milkClearsBeneficialEffects && effect.getEffect().isBeneficial()) continue; // Purpur
|
||||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index a6356d19f0fc664be523f19c2ea1704191a7a73a..a70caf9a80c39840ea70539d3eedc767fee64872 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -131,6 +131,7 @@ public class PurpurWorldConfig {
|
||||
public boolean fireballsBypassMobGriefing = false;
|
||||
public boolean imposeTeleportRestrictionsOnGateways = false;
|
||||
public boolean milkCuresBadOmen = true;
|
||||
+ public boolean milkClearsBeneficialEffects = true;
|
||||
public boolean noteBlockIgnoreAbove = false;
|
||||
public boolean persistentDroppableEntityDisplayNames = false;
|
||||
public boolean persistentTileEntityDisplayNames = false;
|
||||
@@ -157,6 +158,7 @@ public class PurpurWorldConfig {
|
||||
fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing);
|
||||
imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
+ milkClearsBeneficialEffects = getBoolean("gameplay-mechanics.milk-clears-beneficial-effects", milkClearsBeneficialEffects);
|
||||
noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove);
|
||||
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
||||
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
|
||||
Reference in New Issue
Block a user