nossr50 6 年之前
父節點
當前提交
09c91f3b4b
共有 3 個文件被更改,包括 19 次插入0 次删除
  1. 5 0
      Changelog.txt
  2. 13 0
      src/main/java/com/gmail/nossr50/util/HolidayManager.java
  3. 1 0
      src/main/resources/config.yml

+ 5 - 0
Changelog.txt

@@ -150,6 +150,11 @@ Version 2.2.0
     Added API method to check if player parties are size capped
     Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition
     Added API method to check if a skill was being level capped
+Version 2.1.32
+    Completely removed Fireworks from mcMMO because they lag
+    Added 'General.AprilFoolsEvent' setting to config.yml to turn off April Fools
+    NOTE: April Fools event has been in mcMMO for a long time, I did not write it so I didn't know it spawned fireworks like crazy.
+
 Version 2.1.31
     Fixed a bug where certain SubSkills did not properly send unlock or rank up notifications
     Fixed a bug where unlock notifications would send simultaneously for a specific skill (still happens if mmoedit changes all skill levels on a player at once)

+ 13 - 0
src/main/java/com/gmail/nossr50/util/HolidayManager.java

@@ -1,6 +1,7 @@
 package com.gmail.nossr50.util;
 
 import com.gmail.nossr50.commands.skills.AprilCommand;
+import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.datatypes.interactions.NotificationType;
 import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
 import com.gmail.nossr50.locale.LocaleLoader;
@@ -310,6 +311,9 @@ public final class HolidayManager {
     }
 
     public boolean isAprilFirst() {
+        if(!Config.getInstance().isAprilFoolsAllowed())
+            return false;
+
         GregorianCalendar aprilFirst = new GregorianCalendar(currentYear, Calendar.APRIL, 1);
         GregorianCalendar aprilSecond = new GregorianCalendar(currentYear, Calendar.APRIL, 2);
         GregorianCalendar day = new GregorianCalendar();
@@ -317,6 +321,9 @@ public final class HolidayManager {
     }
 
     public boolean nearingAprilFirst() {
+        if(!Config.getInstance().isAprilFoolsAllowed())
+            return false;
+
         GregorianCalendar start = new GregorianCalendar(Calendar.getInstance().get(Calendar.YEAR), Calendar.MARCH, 28);
         GregorianCalendar end = new GregorianCalendar(Calendar.getInstance().get(Calendar.YEAR), Calendar.APRIL, 2);
         GregorianCalendar day = new GregorianCalendar();
@@ -357,6 +364,9 @@ public final class HolidayManager {
     }
 
     public void levelUpApril(Player player, FakeSkillType fakeSkillType) {
+        if(!Config.getInstance().isAprilFoolsAllowed())
+            return;
+
         int levelTotal = Misc.getRandom().nextInt(1 + UserManager.getPlayer(player).getSkillLevel(PrimarySkillType.MINING)) + 1;
         SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP);
         NotificationManager.sendPlayerInformation(player, NotificationType.HOLIDAY, "Holiday.AprilFools.Levelup", StringUtils.getCapitalized(fakeSkillType.toString()), String.valueOf(levelTotal));
@@ -364,6 +374,9 @@ public final class HolidayManager {
     }
 
     public void registerAprilCommand() {
+        if(!Config.getInstance().isAprilFoolsAllowed())
+            return;
+
         PluginCommand command = mcMMO.p.getCommand("mcfools");
         command.setExecutor(new AprilCommand());
     }

+ 1 - 0
src/main/resources/config.yml

@@ -13,6 +13,7 @@ General:
     RetroMode:
         Enabled: false
     Locale: en_US
+    AprilFoolsEvent: true
     MOTD_Enabled: true
     # Send a message to the player when his profile was successfully loaded
     Show_Profile_Loaded: false