develop-bloodmoon #10

Merged
MineTec merged 17 commits from develop-bloodmoon into master 2025-11-23 14:03:07 +00:00
2 changed files with 19 additions and 12 deletions
Showing only changes of commit b5da06fd49 - Show all commits

View File

@@ -78,7 +78,7 @@ public class Bloodmoon extends Appliance {
);
private final boolean hordesEnabled = true;
private final int hordeSpawnRateTicks = 800;
private final int hordeSpawnRateVariationTicks = 100;
private final int hordeSpawnRateVariationTicks = 800;
private final int hordeMinPopulation = 3;
private final int hordeMaxPopulation = 10;
private final int hordeSpawnDistance = 10;
@@ -87,6 +87,7 @@ public class Bloodmoon extends Appliance {
EntityType.SKELETON,
EntityType.SPIDER
);
private final Map<Player, @Nullable BukkitTask> hordeSpawnTasks = new HashMap<>();
private @Nullable BukkitTask hordeSpawnTask = null;
public final int bloodmoonLength = 12000;
public final int ticksPerDay = 24000;
@@ -133,12 +134,17 @@ public class Bloodmoon extends Appliance {
}
private int getRandomHordeSpawnDelay() {
return this.hordeSpawnRateTicks + ThreadLocalRandom.current().nextInt(-this.hordeSpawnRateVariationTicks, this.hordeSpawnRateVariationTicks);
return this.hordeSpawnRateTicks + ThreadLocalRandom.current().nextInt(this.hordeSpawnRateVariationTicks);
}
private void startHordeSpawning(int delay) {
if(this.hordeSpawnTask != null) this.hordeSpawnTask.cancel();
this.hordeSpawnTask = Bukkit.getScheduler().runTaskLater(
Bukkit.getOnlinePlayers().forEach(player -> this.startHordeSpawning(delay, player));
}
private void startHordeSpawning(int delay, Player player) {
@Nullable BukkitTask task = this.hordeSpawnTasks.get(player);
if(task != null) task.cancel();
task = Bukkit.getScheduler().runTaskLater(
Main.instance(),
() -> {
if(!this.bloodmoonIsActive()) return;
@@ -147,6 +153,7 @@ public class Bloodmoon extends Appliance {
},
delay
);
this.hordeSpawnTasks.put(player, task);
}
Pupsi marked this conversation as resolved
Review

hier die Variable aus dem map.get zu überschreiben sieht komisch aus
Mach doch eine neue Variable, du setzt unten ja sowiso manuell .put

hier die Variable aus dem map.get zu überschreiben sieht komisch aus Mach doch eine neue Variable, du setzt unten ja sowiso manuell .put
public void addPlayerToBossBar(Player player) {

View File

@@ -29,7 +29,7 @@ public class BloodmoonSetting extends BoolSetting implements CategorizedSetting
@Override
protected String description() {
return "Kämpfe während dem Blutmond mit stärkeren Monstern mit besseren Drops. Kann nicht während dem Blutmond geändert werden!";
return "Kämpfe während dem Blutmond gegen stärkere Monster mit besseren Drops. Kann nicht während dem Blutmond geändert werden!";
}
@Override