mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Add SpoutHudAPI for other GUI-related plugins to tweak our XP Bar.
This commit is contained in:
parent
07a0f43825
commit
f767edba93
28
src/main/java/com/gmail/nossr50/api/SpoutHudAPI.java
Normal file
28
src/main/java/com/gmail/nossr50/api/SpoutHudAPI.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package com.gmail.nossr50.api;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.spout.SpoutConfig;
|
||||||
|
import com.gmail.nossr50.spout.huds.HudType;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
|
public class SpoutHudAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable the mcMMO XP bar for a player.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*/
|
||||||
|
public static void disableXpBar(Player player) {
|
||||||
|
Users.getPlayer(player).getProfile().setHudType(HudType.DISABLED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable the mcMMO XP bar for the server.
|
||||||
|
* </br>
|
||||||
|
* This function is designed for API usage.
|
||||||
|
*/
|
||||||
|
public static void disableXpBar() {
|
||||||
|
SpoutConfig.getInstance().setXPBarEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
@ -42,6 +42,8 @@ public class SpoutConfig extends ConfigLoader {
|
|||||||
|
|
||||||
/* XP Bar */
|
/* XP Bar */
|
||||||
public boolean getXPBarEnabled() { return config.getBoolean("XP.Bar.Enabled", true); }
|
public boolean getXPBarEnabled() { return config.getBoolean("XP.Bar.Enabled", true); }
|
||||||
|
public void setXPBarEnabled(boolean enabled) { config.set("XP.Bar.Enabled", enabled); }
|
||||||
|
|
||||||
public boolean getXPBarIconEnabled() { return config.getBoolean("XP.Icon.Enabled", true); }
|
public boolean getXPBarIconEnabled() { return config.getBoolean("XP.Icon.Enabled", true); }
|
||||||
public int getXPBarXPosition() { return config.getInt("XP.Bar.X_POS", 95); }
|
public int getXPBarXPosition() { return config.getInt("XP.Bar.X_POS", 95); }
|
||||||
public int getXPBarYPosition() { return config.getInt("XP.Bar.Y_POS", 6); }
|
public int getXPBarYPosition() { return config.getInt("XP.Bar.Y_POS", 6); }
|
||||||
|
Loading…
Reference in New Issue
Block a user