mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-24 17:47:44 +01:00
Fixed PlayerFishEvent.getCaught() ClassCastException
This commit is contained in:
parent
c231a68bb2
commit
12faebca27
@ -2,6 +2,7 @@ package com.gmail.nossr50.listeners;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -94,9 +95,10 @@ public class PlayerListener implements Listener {
|
||||
break;
|
||||
|
||||
case CAUGHT_ENTITY:
|
||||
if (skillLevel >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shakeMob(player)) {
|
||||
//TODO: Unsafe cast?
|
||||
Fishing.beginShakeMob(player, (LivingEntity) event.getCaught(), skillLevel);
|
||||
Entity entity = event.getCaught();
|
||||
|
||||
if (entity instanceof LivingEntity && skillLevel >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shakeMob(player)) {
|
||||
Fishing.beginShakeMob(player, (LivingEntity) entity, skillLevel);
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user