Complete Stage 0: Project scaffold

- Fix build.gradle.kts: Java 21, Paper 1.20.6, ProtocolLib 5.3.0
- Add permissions to paper-plugin.yml
- Add ConfigManager with safe yaml loading (no overwrite)
- Add LocationsConfig for all game object coordinates
- Add GameConfig with all balance values
- Update mdbd.java with onEnable/onDisable + ConfigManager
- Mark Stage 0 complete in PLAN.md
This commit is contained in:
loki5512344 2026-05-31 20:37:36 +02:00
parent 32da611c63
commit 53f3f6e9da
7 changed files with 443 additions and 15 deletions

View file

@ -0,0 +1,176 @@
package dev.loki.config;
import org.bukkit.configuration.file.FileConfiguration;
public class GameConfig {
private final FileConfiguration config;
public GameConfig(FileConfiguration config) {
this.config = config;
setDefaults();
}
private void setDefaults() {
// Lobby settings
setDefault("lobby.min-players", 5);
setDefault("lobby.max-players", 5);
setDefault("lobby.countdown-seconds", 60);
setDefault("lobby.role-assign-delay", 5);
// Generator settings
setDefault("generators.total-count", 7);
setDefault("generators.required-count", 5);
setDefault("generators.repair-seconds", 80);
setDefault("generators.regression-rate", 0.25);
setDefault("generators.kick-regression-rate", 2.5);
setDefault("generators.kick-duration-seconds", 30);
// Skill check settings
setDefault("skillcheck.zone-size", 0.15);
setDefault("skillcheck.rotation-speed", 3.0);
setDefault("skillcheck.success-bonus", 5.0);
setDefault("skillcheck.fail-penalty", 10.0);
// Hook settings
setDefault("hooks.stage1-seconds", 60);
setDefault("hooks.stage2-seconds", 60);
setDefault("hooks.struggle-interval", 2);
setDefault("hooks.max-hooks", 3);
// Movement speeds (% of normal)
setDefault("movement.killer", 115);
setDefault("movement.killer-carry", 92);
setDefault("movement.survivor-walk", 100);
setDefault("movement.survivor-sprint", 150);
setDefault("movement.survivor-crawl", 30);
setDefault("movement.exhaustion-duration", 3);
setDefault("movement.exhaustion-cooldown", 5);
// Healing settings
setDefault("healing.self-heal-seconds", 30);
setDefault("healing.other-heal-seconds", 16);
setDefault("healing.medkit-bonus", 0.5);
// Killer settings
setDefault("killer.attack-cooldown", 2.5);
setDefault("killer.attack-range", 3.0);
setDefault("killer.pallet-stun-seconds", 2.5);
setDefault("killer.pallet-break-seconds", 3.0);
setDefault("killer.terror-radius", 32);
// Window vault
setDefault("window.vault-survivor-fast", 1.0);
setDefault("window.vault-survivor-slow", 1.5);
setDefault("window.vault-killer", 1.5);
// Endgame
setDefault("endgame.gate-open-seconds", 20);
setDefault("endgame.collapse-seconds", 120);
setDefault("endgame.chest-open-seconds", 3);
// Hatch
setDefault("hatch.min-survivors-for-open", 1);
}
private void setDefault(String path, Object value) {
if (!config.contains(path)) {
config.set(path, value);
}
}
public int getMinPlayers() {
return config.getInt("lobby.min-players", 5);
}
public int getMaxPlayers() {
return config.getInt("lobby.max-players", 5);
}
public int getLobbyCountdown() {
return config.getInt("lobby.countdown-seconds", 60);
}
public int getRoleAssignDelay() {
return config.getInt("lobby.role-assign-delay", 5);
}
public int getGeneratorTotal() {
return config.getInt("generators.total-count", 7);
}
public int getGeneratorRequired() {
return config.getInt("generators.required-count", 5);
}
public int getGeneratorRepairSeconds() {
return config.getInt("generators.repair-seconds", 80);
}
public double getRegressionRate() {
return config.getDouble("generators.regression-rate", 0.25);
}
public double getKickRegressionRate() {
return config.getDouble("generators.kick-regression-rate", 2.5);
}
public int getKickDuration() {
return config.getInt("generators.kick-duration-seconds", 30);
}
public int getStage1Seconds() {
return config.getInt("hooks.stage1-seconds", 60);
}
public int getStage2Seconds() {
return config.getInt("hooks.stage2-seconds", 60);
}
public int getMaxHooks() {
return config.getInt("hooks.max-hooks", 3);
}
public double getKillerSpeed() {
return config.getDouble("movement.killer", 115) / 100.0;
}
public double getKillerCarrySpeed() {
return config.getDouble("movement.killer-carry", 92) / 100.0;
}
public double getSurvivorWalkSpeed() {
return config.getDouble("movement.survivor-walk", 100) / 100.0;
}
public double getSurvivorSprintSpeed() {
return config.getDouble("movement.survivor-sprint", 150) / 100.0;
}
public double getSurvivorCrawlSpeed() {
return config.getDouble("movement.survivor-crawl", 30) / 100.0;
}
public int getAttackCooldown() {
return (int) (config.getDouble("killer.attack-cooldown", 2.5) * 20);
}
public double getAttackRange() {
return config.getDouble("killer.attack-range", 3.0);
}
public int getPalletStunTicks() {
return (int) (config.getDouble("killer.pallet-stun-seconds", 2.5) * 20);
}
public int getPalletBreakTicks() {
return (int) (config.getDouble("killer.pallet-break-seconds", 3.0) * 20);
}
public int getTerrorRadius() {
return config.getInt("killer.terror-radius", 32);
}
public FileConfiguration getConfig() {
return config;
}
}