1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-03-02 11:21:14 +01:00

Now supports Vault 1.7.1

- Fixed NullPointerException of get lore #177
- Minor code changes
This commit is contained in:
montlikadani 2018-09-11 16:52:49 +02:00
parent e97f7d777a
commit 7240f6cb39
10 changed files with 18 additions and 25 deletions

Binary file not shown.

BIN
libs/Vault-1.7.1.jar Normal file

Binary file not shown.

View File

@ -64,7 +64,7 @@
<dependency> <dependency>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId> <artifactId>Vault</artifactId>
<version>1.6.7</version> <version>1.7.1</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>

View File

@ -22,7 +22,7 @@ import com.gamingmesh.jobs.stuff.VersionChecker.Version;
public class BossBarManager { public class BossBarManager {
Jobs plugin; private Jobs plugin;
public BossBarManager(Jobs plugin) { public BossBarManager(Jobs plugin) {
this.plugin = plugin; this.plugin = plugin;

View File

@ -136,7 +136,7 @@ public class ShopManager {
if (one.getName() != null) if (one.getName() != null)
meta.setDisplayName(one.getName()); meta.setDisplayName(one.getName());
if (one.getLore() != null) if (one.getLore() != null && !one.getLore().isEmpty())
meta.setLore(one.getLore()); meta.setLore(one.getLore());
itemStack.setItemMeta(meta); itemStack.setItemMeta(meta);

View File

@ -24,15 +24,15 @@ public class PageInfo {
} }
public int getPositionForOutput(int place) { public int getPositionForOutput(int place) {
return this.start + place + 1; return start + place + 1;
} }
private void calculate() { private void calculate() {
this.start = (this.currentPage - 1) * this.perPage; start = (currentPage - 1) * perPage;
this.end = this.start + this.perPage - 1; end = start + perPage - 1;
if (this.end + 1 > this.totalEntries) if (end + 1 > totalEntries)
this.end = this.totalEntries - 1; end = totalEntries - 1;
this.totalPages = (int) Math.ceil((double) this.totalEntries / (double) this.perPage); totalPages = (int) Math.ceil((double) totalEntries / (double) perPage);
} }
public boolean isInRange(int place) { public boolean isInRange(int place) {
@ -51,11 +51,11 @@ public class PageInfo {
} }
public boolean isPageOk() { public boolean isPageOk() {
return isPageOk(this.currentPage); return isPageOk(currentPage);
} }
public boolean isPageOk(int page) { public boolean isPageOk(int page) {
if (this.totalPages < page) if (totalPages < page)
return false; return false;
if (page < 1) if (page < 1)
return false; return false;
@ -82,6 +82,6 @@ public class PageInfo {
return totalEntries; return totalEntries;
} }
public int getPerPageCount(){ public int getPerPageCount(){
return this.perPage; return perPage;
} }
} }

View File

@ -9,10 +9,10 @@ import org.bukkit.entity.Player;
public class RawMessage { public class RawMessage {
List<String> parts = new ArrayList<>(); private List<String> parts = new ArrayList<>();
List<String> cleanParts = new ArrayList<>(); private List<String> cleanParts = new ArrayList<>();
String combined = ""; private String combined = "";
String combinedClean = ""; private String combinedClean = "";
public void clear() { public void clear() {
parts = new ArrayList<>(); parts = new ArrayList<>();

View File

@ -14,7 +14,7 @@ import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Jobs;
public class VersionChecker { public class VersionChecker {
Jobs plugin; private Jobs plugin;
private int resource = 4216; private int resource = 4216;
public VersionChecker(Jobs plugin) { public VersionChecker(Jobs plugin) {
@ -157,7 +157,7 @@ public class VersionChecker {
if (version.length() <= 9) if (version.length() <= 9)
return version; return version;
} catch (Exception ex) { } catch (Exception ex) {
plugin.getServer().getConsoleSender().sendMessage(ChatColor.RED + "Failed to check for " + plugin.getDescription().getName() + " update on spigot web page."); Jobs.consoleMsg("&cFailed to check for " + plugin.getDescription().getName() + " update on spigot web page.");
} }
return null; return null;
} }

View File

@ -35,7 +35,6 @@ public class BufferedPaymentThread extends Thread {
Jobs.consoleMsg("&e[Jobs] Started buffered payment thread."); Jobs.consoleMsg("&e[Jobs] Started buffered payment thread.");
//Jobs.getPluginLogger().info("Started buffered payment thread");
while (running) { while (running) {
try { try {
sleep(sleep); sleep(sleep);
@ -50,12 +49,10 @@ public class BufferedPaymentThread extends Thread {
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); t.printStackTrace();
Jobs.consoleMsg("&c[Jobs] Exception in BufferedPaymentThread, stopping economy payments!"); Jobs.consoleMsg("&c[Jobs] Exception in BufferedPaymentThread, stopping economy payments!");
//Jobs.getPluginLogger().severe("Exception in BufferedPaymentThread, stopping economy payments!");
running = false; running = false;
} }
} }
Jobs.consoleMsg("&e[Jobs] Buffered payment thread shutdown."); Jobs.consoleMsg("&e[Jobs] Buffered payment thread shutdown.");
//Jobs.getPluginLogger().info("Buffered payment thread shutdown");
} }
public void shutdown() { public void shutdown() {

View File

@ -32,7 +32,6 @@ public class DatabaseSaveThread extends Thread {
@Override @Override
public void run() { public void run() {
//Jobs.getPluginLogger().info("Started database save task");
Jobs.consoleMsg("&e[Jobs] Started database save task."); Jobs.consoleMsg("&e[Jobs] Started database save task.");
@ -47,7 +46,6 @@ public class DatabaseSaveThread extends Thread {
Jobs.getPlayerManager().saveAll(); Jobs.getPlayerManager().saveAll();
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); t.printStackTrace();
//Jobs.getPluginLogger().severe("Exception in DatabaseSaveTask, stopping auto save!");
Jobs.consoleMsg("&c[Jobs] Exception in DatabaseSaveTask, stopping auto save!"); Jobs.consoleMsg("&c[Jobs] Exception in DatabaseSaveTask, stopping auto save!");
running = false; running = false;
} }
@ -55,8 +53,6 @@ public class DatabaseSaveThread extends Thread {
Jobs.consoleMsg("&e[Jobs] Database save task shutdown!"); Jobs.consoleMsg("&e[Jobs] Database save task shutdown!");
//Jobs.getPluginLogger().info("Database save task shutdown");
} }
public void shutdown() { public void shutdown() {