diff --git a/src/main/java/org/evlis/lunamatic/triggers/Scheduler.java b/src/main/java/org/evlis/lunamatic/triggers/Scheduler.java index ee83931..e9efa2e 100644 --- a/src/main/java/org/evlis/lunamatic/triggers/Scheduler.java +++ b/src/main/java/org/evlis/lunamatic/triggers/Scheduler.java @@ -33,6 +33,9 @@ public void GetOmens(Plugin plugin) { if (playerList.isEmpty()) { continue; // Skip worlds with no active players } + if (GlobalVars.disabledWorlds.contains(world.getName())) { + continue; // Skip worlds on the disabled list + } long time = world.getTime(); // Check if it's the start of the day (0 ticks, 6am) @@ -47,19 +50,19 @@ public void GetOmens(Plugin plugin) { // get the moon phase tonight @NotNull MoonPhase moonPhase = world.getMoonPhase(); // handle debugging flag - if (moonPhase == MoonPhase.FULL_MOON) { + if (moonPhase == MoonPhase.FULL_MOON && GlobalVars.fullMoonEnabled) { // Do a dice roll to check if we're getting a harvest moon? - int chance = r.nextInt(2); - if (chance == 0) { + int chance = r.nextInt(GlobalVars.harvestMoonDieSides); + if (chance == 0 && GlobalVars.harvestMoonEnabled) { GlobalVars.harvestMoonToday = true; PlayerMessage.Send(playerList, "Harvest moon tonight.", NamedTextColor.GOLD); } else { PlayerMessage.Send(playerList, "Full moon tonight.", NamedTextColor.YELLOW); } - } else if (moonPhase == MoonPhase.NEW_MOON) { + } else if (moonPhase == MoonPhase.NEW_MOON && GlobalVars.newMoonEnabled) { // Do a dice roll to check if the players are THAT unlucky.. - int chance = r.nextInt(2); - if (chance == 0) { + int chance = r.nextInt(GlobalVars.bloodMoonDieSides); + if (chance == 0 && GlobalVars.bloodMoonEnabled) { GlobalVars.bloodMoonToday = true; PlayerMessage.Send(playerList, "Blood moon tonight.", NamedTextColor.DARK_RED); } else { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 602e6bd..7469192 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,15 +1,17 @@ -# Lunamatic configuration -## Choose which moon effects to enable (default all true): +### Lunamatic configuration ### +# Choose which moon effects to enable, +# for blood moons, new moon must be enabled, +# and for harvest moons the full moon must be enabled. fullMoonEnabled: true newMoonEnabled: true harvestMoonEnabled: true bloodMoonEnabled: true -## Chance for Blood and Harvest Moons +### Chance for Blood and Harvest Moons ### # This sets the number of sides in the dice roll, # e.g. 2 = cointoss (50/50), 6 = normal die (17% chance) bloodMoonDieSides: 2 harvestMoonDieSides: 2 -## Set worlds to disable moon-effects on +### Set worlds to disable moon-effects on ### # by default both nether & the_end cannot have moon effects disabledWorlds: - world