From 79fad86cb571a7d3a0c750a475eaadda16588458 Mon Sep 17 00:00:00 2001 From: carm Date: Sun, 28 Jan 2024 12:44:56 +0800 Subject: [PATCH] fix(pass): Fixed base pass ratio. --- .../artformgames/plugin/votepass/game/conf/PluginConfig.java | 1 + .../plugin/votepass/game/vote/VoteManagerImpl.java | 4 ++-- .../artformgames/plugin/votepass/lobby/ui/ResubmitGUI.java | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/conf/PluginConfig.java b/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/conf/PluginConfig.java index 4bc247f..afde34d 100644 --- a/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/conf/PluginConfig.java +++ b/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/conf/PluginConfig.java @@ -36,6 +36,7 @@ interface SERVER extends Configuration { ConfiguredMap AUTO_PASS_RATIO = ConfigValueMap.builderOf(Integer.class, Double.class) .asTreeMap().fromString().parseKey(Integer::parseInt).parseValue(Double::parseDouble) .defaults(m -> { + m.put(2, 1.0); m.put(5, 0.8); m.put(20, 0.6); }).build(); diff --git a/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/vote/VoteManagerImpl.java b/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/vote/VoteManagerImpl.java index 5541c4f..4753945 100644 --- a/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/vote/VoteManagerImpl.java +++ b/game/plugin/src/main/java/com/artformgames/plugin/votepass/game/vote/VoteManagerImpl.java @@ -61,10 +61,10 @@ public double getAutoPassRatio(int total) { double ratio = 1; for (Map.Entry entry : ratioMap.entrySet()) { - if (ratio < 1 && total < entry.getKey()) break; + if (total < entry.getKey()) break; ratio = entry.getValue(); } - + return ratio; } diff --git a/lobby/plugin/src/main/java/com/artformgames/plugin/votepass/lobby/ui/ResubmitGUI.java b/lobby/plugin/src/main/java/com/artformgames/plugin/votepass/lobby/ui/ResubmitGUI.java index aea3801..2bb3526 100644 --- a/lobby/plugin/src/main/java/com/artformgames/plugin/votepass/lobby/ui/ResubmitGUI.java +++ b/lobby/plugin/src/main/java/com/artformgames/plugin/votepass/lobby/ui/ResubmitGUI.java @@ -61,6 +61,7 @@ public ResubmitGUI(@NotNull Player player, @NotNull LobbyUserData data, public void initItems() { setItem(4, new GUIItem(PluginConfig.RESUBMIT.ITEMS.INFO.prepare( + getRequest().getID(), getRequest().count(VoteDecision.APPROVE), getRequest().count(VoteDecision.REJECT), getRequest().count(VoteDecision.ABSTAIN)