Преглед изворни кода

Squashing some final compiler errors from static abuse removal

nossr50 пре 5 година
родитељ
комит
e8f14eece0

+ 1 - 1
src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java

@@ -68,7 +68,7 @@ public class PartyInfoCommand implements CommandExecutor {
         List<String> lockedPartyFeatures = new ArrayList<>();
 
         for (PartyFeature partyFeature : PartyFeature.values()) {
-            if (!partyFeature.hasPermission(player)) {
+            if (!partyFeature.hasPermission(pluginRef, player)) {
                 continue;
             }
 

+ 2 - 2
src/main/java/com/gmail/nossr50/config/hocon/playerleveling/ConfigLeveling.java

@@ -246,7 +246,7 @@ public class ConfigLeveling {
             case SALVAGE:
                 return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSalvage().getLevelCap();
             default:
-                pluginRef.getLogger().severe("No defined level cap for " + primarySkillType.toString() + " - Contact the mcMMO dev team!");
+                System.out.println(("[mcMMO Debug LevelingConfig] No defined level cap for " + primarySkillType.toString() + " - Contact the mcMMO dev team!"));
                 return Integer.MAX_VALUE;
         }
     }
@@ -284,7 +284,7 @@ public class ConfigLeveling {
             case SALVAGE:
                 return configSectionLevelCaps.getConfigSectionSkillLevelCaps().getSalvage().isLevelCapEnabled();
             default:
-                pluginRef.getLogger().severe("No defined level cap for " + primarySkillType.toString() + " - Contact the mcMMO dev team!");
+                System.out.println(("[mcMMO Debug LevelingConfig] No defined level cap for " + primarySkillType.toString() + " - Contact the mcMMO dev team!"));
                 return false;
         }
     }

+ 3 - 1
src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java

@@ -1,6 +1,7 @@
 package com.gmail.nossr50.datatypes.party;
 
 import com.gmail.nossr50.commands.party.PartySubcommandType;
+import com.gmail.nossr50.mcMMO;
 import org.bukkit.entity.Player;
 
 public enum PartyFeature {
@@ -10,7 +11,8 @@ public enum PartyFeature {
     ITEM_SHARE,
     XP_SHARE;
 
-    public boolean hasPermission(Player player) {
+    //TODO: hacky...
+    public boolean hasPermission(mcMMO pluginRef, Player player) {
         PartySubcommandType partySubCommandType;
         switch (this) {
             case CHAT:

+ 2 - 1
src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java

@@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
 import org.bukkit.event.Cancellable;
 
 public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable {
-    private SubSkillType subSkillType;
+    private final SubSkillType subSkillType;
     private boolean cancelled = false;
 
     /**
@@ -26,6 +26,7 @@ public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable
 
     public SubSkillEvent(Player player, AbstractSubSkill abstractSubSkill) {
         super(player, abstractSubSkill.getPrimarySkill());
+        this.subSkillType = abstractSubSkill.getSubSkillType();
     }
 
     /**

+ 4 - 2
src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java

@@ -1,5 +1,6 @@
 package com.gmail.nossr50.events.skills.secondaryabilities;
 
+import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
 import com.gmail.nossr50.datatypes.skills.SubSkillType;
 import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
 import org.bukkit.entity.Player;
@@ -7,8 +8,9 @@ import org.bukkit.entity.Player;
 public class SubSkillRandomCheckEvent extends SubSkillEvent {
     private double chance;
 
-    public SubSkillRandomCheckEvent(Player player, SubSkillType ability, double chance) {
-        super(player, ability);
+    @Deprecated
+    public SubSkillRandomCheckEvent(Player player, SubSkillType subSkillType, double chance, PrimarySkillType primarySkillType) {
+        super(player, subSkillType, primarySkillType);
         this.chance = chance;
     }
 

+ 1 - 1
src/main/java/com/gmail/nossr50/util/MobHealthBarManager.java

@@ -80,7 +80,7 @@ public final class MobHealthBarManager {
                 target.setMetadata(MetadataConstants.NAME_VISIBILITY_METAKEY, new FixedMetadataValue(pluginRef, false));
             }
 
-            new MobHealthDisplayUpdaterTask(target).runTaskLater(pluginRef, displayTime * pluginRef.getMiscTools().TICK_CONVERSION_FACTOR); // Clear health display after 3 seconds
+            new MobHealthDisplayUpdaterTask(pluginRef, target).runTaskLater(pluginRef, displayTime * pluginRef.getMiscTools().TICK_CONVERSION_FACTOR); // Clear health display after 3 seconds
         }
     }
 

+ 1 - 1
src/main/java/com/gmail/nossr50/util/random/RandomChanceTools.java

@@ -230,7 +230,7 @@ public class RandomChanceTools {
     }
 
     public boolean sendSkillEvent(Player player, SubSkillType subSkillType, double activationChance) {
-        SubSkillRandomCheckEvent event = new SubSkillRandomCheckEvent(player, subSkillType, activationChance);
+        SubSkillRandomCheckEvent event = new SubSkillRandomCheckEvent(player, subSkillType, activationChance, pluginRef.getSkillTools().getPrimarySkillBySubSkill(subSkillType));
         return !event.isCancelled();
     }