Browse Source

Fix giving double treasures if the setting to give extra fish is on
Fixes #4363

nossr50 4 years ago
parent
commit
3f6de1c4ba

+ 1 - 1
Changelog.txt

@@ -7,7 +7,7 @@ Version 2.1.165
     mcMMO will now be compatible with changes to world height (1.17 compatibility)
     mcMMO will now be compatible with changes to world height (1.17 compatibility)
     Added missing cooldown locale message 'Commands.Database.Cooldown'
     Added missing cooldown locale message 'Commands.Database.Cooldown'
     Added new locale message 'Taming.Summon.COTW.Removed'
     Added new locale message 'Taming.Summon.COTW.Removed'
-    mcMMO will ignore PlayerPickupItem events from "Fake-Player" NPCs if it recognizes them as such, this will prevent some issues
+    mcMMO will ignore EntityPickupItemEvents from "Fake-Player" NPCs if it recognizes them as such, this will prevent some compatibility issues with some plugins
 
 
     NOTES:
     NOTES:
     Books dropped before this fix will not be usable and should just be chucked in lava, the broken books have blue names, the working books have yellow names.
     Books dropped before this fix will not be usable and should just be chucked in lava, the broken books have blue names, the working books have yellow names.

+ 2 - 2
src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java

@@ -449,11 +449,11 @@ public class FishingManager extends SkillManager {
         }
         }
 
 
         if(fishingSucceeds) {
         if(fishingSucceeds) {
-            fishingCatch.setItemStack(treasureDrop);
-
             if (Config.getInstance().getFishingExtraFish()) {
             if (Config.getInstance().getFishingExtraFish()) {
                 Misc.spawnItem(player.getEyeLocation(), fishingCatch.getItemStack(), ItemSpawnReason.FISHING_EXTRA_FISH);
                 Misc.spawnItem(player.getEyeLocation(), fishingCatch.getItemStack(), ItemSpawnReason.FISHING_EXTRA_FISH);
             }
             }
+
+            fishingCatch.setItemStack(treasureDrop);
         }
         }
 
 
         applyXpGain(fishXp + treasureXp, XPGainReason.PVE);
         applyXpGain(fishXp + treasureXp, XPGainReason.PVE);