Launch more fireworks across the field of view, near and far

This commit is contained in:
MineTec committed 2026-10-10 13:28:09 +02:00
1 parent c9da982285
commit d4465063d4
1 file changed
+12 -3
@@ -47,6 +47,7 @@ public class JumpGenerator {
private static final int PREVIEW = 3;
private static final int FULL_DIFFICULTY_AT = 1000;
private static final int FINALE_AT = 1000;
private static final int FIREWORKS_NEAR = 6, FIREWORKS_FAR = 14, FIREWORKS_SPAN_TICKS = 100;
private static final Block BRIDGE_BLOCK = Block.WHITE_STAINED_GLASS;
private static final int BRIDGE_STEP_TICKS = 4;
@@ -183,10 +184,18 @@ public class JumpGenerator {
/** Durchgespielt (Beginn von „Unendlich“): Feuerwerk rund um den Spieler. */
private void celebrate() {
this.player.showTitle(FINALE_TITLE);
for(int i = 0; i < 6; i++) {
Pos at = this.player.getPosition().add(this.random.nextInt(-6, 7), 0, this.random.nextInt(2, 10));
// in Blickrichtung: ein paar Raketen nah vor dem Spieler, die meisten in der Ferne links, mittig und rechts
Pos origin = this.player.getPosition();
Vec forward = origin.direction().withY(0).normalize();
Vec right = new Vec(-forward.z(), 0, forward.x());
for(int i = 0; i < FIREWORKS_NEAR + FIREWORKS_FAR; i++) {
boolean near = i < FIREWORKS_NEAR;
double distance = near ? this.random.nextDouble(3, 10) : this.random.nextDouble(20, 45);
double side = near ? this.random.nextDouble(-6, 6) : this.random.nextDouble(-25, 25);
Pos at = origin.add(forward.mul(distance)).add(right.mul(side)).add(0, near ? 0 : 4, 0);
this.world.scheduler().buildTask(() -> Fireworks.launch(this.world, at, this.random))
.delay(TaskSchedule.tick(1 + i * 8))
.delay(TaskSchedule.tick(1 + this.random.nextInt(FIREWORKS_SPAN_TICKS)))
.schedule();
}
}