mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
Fishing no longer damages rod or drains hunger
This commit is contained in:
@ -765,7 +765,7 @@ public class PlayerListener implements Listener {
|
||||
player.setVelocity(player.getEyeLocation().getDirection().multiply(10));
|
||||
}
|
||||
|
||||
mcMMOPlayer.getFishingManager().setFishingRodCastTimestamp();
|
||||
//mcMMOPlayer.getFishingManager().setFishingRodCastTimestamp();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user