Skip to content

Commit

Permalink
bug fix: write mode cannot close GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuihui1022 committed Jul 8, 2023
1 parent c996a4b commit fd41227
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class InvOpen implements Listener {
public void onInvClicked(InventoryClickEvent event){
// 防止过分占用服务器资源,因为有的时候会疯狂报错
if (prize.canPrize){

if (event.getInventory().equals(prize.getTargetPlayer().getInventory())){
if (!(event.getCurrentItem() == null)){
Player prizePlayer = prize.getPrizePlayer();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/top/mpt/huihui/answerit/scheduler/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import top.mpt.huihui.answerit.utils.i18N;

import static top.mpt.huihui.answerit.Main.*;
import static top.mpt.huihui.answerit.prize.prize.canPrize;

public class Timer extends BukkitRunnable {

Expand All @@ -26,6 +27,8 @@ public void run() {
// 清空数组
voteResult.clear();
voteList.clear();
// 设置可以被奖励
canPrize = true;
ChatUtils.broadcast((String) i18N.getLang("timer.timer_over_summary"), trueCount, falseCount);
if (trueCount == falseCount){
ChatUtils.broadcast((String) i18N.getLang("timer.votes_equal"));
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ write:
vote_right: "#GREEN#[RIGHT] "
vote_wrong: "#RED#[WRONG]"
# broadcast_info
server_vote_right_info: "#GREEN#Player: #AQUA#%s #GREEN#vote for Correct"
server_vote_wrong_info: "#GREEN#Player: #AQUA#%s #GREEN#vote for Incorrect"
server_vote_right_info: "#GREEN#Player: #AQUA#%s #GREEN#vote for #AQUA#RIGHT"
server_vote_wrong_info: "#GREEN#Player: #AQUA#%s #GREEN#vote for #RED#WRONG"
# target_answer
target_answer_info: "#GREEN#%s 's answer is #AQUA#%s"

Expand All @@ -49,7 +49,7 @@ timer:
timer_start_info: "#RED#Timing #AQUA#%d #RED#seconds, now start"
timer_start_tip: "#RED#Please complete the voting within the specified time."

timer_over_summary: "#GREEN#Vote closed. %d players vote for RIGHT%d vote for WRONG"
timer_over_summary: "#GREEN#Vote closed. %d players vote for RIGHT, %d vote for WRONG"
votes_equal: "#GOLD#Equal votes, no reward or punishment for them."
votes_right: "#GREEN#Answer correct!"
votes_wrong: "#RED#Answer Incorrect!"
4 changes: 2 additions & 2 deletions src/main/resources/lang/zh_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ write:
vote_right: "#GREEN#[正确] "
vote_wrong: "#RED#[错误]"
# broadcast_info
server_vote_right_info: "#GREEN#玩家: #AQUA#%s #GREEN#投给了: 答案正确"
server_vote_wrong_info: "#GREEN#玩家: #AQUA#%s #GREEN#投给了: 答案正确"
server_vote_right_info: "#GREEN#玩家: #AQUA#%s #GREEN#投给了: #AQUA#答案正确"
server_vote_wrong_info: "#GREEN#玩家: #AQUA#%s #GREEN#投给了: #RED#答案错误"
# target_answer
target_answer_info: "#GREEN#%s的回答是: #AQUA#%s"

Expand Down

0 comments on commit fd41227

Please sign in to comment.