mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-04 16:34:05 +01:00
Fire UseItemEvent when fishing rod is cast.
This apparently no longer throws an interact. Fixes WORLDGUARD-4018.
This commit is contained in:
parent
a233be1df8
commit
090a00d6d8
@ -679,7 +679,12 @@ public void onBlockExp(BlockExpEvent event) {
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerFish(PlayerFishEvent event) {
|
||||
if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH) {
|
||||
if (event.getState() == PlayerFishEvent.State.FISHING) {
|
||||
if (Events.fireAndTestCancel(new UseItemEvent(event, create(event.getPlayer(), event.getHook()),
|
||||
event.getPlayer().getWorld(), event.getPlayer().getInventory().getItemInMainHand()))) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} else if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH) {
|
||||
if (Events.fireAndTestCancel(new SpawnEntityEvent(event, create(event.getPlayer(), event.getHook()), event.getHook().getLocation(), EntityType.EXPERIENCE_ORB))) {
|
||||
event.setExpToDrop(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user