Skip to content

Commit b9fae91

Browse files
committed
ストリークアナウンス
1 parent f0f67f1 commit b9fae91

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/main/java/com/github/elic0de/thejpspit/game/Game.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import com.github.elic0de.thejpspit.player.PitPlayer;
55
import com.github.elic0de.thejpspit.scoreboard.GameScoreboard;
66
import com.github.elic0de.thejpspit.task.GameTask;
7-
import com.github.elic0de.thejpspit.util.killAssistHelper.KillAssistHelper;
7+
import de.themoep.minedown.MineDown;
88
import java.util.HashSet;
99
import java.util.Set;
10+
import org.bukkit.entity.Player;
1011

1112
public class Game {
1213

@@ -68,6 +69,14 @@ public void death(PitPlayer player) {
6869
//KillAssistHelper.test(player.getPlayer());
6970
}
7071

72+
public void broadcast(String message) {
73+
for (PitPlayer pitPlayer : getPitPlayers()) {
74+
final Player player = pitPlayer.getPlayer();
75+
76+
player.spigot().sendMessage(new MineDown(message).toComponent());
77+
}
78+
}
79+
7180
public Set<PitPlayer> getPitPlayers() {
7281
return pitPlayers;
7382
}

src/main/java/com/github/elic0de/thejpspit/player/PitPlayer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ public void increaseKills() {
206206

207207
public void increaseStreaks() {
208208
this.streaks ++;
209+
210+
if (streaks % 5 == 0) TheJpsPit.getInstance().getGame().broadcast(player.getName() + "&aが連続で&c" + streaks + "&aキルしています!" );
211+
209212
if (bestStreaks < streaks) {
210213
this.bestStreaks = streaks;
211214
}

0 commit comments

Comments
 (0)