Skip to content

Commit 0787c6a

Browse files
committed
🎉 所有功能全部实现
1 parent 66031ce commit 0787c6a

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/main/java/top/mpt/xzystudio/flywars/game/Game.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,12 @@ public void run() {
130130
// 资源刷新点
131131
resUpdater.setGameWorld(pl.getWorld());
132132
try {
133-
if (!resUpdater.isCancelled()) resUpdater.cancel();
134-
} catch (IllegalStateException e){
133+
// if (!resUpdater.isCancelled()) resUpdater.cancel(); // 这样写没用,还是会报错,干脆不用它了,用trycatch
134+
resUpdater.runTaskTimer(Main.instance, 0, Long.parseLong(ConfigUtils.getConfig("refresh-tick", 600).toString()));
135+
} catch (Exception e){
135136
Main.instance.getLogger().warning(ChatUtils.translateColor("#RED#奇奇怪怪的BUG出现了,不过应该问题不大"));
137+
ChatUtils.broadcast(ChatUtils.translateColor("[FlyWars] #GOLD#BugWars: #RED#创建资源刷新点任务失败,可能是已存在!"));
136138
}
137-
resUpdater.runTaskTimer(Main.instance, 0, Long.parseLong(ConfigUtils.getConfig("refresh-tick", 600).toString()));
138139
// 计分板
139140
teams.forEach(scoreboardManager::newBoard);
140141
scoreboardManager.renderScoreboard();

src/main/java/top/mpt/xzystudio/flywars/listeners/GameEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void onTeamEliminated(TeamEliminatedEvent event) {
5252
AtomicInteger ifGameOver = new AtomicInteger();
5353
AtomicReference<GameTeam> aliveTeam = null;
5454
Game.teams.forEach(it -> {
55-
if (ScoreboardManager.info.get(it).getAlive()){
55+
if (Game.scoreboardManager.info.get(it).getAlive()){
5656
ifGameOver.getAndIncrement();
5757
aliveTeam.set(it);
5858
}

src/main/java/top/mpt/xzystudio/flywars/listeners/PlayerEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void onEntityDismount(EntityDismountEvent event) {
116116
passenger.eject();
117117
vehicle.addPassenger(passenger);
118118
} catch (Exception e) {
119-
Main.instance.getLogger().warning(ChatUtils.translateColor("#RED#又是奇奇怪怪的bug,罢了罢了"));
119+
// Main.instance.getLogger().warning(ChatUtils.translateColor("#RED#又是奇奇怪怪的bug,罢了罢了"));
120120
}
121121
}
122122
});

src/main/java/top/mpt/xzystudio/flywars/scheduler/ResourcesUpdate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void run() {
4949
int y = (Integer) its.get("y");
5050
int z = (Integer) its.get("z");
5151
int amount = (Integer) its.get("amount");
52-
Main.instance.getLogger().info(String.format("(%d, %d, %d)", x, y, z));
52+
// Main.instance.getLogger().info(String.format("(%d, %d, %d)", x, y, z));
5353

5454
Location loc = new Location(gameWorld, x, y, z);
5555
ItemStack itemStack = ItemUtils.newItem(value, displayName.getOrDefault(key, key), amount);

0 commit comments

Comments
 (0)