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:
@@ -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() {
|
||||
|
||||
@@ -95,6 +95,7 @@ public abstract class AbstractGamingPlayer implements GamingPlayer, Runnable {
|
||||
*/
|
||||
@Override
|
||||
public boolean isSuccessful() {
|
||||
if (forcedGameResult != null) return forcedGameResult;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user