mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Remove offhand fishing rod if not in main hand
Fixes mcMMO-Dev/mcMMO#3342 Fixed style error in last commit
This commit is contained in:
parent
40b609ccd8
commit
6d2003d577
@ -134,6 +134,9 @@ public class FishingManager extends SkillManager {
|
|||||||
if (player.getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
|
if (player.getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) {
|
||||||
player.getInventory().setItemInMainHand(null);
|
player.getInventory().setItemInMainHand(null);
|
||||||
}
|
}
|
||||||
|
else if (player.getInventory().getItemInOffHand().getType() == Material.FISHING_ROD) {
|
||||||
|
player.getInventory().setItemInOffHand(null);
|
||||||
|
}
|
||||||
|
|
||||||
LivingEntity kraken = (LivingEntity) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
|
LivingEntity kraken = (LivingEntity) world.spawnEntity(player.getEyeLocation(), (Misc.getRandom().nextInt(100) == 0 ? EntityType.CHICKEN : EntityType.SQUID));
|
||||||
kraken.setCustomName(AdvancedConfig.getInstance().getKrakenName());
|
kraken.setCustomName(AdvancedConfig.getInstance().getKrakenName());
|
||||||
|
@ -188,7 +188,7 @@ public class SkillUtils {
|
|||||||
* @param maxDamageModifier the amount to adjust the max damage by
|
* @param maxDamageModifier the amount to adjust the max damage by
|
||||||
*/
|
*/
|
||||||
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) {
|
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) {
|
||||||
if(itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user