From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Wed, 10 Jul 2019 20:43:05 -0500
Subject: [PATCH] Option to toggle milk curing bad omen


diff --git a/src/main/java/net/minecraft/server/ItemMilkBucket.java b/src/main/java/net/minecraft/server/ItemMilkBucket.java
index fcf254bbaeb3c0ffdb6834a8d5ad2c3cf4235e5b..79554e18fc39ecd9db87618a59d2e6709049820e 100644
--- a/src/main/java/net/minecraft/server/ItemMilkBucket.java
+++ b/src/main/java/net/minecraft/server/ItemMilkBucket.java
@@ -20,7 +20,9 @@ public class ItemMilkBucket extends Item {
         }
 
         if (!world.isClientSide) {
+            MobEffect badOmen = entityliving.getEffect(MobEffects.BAD_OMEN); // Purpur
             entityliving.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.MILK); // CraftBukkit
+            if (!world.purpurConfig.milkCuresBadOmen && badOmen != null) entityliving.addEffect(badOmen); // Purpur
         }
 
         return itemstack.isEmpty() ? new ItemStack(Items.BUCKET) : itemstack;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 8d1ad37f17935331ee867c15f91842cdc53d4450..bec457e5aac17b0db0788110ceda778c81f26042 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -113,8 +113,10 @@ public class PurpurWorldConfig {
     }
 
     public boolean disableDropsOnCrammingDeath = false;
+    public boolean milkCuresBadOmen = true;
     private void miscGameplayMechanicsSettings() {
         disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
+        milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
     }
 
     public int playerSpawnInvulnerableTicks = 60;
