Fishing no longer damages rod or drains hunger

This commit is contained in:
nossr50 2021-01-25 15:02:58 -08:00
parent ec35efbf1b
commit cf21a5a163
4 changed files with 34 additions and 33 deletions

View File

@ -1,4 +1,5 @@
Version 2.1.173 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) 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) Updated ja_JP locale (thanks ViaSnake)
Fixed a bug where scoreboards were torn down inappropriately when moving to or from blacklisted worlds (thanks steve4744) Fixed a bug where scoreboards were torn down inappropriately when moving to or from blacklisted worlds (thanks steve4744)

View File

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

View File

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

View File

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