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/EntityDolphin.java b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java
index 5d18e19eafd5dc01a6caa45075d8c0598f1bb709..e0a9b931c26dbd4e7739d09ae45e1cee72ab210c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java
@@ -393,6 +393,7 @@ public class EntityDolphin extends EntityWaterAnimal {
 
         @Override
         public boolean a() {
+            if (this.a.world.purpurConfig.dolphinDisableTreasureSearching) return false; // Purpur
             return this.a.gotFish() && this.a.getAirTicks() >= 100 && this.a.world.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 8c04056ec174f02671c088038525637ae0f350cb..18289cb1453fa00ed00f6a9ae7636eec472b47c1 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -365,6 +365,11 @@ public class PurpurWorldConfig {
         creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
     }
 
+    public boolean dolphinDisableTreasureSearching = false;
+    private void dolphinSettings() {
+        dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
+    }
+
     public boolean drownedJockeyOnlyBaby = true;
     public double drownedJockeyChance = 0.05D;
     public boolean drownedJockeyTryExistingChickens = true;
