From 874fbf8c10dd5494cc3b78b5f99acd3686ddbee4 Mon Sep 17 00:00:00 2001 From: MetallicGoat Date: Sat, 18 May 2024 23:50:13 -0400 Subject: [PATCH] QOL additions --- .../tweaksaddon/config/ConfigLoader.java | 13 ++++++------- .../metallicgoat/tweaksaddon/config/MainConfig.java | 4 +++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/metallicgoat/tweaksaddon/config/ConfigLoader.java b/src/main/java/me/metallicgoat/tweaksaddon/config/ConfigLoader.java index ee8676c..d54cba1 100644 --- a/src/main/java/me/metallicgoat/tweaksaddon/config/ConfigLoader.java +++ b/src/main/java/me/metallicgoat/tweaksaddon/config/ConfigLoader.java @@ -24,9 +24,9 @@ public class ConfigLoader implements Listener { @EventHandler public void onConfigLoad(ConfigsLoadEvent event) { - if (!event.isStartup()) + if (!event.isStartup()) { MBedwarsTweaksPlugin.getInstance().loadTweaks(); // Reload tweaks - + } } public static void loadTweaksConfigs(MBedwarsTweaksPlugin plugin) { @@ -116,7 +116,7 @@ private static void applyCustomTeamColors() { } private static void overrideMBedwarsConfigs() { - // APPLY OUR OVERRIDES + // Configure MBedwars to work like our old feature did if (MainConfig.personal_ender_chests_enabled) { try { final boolean teamchestEnabled = (boolean) ConfigurationAPI.get().getValue("teamchest-enabled"); @@ -125,15 +125,14 @@ private static void overrideMBedwarsConfigs() { if (teamchestEnabled && teamchestBlock == Helper.get().getMaterialByName("ENDER_CHEST")) { ConfigurationAPI.get().setValue("teamchest-enabled", false); Console.printWarn( - "WARNING: You have \"personal-ender-chests-enabled\" enabled. This setting will be removed in the future, as it is already possible in MBedwars." , + "WARNING: You have \"personal-ender-chests-enabled\" enabled. This setting will be removed in the future, as it is already possible in MBedwars.", "Open your MBedwars config.yml, and either set \"teamchest-enabled\" to false, or set \"teamchest-block\" to CHEST.", - "Currently, we are using the MBedwars configuration api to override these values for you." + "Currently, we are using the MBedwars configuration api to override these values for you, but we may not do this in the future." ); } - } catch (Exception e) { + } catch (IllegalArgumentException e) { Console.printWarn("Failed to apply personal ender chests. Try updating MBedwars, or disabling \"personal-ender-chests-enabled\""); - e.printStackTrace(); } } } diff --git a/src/main/java/me/metallicgoat/tweaksaddon/config/MainConfig.java b/src/main/java/me/metallicgoat/tweaksaddon/config/MainConfig.java index b14719b..b473388 100644 --- a/src/main/java/me/metallicgoat/tweaksaddon/config/MainConfig.java +++ b/src/main/java/me/metallicgoat/tweaksaddon/config/MainConfig.java @@ -375,12 +375,14 @@ public class MainConfig { @Config( description = { - "Removes invisibility on specified damage causes" + "Removes invisibility on specified DamageCause. See the full list of DamageCauses here:", + "https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html" } ) public static boolean remove_invis_ondamage_enabled = true; @Config public static List remove_invis_damge_causes = new ArrayList<>(Arrays.asList( EntityDamageEvent.DamageCause.ENTITY_ATTACK, + EntityDamageEvent.DamageCause.PROJECTILE, EntityDamageEvent.DamageCause.BLOCK_EXPLOSION, EntityDamageEvent.DamageCause.ENTITY_EXPLOSION ));