mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 14:29:07 +01:00
Support for dev. Vault
- Clean up code - Now only create furnaceBrewingStands.yml file if the boolean is enabled - Fix double permission names
This commit is contained in:
parent
64c541855e
commit
1547505a96
BIN
libs/Vault-1.6.7.jar
Normal file
BIN
libs/Vault-1.6.7.jar
Normal file
Binary file not shown.
BIN
libs/Vault.jar
Normal file
BIN
libs/Vault.jar
Normal file
Binary file not shown.
@ -256,7 +256,7 @@ public class GuiManager {
|
||||
tempInv.setItem(i, GuiItem);
|
||||
|
||||
GuiItem = job.getGuiItem();
|
||||
Lore = new ArrayList<String>();
|
||||
Lore = new ArrayList<>();
|
||||
Lore.add(ChatColor.translateAlternateColorCodes('&', "&e" + Jobs.getLanguage().getMessage("command.info.output." + actionType.getName().toLowerCase()
|
||||
+ ".info")));
|
||||
i++;
|
||||
|
@ -50,8 +50,9 @@ public class HookEconomyTask implements Runnable {
|
||||
Bukkit.getServer().getLogger().severe("Vault or Iconomy is required by this plugin for economy support!");
|
||||
Bukkit.getServer().getLogger().severe("Please install them first!");
|
||||
Bukkit.getServer().getLogger().severe("You can find the latest versions here:");
|
||||
Bukkit.getServer().getLogger().severe("http://dev.bukkit.org/bukkit-plugins/vault/");
|
||||
Bukkit.getServer().getLogger().severe("https://dev.bukkit.org/bukkit-plugins/iconomy-7/");
|
||||
Bukkit.getServer().getLogger().severe("http://dev.bukkit.org/projects/vault/");
|
||||
Bukkit.getServer().getLogger().severe("https://dev.bukkit.org/projects/iconomy-7/");
|
||||
Bukkit.getServer().getLogger().severe("https://www.spigotmc.org/resources/vault.34315/");
|
||||
Bukkit.getServer().getLogger().severe("==============================================");
|
||||
}
|
||||
|
||||
@ -60,7 +61,7 @@ public class HookEconomyTask implements Runnable {
|
||||
if (eco == null)
|
||||
return false;
|
||||
|
||||
RegisteredServiceProvider<Economy> provider = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
|
||||
RegisteredServiceProvider<Economy> provider = Bukkit.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
if (provider == null)
|
||||
return false;
|
||||
|
||||
|
@ -577,7 +577,7 @@ public class Jobs extends JavaPlugin {
|
||||
}
|
||||
|
||||
dao.getMap().clear();
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Preloaded " + Jobs.getPlayerManager().getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time)
|
||||
consoleMsg(ChatColor.YELLOW + "[Jobs] Preloaded " + Jobs.getPlayerManager().getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time)
|
||||
/ 1000d) * 100) / 100D));
|
||||
}
|
||||
|
||||
@ -843,8 +843,7 @@ public class Jobs extends JavaPlugin {
|
||||
|
||||
FurnaceBrewingHandling.load();
|
||||
|
||||
String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] Plugin has been enabled succesfully.");
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(message);
|
||||
consoleMsg("&e[Jobs] Plugin has been enabled succesfully.");
|
||||
lManager.reload();
|
||||
|
||||
cManager.fillCommands();
|
||||
@ -866,8 +865,7 @@ public class Jobs extends JavaPlugin {
|
||||
FurnaceBrewingHandling.save();
|
||||
|
||||
Jobs.shutdown();
|
||||
String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] &2Plugin has been disabled succesfully.");
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(message);
|
||||
consoleMsg("&e[Jobs] &2Plugin has been disabled succesfully.");
|
||||
this.setEnabled(false);
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ public class PlayerManager {
|
||||
i++;
|
||||
y++;
|
||||
if (y >= 1000) {
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Saved " + i + "/" + total + " players data");
|
||||
Jobs.consoleMsg("&e[Jobs] Saved " + i + "/" + total + " players data");
|
||||
y = 0;
|
||||
}
|
||||
}
|
||||
@ -781,7 +781,7 @@ public class PlayerManager {
|
||||
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
String name = null;
|
||||
List<String> lore = new ArrayList<String>();
|
||||
List<String> lore = new ArrayList<>();
|
||||
|
||||
if (item.hasItemMeta()) {
|
||||
if (meta.hasDisplayName())
|
||||
|
@ -92,7 +92,7 @@ public class SignUtil {
|
||||
}
|
||||
|
||||
public boolean SignUpdate(String JobName) {
|
||||
List<com.gamingmesh.jobs.Signs.Sign> Copy = new ArrayList<com.gamingmesh.jobs.Signs.Sign>(Signs.GetAllSigns().size());
|
||||
List<com.gamingmesh.jobs.Signs.Sign> Copy = new ArrayList<>(Signs.GetAllSigns().size());
|
||||
for (com.gamingmesh.jobs.Signs.Sign foo : Signs.GetAllSigns()) {
|
||||
Copy.add(foo);
|
||||
}
|
||||
|
@ -1066,11 +1066,11 @@ public class ConfigManager {
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + Jobs.getJobs().size() + " jobs!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + Jobs.getJobs().size() + " jobs!");
|
||||
if (!Jobs.getExplore().isExploreEnabled()) {
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD + "[Jobs] Explorer jobs manager are not enabled!");
|
||||
Jobs.consoleMsg("&6[Jobs] Explorer jobs manager are not enabled!");
|
||||
} else
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Explorer job manager registered!");
|
||||
Jobs.consoleMsg("&e[Jobs] Explorer job manager registered!");
|
||||
//try {
|
||||
// conf.save(f);
|
||||
//} catch (IOException e) {
|
||||
|
@ -5,8 +5,6 @@ import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -44,9 +42,9 @@ public class ExploreManager {
|
||||
public void load() {
|
||||
if (!exploreEnabled)
|
||||
return;
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loading explorer data");
|
||||
Jobs.consoleMsg("&e[Jobs] Loading explorer data");
|
||||
Jobs.getJobsDAO().loadExplore();
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded explorer data (" + getSize() + ")");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded explorer data (" + getSize() + ")");
|
||||
}
|
||||
|
||||
public HashMap<String, ExploreRegion> getWorlds() {
|
||||
|
@ -6,7 +6,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -14,7 +13,6 @@ import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.container.JobInfo;
|
||||
import com.gamingmesh.jobs.container.LocaleReader;
|
||||
import com.gamingmesh.jobs.container.NameList;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
|
||||
public class NameTranslatorManager {
|
||||
|
||||
@ -135,7 +133,7 @@ public class NameTranslatorManager {
|
||||
ListOfNames.add(new NameList(id, meta, Name, MCName));
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + ListOfNames.size() + " custom item names!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfNames.size() + " custom item names!");
|
||||
|
||||
section = ItemFile.getConfig().getConfigurationSection("EntityList");
|
||||
keys = section.getKeys(false);
|
||||
@ -147,7 +145,7 @@ public class NameTranslatorManager {
|
||||
String Name = section.getString(one + ".Name");
|
||||
ListOfEntities.add(new NameList(id, meta, Name, MCName));
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + ListOfEntities.size() + " custom entity names!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEntities.size() + " custom entity names!");
|
||||
|
||||
section = ItemFile.getConfig().getConfigurationSection("EnchantList");
|
||||
keys = section.getKeys(false);
|
||||
@ -159,7 +157,7 @@ public class NameTranslatorManager {
|
||||
String Name = section.getString(one + ".Name");
|
||||
ListOfEnchants.add(new NameList(id, meta, Name, MCName));
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + ListOfEnchants.size() + " custom enchant names!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEnchants.size() + " custom enchant names!");
|
||||
|
||||
section = ItemFile.getConfig().getConfigurationSection("ColorList");
|
||||
keys = section.getKeys(false);
|
||||
@ -171,7 +169,7 @@ public class NameTranslatorManager {
|
||||
String Name = section.getString(one + ".Name");
|
||||
ListOfColors.add(new NameList(id, meta, Name, MCName));
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + ListOfColors.size() + " custom color names!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfColors.size() + " custom color names!");
|
||||
}
|
||||
|
||||
synchronized void load() {
|
||||
|
@ -17,7 +17,6 @@ import org.bukkit.entity.Player;
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.container.CuboidArea;
|
||||
import com.gamingmesh.jobs.container.RestrictedArea;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
|
||||
public class RestrictedAreaManager {
|
||||
|
||||
@ -212,7 +211,7 @@ public class RestrictedAreaManager {
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + restrictedAreas.size() + " restricted areas!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + restrictedAreas.size() + " restricted areas!");
|
||||
|
||||
try {
|
||||
conf.save(f);
|
||||
|
@ -5,14 +5,12 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.CMILib.CMIItemStack;
|
||||
import com.gamingmesh.jobs.CMILib.ItemManager;
|
||||
import com.gamingmesh.jobs.container.LocaleReader;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
|
||||
public class RestrictedBlockManager {
|
||||
|
||||
@ -161,7 +159,7 @@ public class RestrictedBlockManager {
|
||||
+ ".cd"))) {
|
||||
CMIItemStack cm = ItemManager.getItem(c.getC().getString("blocksTimer." + one + ".id"));
|
||||
if ((cm == null) || (!cm.getCMIType().isBlock())) {
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[Jobs] Your defined (" + c.getC().getString(new StringBuilder("blocksTimer.").append(one)
|
||||
Jobs.consoleMsg("&e[Jobs] Your defined (" + c.getC().getString(new StringBuilder("blocksTimer.").append(one)
|
||||
.append(".id").toString()) + ") protected block id/name is not correct!");
|
||||
} else {
|
||||
this.restrictedBlocksTimer.put(cm.getId(), c.getC().getInt("blocksTimer." + one + ".cd"));
|
||||
@ -171,7 +169,7 @@ public class RestrictedBlockManager {
|
||||
}
|
||||
c.copySetting("blocksTimer");
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + this.restrictedBlocksTimer.size() + " protected blocks timers!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + this.restrictedBlocksTimer.size() + " protected blocks timers!");
|
||||
try {
|
||||
writer.save(f);
|
||||
} catch (IOException e) {
|
||||
|
@ -19,7 +19,6 @@ import com.gamingmesh.jobs.container.BoostMultiplier;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
import com.gamingmesh.jobs.container.Schedule;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
import com.gamingmesh.jobs.stuff.TimeManage;
|
||||
|
||||
public class ScheduleManager {
|
||||
@ -237,6 +236,6 @@ public class ScheduleManager {
|
||||
|
||||
Jobs.getGCManager().BoostSchedule.add(sched);
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + Jobs.getGCManager().BoostSchedule.size() + " schedulers!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + Jobs.getGCManager().BoostSchedule.size() + " schedulers!");
|
||||
}
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ public class ShopManager {
|
||||
}
|
||||
|
||||
if (!list.isEmpty())
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + list.size() + " shop items!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + list.size() + " shop items!");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -179,6 +178,6 @@ public class TitleManager {
|
||||
|
||||
this.titles.add(new Title(titleName, titleShortName, titleColor, levelReq, jobName));
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + titles.size() + " titles!");
|
||||
Jobs.consoleMsg("&e[Jobs] Loaded " + titles.size() + " titles!");
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package com.gamingmesh.jobs.listeners;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -120,13 +119,12 @@ public class McMMOlistener implements Listener {
|
||||
} catch (ClassNotFoundException e) {
|
||||
// Disabling skill API check;
|
||||
mcMMOPresent = false;
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&',
|
||||
"&e[Jobs] &6mcMMO was found - &cBut your McMMO version is outdated, please update for full support."));
|
||||
Jobs.consoleMsg("&e[Jobs] &6mcMMO was found - &cBut your McMMO version is outdated, please update for full support.");
|
||||
// Still enabling event listener for repair
|
||||
return true;
|
||||
}
|
||||
mcMMOPresent = true;
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', "&e[Jobs] &6mcMMO was found - Enabling capabilities."));
|
||||
Jobs.consoleMsg("&e[Jobs] &6mcMMO was found - Enabling capabilities.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -30,6 +30,10 @@ public class FurnaceBrewingHandling {
|
||||
static HashMap<UUID, List<blockLoc>> brewingMap = new HashMap<>();
|
||||
|
||||
public static void load() {
|
||||
// No file creating when the boolean is false
|
||||
if (!Jobs.getGCManager().isFurnacesReassign() || !Jobs.getGCManager().isBrewingStandsReassign())
|
||||
return;
|
||||
|
||||
YmlMaker f = new YmlMaker(Jobs.getInstance(), "furnaceBrewingStands.yml");
|
||||
if (!f.exists())
|
||||
return;
|
||||
|
@ -18,10 +18,6 @@
|
||||
|
||||
package com.gamingmesh.jobs.tasks;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.economy.BufferedEconomy;
|
||||
|
||||
@ -37,9 +33,7 @@ public class BufferedPaymentThread extends Thread {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
String message = ChatColor.YELLOW + "[Jobs] Started buffered payment thread.";
|
||||
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
|
||||
console.sendMessage(message);
|
||||
Jobs.consoleMsg("&e[Jobs] Started buffered payment thread.");
|
||||
|
||||
//Jobs.getPluginLogger().info("Started buffered payment thread");
|
||||
while (running) {
|
||||
@ -55,14 +49,12 @@ public class BufferedPaymentThread extends Thread {
|
||||
economy.payAll();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
message = ChatColor.RED + "[Jobs] Exception in BufferedPaymentThread, stopping economy payments!";
|
||||
console.sendMessage(message);
|
||||
Jobs.consoleMsg("&c[Jobs] Exception in BufferedPaymentThread, stopping economy payments!");
|
||||
//Jobs.getPluginLogger().severe("Exception in BufferedPaymentThread, stopping economy payments!");
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
message = ChatColor.YELLOW + "[Jobs] Buffered payment thread shutdown.";
|
||||
console.sendMessage(message);
|
||||
Jobs.consoleMsg("&e[Jobs] Buffered payment thread shutdown.");
|
||||
//Jobs.getPluginLogger().info("Buffered payment thread shutdown");
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,6 @@
|
||||
|
||||
package com.gamingmesh.jobs.tasks;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
|
||||
public class DatabaseSaveThread extends Thread {
|
||||
@ -38,9 +34,7 @@ public class DatabaseSaveThread extends Thread {
|
||||
public void run() {
|
||||
//Jobs.getPluginLogger().info("Started database save task");
|
||||
|
||||
String message = ChatColor.YELLOW + "[Jobs] Started database save task.";
|
||||
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
|
||||
console.sendMessage(message);
|
||||
Jobs.consoleMsg("&e[Jobs] Started database save task.");
|
||||
|
||||
while (running) {
|
||||
try {
|
||||
@ -54,14 +48,12 @@ public class DatabaseSaveThread extends Thread {
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
//Jobs.getPluginLogger().severe("Exception in DatabaseSaveTask, stopping auto save!");
|
||||
message = ChatColor.RED + "[Jobs] Exception in DatabaseSaveTask, stopping auto save!";
|
||||
console.sendMessage(message);
|
||||
Jobs.consoleMsg("&c[Jobs] Exception in DatabaseSaveTask, stopping auto save!");
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
message = ChatColor.YELLOW + "[Jobs] Database save task shutdown!";
|
||||
console.sendMessage(message);
|
||||
Jobs.consoleMsg("&e[Jobs] Database save task shutdown!");
|
||||
|
||||
//Jobs.getPluginLogger().info("Database save task shutdown");
|
||||
|
||||
|
@ -10,6 +10,7 @@ commands:
|
||||
jobs:
|
||||
description: Jobs
|
||||
usage: /jobs
|
||||
|
||||
permissions:
|
||||
jobs.*:
|
||||
description: Grants access to all Jobs commands
|
||||
@ -30,6 +31,7 @@ permissions:
|
||||
description: Grants player access to all commands
|
||||
default: false
|
||||
children:
|
||||
jobs.command.archive: true
|
||||
jobs.command.browse: true
|
||||
jobs.command.stats: true
|
||||
jobs.command.admin.stats: true
|
||||
@ -43,7 +45,9 @@ permissions:
|
||||
jobs.command.fire: true
|
||||
jobs.command.fireall: true
|
||||
jobs.command.employ: true
|
||||
jobs.command.edititembonus: true
|
||||
jobs.command.promote: true
|
||||
jobs.command.points: true
|
||||
jobs.command.demote: true
|
||||
jobs.command.grantxp: true
|
||||
jobs.command.removexp: true
|
||||
@ -56,6 +60,7 @@ permissions:
|
||||
jobs.command.limit: true
|
||||
jobs.command.give: true
|
||||
jobs.command.signs: true
|
||||
jobs.command.stats: true
|
||||
jobs.command.fixnames: true
|
||||
jobs.command.signupdate: true
|
||||
jobs.command.moneyboost: true
|
||||
@ -155,9 +160,6 @@ permissions:
|
||||
jobs.command.shop:
|
||||
description: Grants access to the shop command
|
||||
default: true
|
||||
jobs.command.points:
|
||||
description: Grants access to the points command
|
||||
default: true
|
||||
jobs.command.log.others:
|
||||
description: Grants access to the log command
|
||||
default: op
|
||||
|
Loading…
Reference in New Issue
Block a user