9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2026-01-04 15:41:35 +00:00

Fixed hook parameter

This commit is contained in:
XiaoMoMi
2025-03-06 21:27:25 +08:00
parent 4391e54dca
commit 20e860ab5f
3 changed files with 6 additions and 1 deletions

View File

@@ -25,12 +25,13 @@ import org.jetbrains.annotations.NotNull;
public class FishingGamePreStartEvent extends PlayerEvent {
private static final HandlerList handlerList = new HandlerList();
private final CustomFishingHook hook;
private GameSetting setting;
private CustomFishingHook hook;
public FishingGamePreStartEvent(@NotNull CustomFishingHook hook, GameSetting setting) {
super(hook.getContext().holder());
this.setting = setting;
this.hook = hook;
}
public CustomFishingHook hook() {

View File

@@ -95,6 +95,7 @@ public abstract class AbstractGamingPlayer implements GamingPlayer, Runnable {
*/
@Override
public boolean isSuccessful() {
if (forcedGameResult != null) return forcedGameResult;
return success;
}

View File

@@ -883,6 +883,7 @@ public class BukkitGameManager implements GameManager {
@Override
public boolean isSuccessful() {
if (forcedGameResult != null) return forcedGameResult;
if (isTimeOut) return false;
int last = progress / widthPerSection;
return (Math.random() < successRate[last]);
@@ -973,6 +974,7 @@ public class BukkitGameManager implements GameManager {
@Override
public boolean isSuccessful() {
if (forcedGameResult != null) return forcedGameResult;
if (isTimeOut) return false;
return currentIndex + 1 <= successPosition + successWidth - 1 && currentIndex + 1 >= successPosition;
}
@@ -1052,6 +1054,7 @@ public class BukkitGameManager implements GameManager {
@Override
public boolean isSuccessful() {
if (forcedGameResult != null) return forcedGameResult;
if (isTimeOut) return false;
return progress < judgement_position + judgementAreaWidth && progress >= judgement_position;
}