mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fishing no longer damages rod or drains hunger
This commit is contained in:
parent
ec35efbf1b
commit
cf21a5a163
@ -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)
|
||||
|
4
pom.xml
4
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>
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user