mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Add FishHookStateChangeEvent (#12165)
This commit is contained in:
@@ -42,6 +42,29 @@
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -166,12 +_,14 @@
|
||||
if (this.currentState == FishingHook.FishHookState.FLYING) {
|
||||
if (this.hookedIn != null) {
|
||||
this.setDeltaMovement(Vec3.ZERO);
|
||||
+ new io.papermc.paper.event.entity.FishHookStateChangeEvent((org.bukkit.entity.FishHook) getBukkitEntity(), org.bukkit.entity.FishHook.HookState.HOOKED_ENTITY).callEvent(); // Paper - Add FishHookStateChangeEvent. #HOOKED_ENTITY
|
||||
this.currentState = FishingHook.FishHookState.HOOKED_IN_ENTITY;
|
||||
return;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.3, 0.2, 0.3));
|
||||
+ new io.papermc.paper.event.entity.FishHookStateChangeEvent((org.bukkit.entity.FishHook) getBukkitEntity(), org.bukkit.entity.FishHook.HookState.BOBBING).callEvent(); // Paper - Add FishHookStateChangeEvent. #BOBBING
|
||||
this.currentState = FishingHook.FishHookState.BOBBING;
|
||||
return;
|
||||
}
|
||||
@@ -184,6 +_,7 @@
|
||||
this.setPos(this.hookedIn.getX(), this.hookedIn.getY(0.8), this.hookedIn.getZ());
|
||||
} else {
|
||||
this.setHookedEntity(null);
|
||||
+ new io.papermc.paper.event.entity.FishHookStateChangeEvent((org.bukkit.entity.FishHook) getBukkitEntity(), org.bukkit.entity.FishHook.HookState.UNHOOKED).callEvent(); // Paper - Add FishHookStateChangeEvent. #UNHOOKED
|
||||
this.currentState = FishingHook.FishHookState.FLYING;
|
||||
}
|
||||
}
|
||||
@@ -247,14 +_,14 @@
|
||||
if (!player.isRemoved() && player.isAlive() && (isFishingRod || isFishingRod1) && !(this.distanceToSqr(player) > 1024.0)) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user