added Build Battle #15
+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) {
|
||||
|
||||
Reference in new issue
Block a user