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/world/item/ItemMilkBucket.java b/src/main/java/net/minecraft/world/item/ItemMilkBucket.java
index 6085c5f75bd85cca3462613c18c2e2bf26205d1b..e20452f55c531f76ecaae9ba5d0ea3f8edf96127 100644
--- a/src/main/java/net/minecraft/world/item/ItemMilkBucket.java
+++ b/src/main/java/net/minecraft/world/item/ItemMilkBucket.java
@@ -5,6 +5,8 @@ import net.minecraft.server.level.EntityPlayer;
 import net.minecraft.stats.StatisticList;
 import net.minecraft.world.EnumHand;
 import net.minecraft.world.InteractionResultWrapper;
+import net.minecraft.world.effect.MobEffect;
+import net.minecraft.world.effect.MobEffects;
 import net.minecraft.world.entity.EntityLiving;
 import net.minecraft.world.entity.player.EntityHuman;
 import net.minecraft.world.level.World;
@@ -29,7 +31,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 b16ea97f4119fe2cd7c218f3fecbb7202c362665..a892d9af3753c4ca8f3733c64bece1cd1ed468c6 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;
