fixed issues in BuildBattle

This commit is contained in:
jannis committed 2026-10-16 20:43:14 +02:00
1 parent 53b13b6560
commit 75cd304bda
1 file changed
+9 -7
@@ -97,11 +97,11 @@ public class BuildBattle extends StatelessGame {
);
this.spawnPositions.put(player, plotCenter);
if(this.spawnPosx >= rowCount) {
if(this.spawnPosx >= rowCount - 1) {
this.spawnPosx = 0;
this.spawnPosz++;
}
this.spawnPosx++;
} else this.spawnPosx ++;
player.setGameMode(GameMode.ADVENTURE);
this.scheduler().scheduleNextTick(() -> player.teleport(plotCenter.add(0, 1.5, 0)));
return super.onPlayerJoin(player);
@@ -164,12 +164,14 @@ public class BuildBattle extends StatelessGame {
}
private void finishRound() {
int sum = this.currentVotes.values().stream().mapToInt(Integer::intValue).sum();
this.getPlayers().forEach(p -> p.getInventory().clear());
int voteSum = this.currentVotes.values().stream()
.mapToInt(Integer::intValue)
.sum();
int score = (int) Math.round((double) voteSum / this.getPlayers().size());
Player owner = this.currentOwner;
this.getPlayers().forEach(p -> p.getInventory().clear());
this.getScore().insertResult(this.currentOwner, score);
this.currentOwner = null;
this.getScore().insertResult(owner, sum);
}
private boolean isInArea(Point block, Player player) {