diff --git a/core/src/main/java/eu/mhsl/craftattack/spawn/core/util/IteratorUtil.java b/core/src/main/java/eu/mhsl/craftattack/spawn/core/util/IteratorUtil.java index 336724c..b8b974d 100644 --- a/core/src/main/java/eu/mhsl/craftattack/spawn/core/util/IteratorUtil.java +++ b/core/src/main/java/eu/mhsl/craftattack/spawn/core/util/IteratorUtil.java @@ -31,6 +31,10 @@ public class IteratorUtil { rules.forEach((gameRule, value) -> IteratorUtil.worlds(world -> world.setGameRule(gameRule, value ^ inverse))); } + public static void setIntGameRules(Map, Integer> rules) { + rules.forEach((gameRule, value) -> IteratorUtil.worlds(world -> world.setGameRule(gameRule, value))); + } + public static void times(int times, Runnable callback) { IntStream.range(0, times).forEach(value -> callback.run()); } diff --git a/craftattack/src/main/java/eu/mhsl/craftattack/spawn/craftattack/appliances/tooling/projectStart/ProjectStart.java b/craftattack/src/main/java/eu/mhsl/craftattack/spawn/craftattack/appliances/tooling/projectStart/ProjectStart.java index 74c8477..1f4d0a5 100644 --- a/craftattack/src/main/java/eu/mhsl/craftattack/spawn/craftattack/appliances/tooling/projectStart/ProjectStart.java +++ b/craftattack/src/main/java/eu/mhsl/craftattack/spawn/craftattack/appliances/tooling/projectStart/ProjectStart.java @@ -68,6 +68,12 @@ public class ProjectStart extends Appliance { entry(GameRules.FALL_DAMAGE, true), entry(GameRules.FIRE_DAMAGE, true) ); + private final Map, Integer> intGameRulesAfterStart = Map.of( + GameRules.FIRE_SPREAD_RADIUS_AROUND_PLAYER, -1 + ); + private final Map, Integer> intGameRulesBeforeStart = Map.of( + GameRules.FIRE_SPREAD_RADIUS_AROUND_PLAYER, 0 + ); public ProjectStart() { super("countdown"); @@ -121,6 +127,7 @@ public class ProjectStart extends Appliance { IteratorUtil.worlds(World::getWorldBorder, worldBorder -> worldBorder.setSize(worldBorder.getMaxSize())); IteratorUtil.worlds(world -> IteratorUtil.setGameRules(this.gameRulesAfterStart, false)); + IteratorUtil.worlds(world -> IteratorUtil.setIntGameRules(this.intGameRulesAfterStart)); Bukkit.getWorlds().getFirst().setFullTime(0); this.netherFireLocations.forEach(location -> Objects.requireNonNull(this.startWorld).getBlockAt(location).setType(Material.FIRE)); @@ -168,6 +175,7 @@ public class ProjectStart extends Appliance { }); IteratorUtil.worlds(world -> world, world -> IteratorUtil.setGameRules(this.gameRulesAfterStart, true)); + IteratorUtil.worlds(world -> world, world -> IteratorUtil.setIntGameRules(this.intGameRulesBeforeStart)); this.resetAdvancements(); this.blockCycle.reset();