From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 8 Aug 2020 16:11:51 -0500
Subject: [PATCH] Add option to disable dolphin treasure searching


diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
index c372d47a929e06c8cfb0df86cf4e9bfee4d4b300..2aead13e8f879b614445715fb1912a20b9abf4b9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
@@ -497,6 +497,7 @@ public class Dolphin extends WaterAnimal {
 
         @Override
         public boolean canUse() {
+            if (this.dolphin.level.purpurConfig.dolphinDisableTreasureSearching) return false; // Purpur
             return this.dolphin.gotFish() && this.dolphin.getAirSupply() >= 100 && this.dolphin.level.getWorld().canGenerateStructures(); // MC-151364, SPIGOT-5494: hangs if generate-structures=false
         }
 
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index d301176f1e755fbacc6b3145c0fe8f36a6764b7c..a9388714c4bbe576dd0b4dd4f11a346d12d9f002 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -559,6 +559,7 @@ public class PurpurWorldConfig {
     public float dolphinSpitSpeed = 1.0F;
     public float dolphinSpitDamage = 2.0F;
     public double dolphinMaxHealth = 10.0D;
+    public boolean dolphinDisableTreasureSearching = false;
     private void dolphinSettings() {
         dolphinRidable = getBoolean("mobs.dolphin.ridable", dolphinRidable);
         dolphinSpitCooldown = getInt("mobs.dolphin.spit.cooldown", dolphinSpitCooldown);
@@ -570,6 +571,7 @@ public class PurpurWorldConfig {
             set("mobs.dolphin.attributes.max_health", oldValue);
         }
         dolphinMaxHealth = getDouble("mobs.dolphin.attributes.max_health", dolphinMaxHealth);
+        dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
     }
 
     public boolean donkeyRidableInWater = false;
