Browse Source

Fishing no longer damages rod or drains hunger

nossr50 4 years ago
parent
commit
cf21a5a163

+ 1 - 0
Changelog.txt

@@ -1,4 +1,5 @@
 Version 2.1.173
+    mcMMO no longer damages fishing rods or drains a player's hunger when fishing
     Fixed a visual bug where players who had lucky perk were shown incorrect odds when using skill commands (such as /axes)
     Updated ja_JP locale (thanks ViaSnake)
     Fixed a bug where scoreboards were torn down inappropriately when moving to or from blacklisted worlds (thanks steve4744)

+ 2 - 2
pom.xml

@@ -212,12 +212,12 @@
         <dependency>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-api</artifactId>
-            <version>4.3.0</version>
+            <version>4.4.0</version>
         </dependency>
         <dependency>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-nbt</artifactId>
-            <version>4.3.0</version>
+            <version>4.4.0</version>
         </dependency>
         <dependency>
             <groupId>net.kyori</groupId>

+ 1 - 1
src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

@@ -765,7 +765,7 @@ public class PlayerListener implements Listener {
                     player.setVelocity(player.getEyeLocation().getDirection().multiply(10));
                 }
 
-                mcMMOPlayer.getFishingManager().setFishingRodCastTimestamp();
+                //mcMMOPlayer.getFishingManager().setFishingRodCastTimestamp();
             }
         }
 

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

@@ -72,36 +72,36 @@ public class FishingManager extends SkillManager {
         return mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer() != null && getSkillLevel() >= RankUtils.getUnlockLevel(SubSkillType.FISHING_MASTER_ANGLER) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_MASTER_ANGLER);
     }
 
-    public void setFishingRodCastTimestamp()
-    {
-        long currentTime = System.currentTimeMillis();
-        //Only track spam casting if the fishing hook is fresh
-        if(currentTime > fishHookSpawnTimestamp + 1000)
-            return;
-
-        if(currentTime < fishingRodCastTimestamp + FISHING_ROD_CAST_CD_MILLISECONDS)
-        {
-            ItemStack fishingRod = getPlayer().getInventory().getItemInMainHand();
-
-            //Ensure correct hand item is damaged
-            if(fishingRod.getType() != Material.FISHING_ROD) {
-                fishingRod = getPlayer().getInventory().getItemInOffHand();
-            }
-
-            getPlayer().setFoodLevel(Math.max(getPlayer().getFoodLevel() - 1, 0));
-            fishingRod.setDurability((short) (fishingRod.getDurability() + 5));
-            getPlayer().updateInventory();
-
-            if(lastWarnedExhaust + (1000) < currentTime)
-            {
-                getPlayer().sendMessage(LocaleLoader.getString("Fishing.Exhausting"));
-                lastWarnedExhaust = currentTime;
-                SoundManager.sendSound(getPlayer(), getPlayer().getLocation(), SoundType.TIRED);
-            }
-        }
-
-        fishingRodCastTimestamp = System.currentTimeMillis();
-    }
+//    public void setFishingRodCastTimestamp()
+//    {
+//        long currentTime = System.currentTimeMillis();
+//        //Only track spam casting if the fishing hook is fresh
+//        if(currentTime > fishHookSpawnTimestamp + 1000)
+//            return;
+//
+//        if(currentTime < fishingRodCastTimestamp + FISHING_ROD_CAST_CD_MILLISECONDS)
+//        {
+//            ItemStack fishingRod = getPlayer().getInventory().getItemInMainHand();
+//
+//            //Ensure correct hand item is damaged
+//            if(fishingRod.getType() != Material.FISHING_ROD) {
+//                fishingRod = getPlayer().getInventory().getItemInOffHand();
+//            }
+//
+//            getPlayer().setFoodLevel(Math.max(getPlayer().getFoodLevel() - 1, 0));
+//            fishingRod.setDurability((short) (fishingRod.getDurability() + 5));
+//            getPlayer().updateInventory();
+//
+//            if(lastWarnedExhaust + (1000) < currentTime)
+//            {
+//                getPlayer().sendMessage(LocaleLoader.getString("Fishing.Exhausting"));
+//                lastWarnedExhaust = currentTime;
+//                SoundManager.sendSound(getPlayer(), getPlayer().getLocation(), SoundType.TIRED);
+//            }
+//        }
+//
+//        fishingRodCastTimestamp = System.currentTimeMillis();
+//    }
 
     public void setFishHookReference(FishHook fishHook)
     {