- MapTemplate: Save/load structures via Bukkit Structure API (.nbt files) - TemplateManager: Manage templates and presets - MapBuilder: Build/clear map with generators, hooks, pallets, etc. - SetupCommand: /dbdsetup wand/save/load/set/build for map editing - MessagesConfig: All messages with &#rrggbb color support via MiniMessage - SkillCheckConfig: Skill check colors, zones, rotation settings - Update GameConfig with color codes - ConfigManager: Load/save all 4 config files - Update plugin.yml with dbdsetup command - Add methods to Generator for template integration
91 lines
4.5 KiB
Java
91 lines
4.5 KiB
Java
package dev.loki.config;
|
|
|
|
import org.bukkit.configuration.file.FileConfiguration;
|
|
|
|
public class SkillCheckConfig {
|
|
private final FileConfiguration config;
|
|
|
|
public SkillCheckConfig(FileConfiguration config) {
|
|
this.config = config;
|
|
setDefaults();
|
|
}
|
|
|
|
private void setDefaults() {
|
|
// Colors (&#rrggbb format)
|
|
setDefault("colors.zone-success", "�FF00"); // Green zone
|
|
setDefault("colors.zone-super", "&#FFD700"); // Gold zone (great skill check)
|
|
setDefault("colors.arrow", "&#FFFFFF"); // White arrow
|
|
setDefault("colors.background", "񑘕"); // Dark gray track
|
|
setDefault("colors.text-title", "&#FFFF00"); // Yellow title
|
|
setDefault("colors.text-subtitle", "&#FFFFFF"); // White subtitle
|
|
|
|
// Zone sizes (degrees)
|
|
setDefault("zones.success-size", 15); // ±15°
|
|
setDefault("zones.super-size", 5); // ±5° (smaller, bonus)
|
|
|
|
// Rotation
|
|
setDefault("rotation.speed", 3.0); // rotations per second
|
|
setDefault("rotation.direction", "CLOCKWISE"); // or COUNTER_CLOCKWISE
|
|
setDefault("rotation.variation", true); // randomize direction
|
|
|
|
// Timing
|
|
setDefault("timing.min-interval", 80); // ticks between skill checks (4s min)
|
|
setDefault("timing.max-interval", 200); // ticks between skill checks (10s max)
|
|
setDefault("timing.reaction-window", 20); // ticks to press (1s)
|
|
|
|
// Rewards/Penalties
|
|
setDefault("rewards.success-bonus", 5.0); // +5% progress
|
|
setDefault("rewards.super-bonus", 10.0); // +10% progress
|
|
setDefault("penalties.fail-penalty", 10.0); // -10% progress
|
|
setDefault("penalties.fail-alert-range", 16); // blocks
|
|
setDefault("penalties.fail-explosion", true); // visual explosion
|
|
|
|
// Visual
|
|
setDefault("visual.show-track", true);
|
|
setDefault("visual.show-arrow", true);
|
|
setDefault("visual.use-boss-bar", false); // alternative display
|
|
setDefault("visual.screenshake-on-fail", true);
|
|
}
|
|
|
|
private void setDefault(String path, Object value) {
|
|
if (!config.contains(path)) {
|
|
config.set(path, value);
|
|
}
|
|
}
|
|
|
|
// Getters with defaults
|
|
public String getZoneSuccessColor() { return config.getString("colors.zone-success", "�FF00"); }
|
|
public String getZoneSuperColor() { return config.getString("colors.zone-super", "&#FFD700"); }
|
|
public String getArrowColor() { return config.getString("colors.arrow", "&#FFFFFF"); }
|
|
public String getBackgroundColor() { return config.getString("colors.background", "񑘕"); }
|
|
public String getTextTitleColor() { return config.getString("colors.text-title", "&#FFFF00"); }
|
|
public String getTextSubtitleColor() { return config.getString("colors.text-subtitle", "&#FFFFFF"); }
|
|
|
|
public double getSuccessZoneSize() { return config.getDouble("zones.success-size", 15); }
|
|
public double getSuperZoneSize() { return config.getDouble("zones.super-size", 5); }
|
|
|
|
public double getRotationSpeed() { return config.getDouble("rotation.speed", 3.0); }
|
|
public boolean isClockwise() {
|
|
return config.getString("rotation.direction", "CLOCKWISE").equals("CLOCKWISE");
|
|
}
|
|
public boolean hasVariation() { return config.getBoolean("rotation.variation", true); }
|
|
|
|
public int getMinInterval() { return config.getInt("timing.min-interval", 80); }
|
|
public int getMaxInterval() { return config.getInt("timing.max-interval", 200); }
|
|
public int getReactionWindow() { return config.getInt("timing.reaction-window", 20); }
|
|
|
|
public double getSuccessBonus() { return config.getDouble("rewards.success-bonus", 5.0); }
|
|
public double getSuperBonus() { return config.getDouble("rewards.super-bonus", 10.0); }
|
|
public double getFailPenalty() { return config.getDouble("penalties.fail-penalty", 10.0); }
|
|
public int getFailAlertRange() { return config.getInt("penalties.fail-alert-range", 16); }
|
|
public boolean hasFailExplosion() { return config.getBoolean("penalties.fail-explosion", true); }
|
|
|
|
public boolean showTrack() { return config.getBoolean("visual.show-track", true); }
|
|
public boolean showArrow() { return config.getBoolean("visual.show-arrow", true); }
|
|
public boolean useBossBar() { return config.getBoolean("visual.use-boss-bar", false); }
|
|
public boolean hasScreenshake() { return config.getBoolean("visual.screenshake-on-fail", true); }
|
|
|
|
public FileConfiguration getConfig() {
|
|
return config;
|
|
}
|
|
}
|