mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-25 20:16:13 +01:00
Clean up code
Other: - Removed unused imports. - Removed deprecation methods. - Support for WorldEdit 7.0.0 - Support for MyPet 3.0
This commit is contained in:
parent
7fc27936ab
commit
f3c456c046
Binary file not shown.
BIN
libs/MyPet-3.0-SNAPSHOT.jar
Normal file
BIN
libs/MyPet-3.0-SNAPSHOT.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
libs/worldedit-bukkit-7.0.0-SNAPSHOT-dist.jar
Normal file
BIN
libs/worldedit-bukkit-7.0.0-SNAPSHOT-dist.jar
Normal file
Binary file not shown.
@ -96,7 +96,6 @@ import com.gamingmesh.jobs.listeners.PistonProtectionListener;
|
||||
import com.gamingmesh.jobs.selection.SelectionManager;
|
||||
import com.gamingmesh.jobs.stuff.ActionBar;
|
||||
import com.gamingmesh.jobs.stuff.CMIScoreboardManager;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
||||
import com.gamingmesh.jobs.stuff.Loging;
|
||||
import com.gamingmesh.jobs.stuff.RawMessage;
|
||||
@ -106,7 +105,6 @@ import com.gamingmesh.jobs.tasks.BufferedPaymentThread;
|
||||
import com.gamingmesh.jobs.tasks.DatabaseSaveThread;
|
||||
|
||||
public class Jobs extends JavaPlugin {
|
||||
// public static Jobs plugin = new Jobs();
|
||||
private static String version = "";
|
||||
private static PlayerManager pManager = null;
|
||||
private static JobsCommands cManager = null;
|
||||
|
@ -6,7 +6,6 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
import io.lumine.xikage.mythicmobs.MythicMobs;
|
||||
import io.lumine.xikage.mythicmobs.api.bukkit.BukkitAPIHelper;
|
||||
|
@ -16,7 +16,6 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.config.CommentedYamlConfiguration;
|
||||
import com.gamingmesh.jobs.container.TopList;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
public class SignUtil {
|
||||
|
||||
@ -202,7 +201,6 @@ public class SignUtil {
|
||||
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void run() {
|
||||
|
||||
org.bukkit.material.Sign signMat = (org.bukkit.material.Sign) sign.getData();
|
||||
|
@ -17,7 +17,6 @@ import com.gamingmesh.jobs.container.RestrictedArea;
|
||||
|
||||
public class area implements Cmd {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
@JobCommand(300)
|
||||
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
|
||||
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -11,7 +11,6 @@ import com.gamingmesh.jobs.commands.JobCommand;
|
||||
import com.gamingmesh.jobs.container.BoostMultiplier;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
import com.gamingmesh.jobs.container.JobItemBonus;
|
||||
import com.gamingmesh.jobs.container.JobItems;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
|
@ -3,7 +3,6 @@ package com.gamingmesh.jobs.commands.list;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
|
@ -3,14 +3,9 @@ package com.gamingmesh.jobs.commands.list;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.scoreboard.ScoreboardManager;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
|
@ -3,14 +3,9 @@ package com.gamingmesh.jobs.commands.list;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Score;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.scoreboard.ScoreboardManager;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
|
@ -32,7 +32,6 @@ import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
@ -58,7 +57,6 @@ import com.gamingmesh.jobs.container.JobPermission;
|
||||
import com.gamingmesh.jobs.container.Quest;
|
||||
import com.gamingmesh.jobs.resources.jfep.Parser;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
import com.gamingmesh.jobs.stuff.VersionChecker.Version;
|
||||
|
||||
public class ConfigManager {
|
||||
@ -363,7 +361,6 @@ public class ConfigManager {
|
||||
* loads from Jobs/jobConfig.yml
|
||||
* @throws IOException
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private void loadJobSettings() throws IOException {
|
||||
File f = new File(plugin.getDataFolder(), "jobConfig.yml");
|
||||
InputStreamReader s = new InputStreamReader(new FileInputStream(f), "UTF-8");
|
||||
|
@ -2,11 +2,8 @@ package com.gamingmesh.jobs.config;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -18,7 +15,6 @@ import com.gamingmesh.jobs.container.ExploreChunk;
|
||||
import com.gamingmesh.jobs.container.ExploreRegion;
|
||||
import com.gamingmesh.jobs.container.ExploreRespond;
|
||||
import com.gamingmesh.jobs.dao.JobsDAO.ExploreDataTableFields;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
public class ExploreManager {
|
||||
|
||||
|
@ -371,7 +371,6 @@ public class GeneralConfigManager {
|
||||
*
|
||||
* loads from Jobs/generalConfig.yml
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private synchronized void loadGeneralSettings() {
|
||||
File f = new File(plugin.getDataFolder(), "generalConfig.yml");
|
||||
YamlConfiguration conf = YamlConfiguration.loadConfiguration(f);
|
||||
|
@ -20,7 +20,6 @@ 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.Debug;
|
||||
import com.gamingmesh.jobs.stuff.TimeManage;
|
||||
|
||||
public class ScheduleManager {
|
||||
|
@ -123,7 +123,6 @@ public class ShopManager {
|
||||
}
|
||||
|
||||
for (JobItems one : item.getitems()) {
|
||||
@SuppressWarnings("deprecation")
|
||||
CMIMaterial mat = CMIMaterial.get(one.getId(), one.getData());
|
||||
|
||||
if (mat == null)
|
||||
@ -239,7 +238,6 @@ public class ShopManager {
|
||||
|
||||
ArrayList<String> Lore = new ArrayList<String>();
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
CMIMaterial mat = CMIMaterial.get(item.getIconId(), item.getIconData());
|
||||
|
||||
if (item.isHideWithoutPerm()) {
|
||||
|
@ -4,7 +4,6 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.logging.Level;
|
||||
|
@ -5,7 +5,6 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
public class ExploreChunk {
|
||||
|
||||
|
@ -33,7 +33,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.resources.jfep.Parser;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
public class Job {
|
||||
// job info
|
||||
|
@ -65,11 +65,11 @@ public class Language {
|
||||
String msg = "";
|
||||
try {
|
||||
if (customlocale == null || !customlocale.contains(key))
|
||||
msg = enlocale.contains(key) == true ? ChatColor.translateAlternateColorCodes('&', enlocale.getString(key)) : missing;
|
||||
msg = enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : missing;
|
||||
else
|
||||
msg = customlocale.contains(key) == true ? ChatColor.translateAlternateColorCodes('&', customlocale.getString(key)) : missing;
|
||||
msg = customlocale.contains(key) == true ? Colors(customlocale.getString(key)) : missing;
|
||||
} catch (Exception e) {
|
||||
String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] &2Cant read language file. Plugin will be disabled.");
|
||||
String message = Colors("&e[Jobs] &2Cant read language file. Plugin will be disabled.");
|
||||
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
|
||||
console.sendMessage(message);
|
||||
throw e;
|
||||
@ -105,7 +105,7 @@ public class Language {
|
||||
msg = msg.replace(String.valueOf(variables[y]), String.valueOf(variables[y + 1]));
|
||||
}
|
||||
msg = filterNewLine(msg);
|
||||
ls.set(i, ChatColor.translateAlternateColorCodes('&', msg));
|
||||
ls.set(i, Colors(msg));
|
||||
}
|
||||
|
||||
return ls;
|
||||
@ -141,7 +141,7 @@ public class Language {
|
||||
* @return the message
|
||||
*/
|
||||
public String getDefaultMessage(String key) {
|
||||
return enlocale.contains(key) == true ? ChatColor.translateAlternateColorCodes('&', enlocale.getString(key)) : "Cant find locale";
|
||||
return enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : "Cant find locale";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -81,7 +81,6 @@ import com.gamingmesh.jobs.container.JobProgression;
|
||||
import com.gamingmesh.jobs.container.JobsArmorChangeEvent;
|
||||
import com.gamingmesh.jobs.container.JobsArmorChangeEvent.EquipMethod;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
import com.gamingmesh.jobs.stuff.Util;
|
||||
|
||||
public class JobsListener implements Listener {
|
||||
@ -834,8 +833,6 @@ public class JobsListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void playerInteractEvent(PlayerInteractEvent event) {
|
||||
// if (event.isCancelled())
|
||||
// return;
|
||||
|
||||
Action action = event.getAction();
|
||||
if (action == Action.PHYSICAL)
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.gamingmesh.jobs.nmsUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
@ -52,7 +51,6 @@ public class v1_7 implements NMS {
|
||||
return name;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public ItemStack getItemInMainHand(Player player) {
|
||||
return player.getInventory().getItemInHand();
|
||||
|
@ -2,9 +2,7 @@ package com.gamingmesh.jobs.nmsUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Guardian;
|
||||
@ -59,7 +57,6 @@ public class v1_8 implements NMS {
|
||||
return name;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public ItemStack getItemInMainHand(Player player) {
|
||||
return player.getInventory().getItemInHand();
|
||||
|
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -16,7 +15,6 @@ import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
|
||||
|
||||
public class GiveItem {
|
||||
public static boolean GiveItemForPlayer(Player player, int id, int meta, int qty, String name, List<String> lore, HashMap<Enchantment, Integer> hashMap) {
|
||||
@SuppressWarnings("deprecation")
|
||||
ItemStack itemStack = CMIMaterial.get(id, meta).newItemStack();
|
||||
itemStack.setAmount(qty);
|
||||
ItemMeta ItemMeta = itemStack.getItemMeta();
|
||||
|
@ -15,7 +15,6 @@ import org.bukkit.util.StringUtil;
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.container.ActionType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
import com.gamingmesh.jobs.container.JobItemBonus;
|
||||
import com.gamingmesh.jobs.container.JobItems;
|
||||
import com.gamingmesh.jobs.container.JobProgression;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
|
@ -108,20 +108,20 @@ public class VersionChecker {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isLower(Version version) {
|
||||
return this.version.getValue() < version.getValue();
|
||||
public boolean isLower(Version v) {
|
||||
return version.getValue() < v.getValue();
|
||||
}
|
||||
|
||||
public boolean isLowerEquals(Version version) {
|
||||
return this.version.getValue() <= version.getValue();
|
||||
public boolean isLowerEquals(Version v) {
|
||||
return version.getValue() <= v.getValue();
|
||||
}
|
||||
|
||||
public boolean isHigher(Version version) {
|
||||
return this.version.getValue() > version.getValue();
|
||||
public boolean isHigher(Version v) {
|
||||
return version.getValue() > v.getValue();
|
||||
}
|
||||
|
||||
public boolean isHigherEquals(Version version) {
|
||||
return this.version.getValue() >= version.getValue();
|
||||
public boolean isHigherEquals(Version v) {
|
||||
return version.getValue() >= v.getValue();
|
||||
}
|
||||
|
||||
public void VersionCheck(final Player player) {
|
||||
|
Loading…
Reference in New Issue
Block a user