Sfoglia il codice sorgente

Added config value to enable/disable power level display w/ Spout

GJ 13 anni fa
parent
commit
3b0ba43e94

+ 4 - 1
src/main/java/com/gmail/nossr50/config/LoadProperties.java

@@ -132,7 +132,8 @@ public class LoadProperties extends ConfigLoader{
      * SPOUT SETTINGS
      */
 
-    public static Boolean spoutEnabled;
+    public static boolean spoutEnabled;
+    public static boolean showPowerLevel;
 
     /* Spout Party HUD */
     public static Boolean showDisplayName, showFaces, partybar;
@@ -213,6 +214,8 @@ public class LoadProperties extends ConfigLoader{
         showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false);
         partybar = config.getBoolean("Spout.Party.HUD.Enabled", true);
 
+        showPowerLevel = config.getBoolean("Spout.HUD.Show_Power_Level", true);
+
         acrobatics_r = config.getDouble("Spout.HUD.Retro.Colors.Acrobatics.RED", 0.3);
         acrobatics_g = config.getDouble("Spout.HUD.Retro.Colors.Acrobatics.GREEN", 0.3);
         acrobatics_b = config.getDouble("Spout.HUD.Retro.Colors.Acrobatics.BLUE", 0.75);

+ 5 - 1
src/main/java/com/gmail/nossr50/listeners/mcSpoutListener.java

@@ -7,6 +7,7 @@ import org.getspout.spoutapi.player.SpoutPlayer;
 
 import com.gmail.nossr50.Users;
 import com.gmail.nossr50.mcMMO;
+import com.gmail.nossr50.config.LoadProperties;
 import com.gmail.nossr50.datatypes.HUDmmo;
 import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.spout.SpoutStuff;
@@ -32,7 +33,10 @@ public class mcSpoutListener implements Listener {
             SpoutStuff.playerHUDs.put(sPlayer, new HUDmmo(sPlayer)); //Setup Party HUD stuff
             PlayerProfile PPs = Users.getProfile(sPlayer);
             PPs.toggleSpoutEnabled();
-            sPlayer.setTitle(String.valueOf(PPs.getPowerLevel()));
+
+            if (LoadProperties.showPowerLevel) {
+                sPlayer.setTitle(String.valueOf(PPs.getPowerLevel()));
+            }
         }
     }
 }

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

@@ -340,6 +340,7 @@ Spout:
             Enabled: true
             Show_Display_Name: false
     HUD:
+        Show_Power_Level: true
         Default: STANDARD
         Retro:
             Colors: