From 8c5763047d8074bad91e96c58c728bf654bc85d0 Mon Sep 17 00:00:00 2001 From: mathiascode Date: Sat, 14 Dec 2019 23:31:28 +0200 Subject: [PATCH] Better config.yml handling --- src/main/java/pw/kaboom/extras/Main.java | 6 ++++-- src/main/resources/config.yml | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/pw/kaboom/extras/Main.java b/src/main/java/pw/kaboom/extras/Main.java index 710a01f..9def567 100644 --- a/src/main/java/pw/kaboom/extras/Main.java +++ b/src/main/java/pw/kaboom/extras/Main.java @@ -381,8 +381,10 @@ public class Main extends JavaPlugin { BlockFace.EAST, BlockFace.UP ); - - saveResource("config.yml", false); + + /* Load missing config.yml defaults */ + getConfig().options().copyDefaults(true); + saveConfig(); } public void onEnable() { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index b1f28e9..e5f66e9 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,11 +1,9 @@ -# Player connection +# Configuration for Extras plugin allowJoinOnFullServer: true enableKick: false enableJoinRestrictions: false opOnJoin: true playerJoinTitle: "§7Welcome to Kaboom!" playerJoinSubtitle: "Free OP • Anarchy • Creative" - -# Chat opTag: "§4§l[§c§lOP§4§l] §c" deOpTag: "§8§l[§7§lDeOP§8§l] §7" \ No newline at end of file