mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-02-21 14:31:22 +01:00
!Disable plugin when running MI Mana
This commit is contained in:
parent
933357ac25
commit
210d791233
@ -241,42 +241,45 @@ public class MMOCore extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}.runTaskTimerAsynchronously(MMOCore.plugin, 100, 20);
|
}.runTaskTimerAsynchronously(MMOCore.plugin, 100, 20);
|
||||||
|
|
||||||
//For the sake of the lord, make sure they aren't using MMOItems Mana and Stamina Addon...
|
/*
|
||||||
//This should prevent a couple error reports produced by people not reading the installation guide...
|
* For the sake of the lord, make sure they aren't using MMOItems Mana
|
||||||
if(Bukkit.getPluginManager().getPlugin("MMOItemsMana") != null) {
|
* and Stamina Addon...This should prevent a couple error reports
|
||||||
new BukkitRunnable() {
|
* produced by people not reading the installation guide...
|
||||||
public void run() {
|
*/
|
||||||
Bukkit.broadcastMessage(ChatColor.DARK_RED + "MMOCore is not compatible with the Mana and Stamina addon of MMOItems!!!");
|
if (Bukkit.getPluginManager().getPlugin("MMOItemsMana") != null) {
|
||||||
Bukkit.broadcastMessage(ChatColor.DARK_RED + "Please read the installation guide!");
|
getLogger().log(Level.SEVERE, "\\u001B[31mMMOCore is not meant to be used with the Mana & Stamina MMOItems!!!");
|
||||||
}
|
getLogger().log(Level.SEVERE, "\\u001B[31mPlease re-read the installation guide!");
|
||||||
}.runTaskTimer(MMOCore.plugin, 1200, 1200);
|
Bukkit.getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
reloadPlugin();
|
reloadPlugin();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* default action bar.
|
* default action bar. only ran if the action bar is enabled
|
||||||
* only ran if the action bar is enabled
|
|
||||||
*/
|
*/
|
||||||
if(getConfig().getBoolean("action-bar.enabled")) {
|
if (getConfig().getBoolean("action-bar.enabled")) {
|
||||||
DecimalFormat format = new DecimalFormat(getConfig().getString("action-bar.decimal"), configManager.formatSymbols);
|
DecimalFormat format = new DecimalFormat(getConfig().getString("action-bar.decimal"), configManager.formatSymbols);
|
||||||
int ticks = getConfig().getInt("action-bar.ticks-to-update");
|
int ticks = getConfig().getInt("action-bar.ticks-to-update");
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
//System.out.println("Tick!");
|
// System.out.println("Tick!");
|
||||||
|
|
||||||
for (PlayerData data : PlayerData.getAll()) {
|
for (PlayerData data : PlayerData.getAll()) {
|
||||||
if(!data.isCasting() && !pausePlayers.contains(data.getUniqueId())) {
|
if (!data.isCasting() && !pausePlayers.contains(data.getUniqueId())) {
|
||||||
//System.out.println("Display!");
|
// System.out.println("Display!");
|
||||||
data.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(placeholderParser.parse(data.getPlayer(), ChatColor.translateAlternateColorCodes('&', getConfig().getString("action-bar.format")
|
data.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(placeholderParser.parse(data.getPlayer(),
|
||||||
.replace("{health}", format.format(data.getPlayer().getHealth())).replace("{max_health}", "" + StatType.MAX_HEALTH.format(data.getStats().getStat(StatType.MAX_HEALTH)))
|
ChatColor.translateAlternateColorCodes('&', getConfig().getString("action-bar.format").replace("{health}", format.format(data.getPlayer().getHealth()))
|
||||||
.replace("{mana}", format.format(data.getMana())).replace("{max_mana}", "" + StatType.MAX_MANA.format(data.getStats().getStat(StatType.MAX_MANA)))
|
.replace("{max_health}", "" + StatType.MAX_HEALTH.format(data.getStats().getStat(StatType.MAX_HEALTH))).replace("{mana}", format.format(data.getMana()))
|
||||||
.replace("{stamina}", format.format(data.getStamina())).replace("{max_stamina}", "" + StatType.MAX_STAMINA.format(data.getStats().getStat(StatType.MAX_STAMINA)))
|
.replace("{max_mana}", "" + StatType.MAX_MANA.format(data.getStats().getStat(StatType.MAX_MANA))).replace("{stamina}", format.format(data.getStamina()))
|
||||||
.replace("{stellium}", format.format(data.getStellium())).replace("{max_stellium}", "" + StatType.MAX_STELLIUM.format(data.getStats().getStat(StatType.MAX_STELLIUM)))
|
.replace("{max_stamina}", "" + StatType.MAX_STAMINA.format(data.getStats().getStat(StatType.MAX_STAMINA)))
|
||||||
.replace("{class}", data.getProfess().getName()).replace("{xp}", "" + data.getExperience()).replace("{armor}", "" + StatType.ARMOR.format(data.getPlayer().getAttribute(Attribute.GENERIC_ARMOR).getValue()))
|
.replace("{stellium}", format.format(data.getStellium()))
|
||||||
.replace("{level}", "" + data.getLevel()).replace("{name}", data.getPlayer().getDisplayName())))));
|
.replace("{max_stellium}", "" + StatType.MAX_STELLIUM.format(data.getStats().getStat(StatType.MAX_STELLIUM)))
|
||||||
|
.replace("{class}", data.getProfess().getName()).replace("{xp}", "" + data.getExperience())
|
||||||
|
.replace("{armor}", "" + StatType.ARMOR.format(data.getPlayer().getAttribute(Attribute.GENERIC_ARMOR).getValue())).replace("{level}", "" + data.getLevel())
|
||||||
|
.replace("{name}", data.getPlayer().getDisplayName())))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,22 +333,32 @@ public class MMOCore extends JavaPlugin {
|
|||||||
|
|
||||||
FileConfiguration config = new ConfigFile("commands").getConfig();
|
FileConfiguration config = new ConfigFile("commands").getConfig();
|
||||||
|
|
||||||
if(config.contains("player")) commandMap.register("mmocore", new PlayerStatsCommand(config.getConfigurationSection("player")));
|
if (config.contains("player"))
|
||||||
if(config.contains("attributes")) commandMap.register("mmocore", new AttributesCommand(config.getConfigurationSection("attributes")));
|
commandMap.register("mmocore", new PlayerStatsCommand(config.getConfigurationSection("player")));
|
||||||
if(config.contains("class")) commandMap.register("mmocore", new ClassCommand(config.getConfigurationSection("class")));
|
if (config.contains("attributes"))
|
||||||
if(config.contains("waypoints")) commandMap.register("mmocore", new WaypointsCommand(config.getConfigurationSection("waypoints")));
|
commandMap.register("mmocore", new AttributesCommand(config.getConfigurationSection("attributes")));
|
||||||
if(config.contains("quests")) commandMap.register("mmocore", new QuestsCommand(config.getConfigurationSection("quests")));
|
if (config.contains("class"))
|
||||||
if(config.contains("skills")) commandMap.register("mmocore", new SkillsCommand(config.getConfigurationSection("skills")));
|
commandMap.register("mmocore", new ClassCommand(config.getConfigurationSection("class")));
|
||||||
if(config.contains("friends")) commandMap.register("mmocore", new FriendsCommand(config.getConfigurationSection("friends")));
|
if (config.contains("waypoints"))
|
||||||
if(config.contains("party")) commandMap.register("mmocore", new PartyCommand(config.getConfigurationSection("party")));
|
commandMap.register("mmocore", new WaypointsCommand(config.getConfigurationSection("waypoints")));
|
||||||
if(config.contains("guild")) commandMap.register("mmocore", new GuildCommand(config.getConfigurationSection("guild")));
|
if (config.contains("quests"))
|
||||||
|
commandMap.register("mmocore", new QuestsCommand(config.getConfigurationSection("quests")));
|
||||||
|
if (config.contains("skills"))
|
||||||
|
commandMap.register("mmocore", new SkillsCommand(config.getConfigurationSection("skills")));
|
||||||
|
if (config.contains("friends"))
|
||||||
|
commandMap.register("mmocore", new FriendsCommand(config.getConfigurationSection("friends")));
|
||||||
|
if (config.contains("party"))
|
||||||
|
commandMap.register("mmocore", new PartyCommand(config.getConfigurationSection("party")));
|
||||||
|
if (config.contains("guild"))
|
||||||
|
commandMap.register("mmocore", new GuildCommand(config.getConfigurationSection("guild")));
|
||||||
|
|
||||||
if (hasEconomy() && economy.isValid()) {
|
if (hasEconomy() && economy.isValid()) {
|
||||||
if(config.contains("withdraw")) commandMap.register("mmocore", new WithdrawCommand(config.getConfigurationSection("withdraw")));
|
if (config.contains("withdraw"))
|
||||||
if(config.contains("deposit")) commandMap.register("mmocore", new DepositCommand(config.getConfigurationSection("deposit")));
|
commandMap.register("mmocore", new WithdrawCommand(config.getConfigurationSection("withdraw")));
|
||||||
|
if (config.contains("deposit"))
|
||||||
|
commandMap.register("mmocore", new DepositCommand(config.getConfigurationSection("deposit")));
|
||||||
}
|
}
|
||||||
}
|
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException ex) {
|
||||||
catch(NoSuchFieldException | IllegalArgumentException | IllegalAccessException ex) {
|
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user