fixed issues in BuildBattle
This commit is contained in:
1 parent
53b13b6560
commit
75cd304bda
1 file changed
+9
-7
+9
-7
@@ -97,11 +97,11 @@ public class BuildBattle extends StatelessGame {
|
|||||||
);
|
);
|
||||||
this.spawnPositions.put(player, plotCenter);
|
this.spawnPositions.put(player, plotCenter);
|
||||||
|
|
||||||
if(this.spawnPosx >= rowCount) {
|
if(this.spawnPosx >= rowCount - 1) {
|
||||||
this.spawnPosx = 0;
|
this.spawnPosx = 0;
|
||||||
this.spawnPosz++;
|
this.spawnPosz++;
|
||||||
}
|
} else this.spawnPosx ++;
|
||||||
this.spawnPosx++;
|
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
this.scheduler().scheduleNextTick(() -> player.teleport(plotCenter.add(0, 1.5, 0)));
|
this.scheduler().scheduleNextTick(() -> player.teleport(plotCenter.add(0, 1.5, 0)));
|
||||||
return super.onPlayerJoin(player);
|
return super.onPlayerJoin(player);
|
||||||
@@ -164,12 +164,14 @@ public class BuildBattle extends StatelessGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void finishRound() {
|
private void finishRound() {
|
||||||
int sum = this.currentVotes.values().stream().mapToInt(Integer::intValue).sum();
|
int voteSum = this.currentVotes.values().stream()
|
||||||
this.getPlayers().forEach(p -> p.getInventory().clear());
|
.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.currentOwner = null;
|
||||||
this.getScore().insertResult(owner, sum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInArea(Point block, Player player) {
|
private boolean isInArea(Point block, Player player) {
|
||||||
|
|||||||
Reference in new issue
Block a user