mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46:46 +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.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -94,9 +95,10 @@ public class PlayerListener implements Listener {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAUGHT_ENTITY:
|
case CAUGHT_ENTITY:
|
||||||
if (skillLevel >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shakeMob(player)) {
|
Entity entity = event.getCaught();
|
||||||
//TODO: Unsafe cast?
|
|
||||||
Fishing.beginShakeMob(player, (LivingEntity) event.getCaught(), skillLevel);
|
if (entity instanceof LivingEntity && skillLevel >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shakeMob(player)) {
|
||||||
|
Fishing.beginShakeMob(player, (LivingEntity) entity, skillLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user