Fixed Deathcube not showing blocks, aswell edited the win condition.

Edited the Options for Deathcube to more realistic values
This commit is contained in:
Elias Müller 2022-10-08 23:40:05 +02:00
parent 631463d845
commit 89aca9bd98
2 changed files with 6 additions and 5 deletions

View File

@ -21,9 +21,10 @@ class Deathcube extends Minigame {
public Deathcube(int radius, int height, int percentage) { public Deathcube(int radius, int height, int percentage) {
super(Dimension.THE_END.DIMENSION, "Deathcube"); super(Dimension.THE_END.DIMENSION, "Deathcube");
this.radius = radius; this.radius = radius;
this.height = height; this.height = height + 49;
this.percentage = percentage; this.percentage = percentage;
this.setGenerator(new CircularTerrainGenerator(40, true)); this.setGenerator(new CircularTerrainGenerator(radius+10, true));
System.out.println(radius);
} }
@Override @Override
@ -49,7 +50,7 @@ class Deathcube extends Minigame {
protected void onPlayerMove(@NotNull PlayerMoveEvent playerMoveEvent) { protected void onPlayerMove(@NotNull PlayerMoveEvent playerMoveEvent) {
super.onPlayerMove(playerMoveEvent); super.onPlayerMove(playerMoveEvent);
if(isBeforeBeginning) if(playerMoveEvent.getNewPosition().y() > 51.5) playerMoveEvent.setCancelled(true); if(isBeforeBeginning) if(playerMoveEvent.getNewPosition().y() > 51.5) playerMoveEvent.setCancelled(true);
if(playerMoveEvent.getNewPosition().y() > 100) getScore().addResult(playerMoveEvent.getPlayer()); if(playerMoveEvent.getNewPosition().y() > height) getScore().addResult(playerMoveEvent.getPlayer());
} }
@Override @Override

View File

@ -24,8 +24,8 @@ public class DeathcubeFactory implements GameFactory {
@Override @Override
public ConfigManager configuration() { public ConfigManager configuration() {
return new ConfigManager() return new ConfigManager()
.addOption(new NumericOption("radius", Material.HEART_OF_THE_SEA, TranslatedComponent.byId("optionCommon#radius"), 10, 30, 50, 100)) .addOption(new NumericOption("radius", Material.HEART_OF_THE_SEA, TranslatedComponent.byId("optionCommon#radius"), 10, 20, 30))
.addOption(new NumericOption("height", Material.SCAFFOLDING, TranslatedComponent.byId("optionCommon#height"), 50, 100, 150, 200)) .addOption(new NumericOption("height", Material.SCAFFOLDING, TranslatedComponent.byId("optionCommon#height"), 10, 30, 50))
.addOption(new NumericOption("percentage", Material.COBWEB, TranslatedComponent.byId("game_Deathcube#optionPercentageBlocks"), 5, 7, 9, 11, 13)); .addOption(new NumericOption("percentage", Material.COBWEB, TranslatedComponent.byId("game_Deathcube#optionPercentageBlocks"), 5, 7, 9, 11, 13));
} }