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:
parent
e97f7d777a
commit
7240f6cb39
Binary file not shown.
BIN
libs/Vault-1.7.1.jar
Normal file
BIN
libs/Vault-1.7.1.jar
Normal file
Binary file not shown.
2
pom.xml
2
pom.xml
@ -64,7 +64,7 @@
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
<version>1.6.7</version>
|
||||
<version>1.7.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
@ -22,7 +22,7 @@ import com.gamingmesh.jobs.stuff.VersionChecker.Version;
|
||||
|
||||
public class BossBarManager {
|
||||
|
||||
Jobs plugin;
|
||||
private Jobs plugin;
|
||||
|
||||
public BossBarManager(Jobs plugin) {
|
||||
this.plugin = plugin;
|
||||
|
@ -136,7 +136,7 @@ public class ShopManager {
|
||||
if (one.getName() != null)
|
||||
meta.setDisplayName(one.getName());
|
||||
|
||||
if (one.getLore() != null)
|
||||
if (one.getLore() != null && !one.getLore().isEmpty())
|
||||
meta.setLore(one.getLore());
|
||||
itemStack.setItemMeta(meta);
|
||||
|
||||
|
@ -24,15 +24,15 @@ public class PageInfo {
|
||||
}
|
||||
|
||||
public int getPositionForOutput(int place) {
|
||||
return this.start + place + 1;
|
||||
return start + place + 1;
|
||||
}
|
||||
|
||||
private void calculate() {
|
||||
this.start = (this.currentPage - 1) * this.perPage;
|
||||
this.end = this.start + this.perPage - 1;
|
||||
if (this.end + 1 > this.totalEntries)
|
||||
this.end = this.totalEntries - 1;
|
||||
this.totalPages = (int) Math.ceil((double) this.totalEntries / (double) this.perPage);
|
||||
start = (currentPage - 1) * perPage;
|
||||
end = start + perPage - 1;
|
||||
if (end + 1 > totalEntries)
|
||||
end = totalEntries - 1;
|
||||
totalPages = (int) Math.ceil((double) totalEntries / (double) perPage);
|
||||
}
|
||||
|
||||
public boolean isInRange(int place) {
|
||||
@ -51,11 +51,11 @@ public class PageInfo {
|
||||
}
|
||||
|
||||
public boolean isPageOk() {
|
||||
return isPageOk(this.currentPage);
|
||||
return isPageOk(currentPage);
|
||||
}
|
||||
|
||||
public boolean isPageOk(int page) {
|
||||
if (this.totalPages < page)
|
||||
if (totalPages < page)
|
||||
return false;
|
||||
if (page < 1)
|
||||
return false;
|
||||
@ -82,6 +82,6 @@ public class PageInfo {
|
||||
return totalEntries;
|
||||
}
|
||||
public int getPerPageCount(){
|
||||
return this.perPage;
|
||||
return perPage;
|
||||
}
|
||||
}
|
@ -9,10 +9,10 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class RawMessage {
|
||||
|
||||
List<String> parts = new ArrayList<>();
|
||||
List<String> cleanParts = new ArrayList<>();
|
||||
String combined = "";
|
||||
String combinedClean = "";
|
||||
private List<String> parts = new ArrayList<>();
|
||||
private List<String> cleanParts = new ArrayList<>();
|
||||
private String combined = "";
|
||||
private String combinedClean = "";
|
||||
|
||||
public void clear() {
|
||||
parts = new ArrayList<>();
|
||||
|
@ -14,7 +14,7 @@ import org.bukkit.entity.Player;
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
|
||||
public class VersionChecker {
|
||||
Jobs plugin;
|
||||
private Jobs plugin;
|
||||
private int resource = 4216;
|
||||
|
||||
public VersionChecker(Jobs plugin) {
|
||||
@ -157,7 +157,7 @@ public class VersionChecker {
|
||||
if (version.length() <= 9)
|
||||
return version;
|
||||
} 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;
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ public class BufferedPaymentThread extends Thread {
|
||||
|
||||
Jobs.consoleMsg("&e[Jobs] Started buffered payment thread.");
|
||||
|
||||
//Jobs.getPluginLogger().info("Started buffered payment thread");
|
||||
while (running) {
|
||||
try {
|
||||
sleep(sleep);
|
||||
@ -50,12 +49,10 @@ public class BufferedPaymentThread extends Thread {
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
Jobs.consoleMsg("&c[Jobs] Exception in BufferedPaymentThread, stopping economy payments!");
|
||||
//Jobs.getPluginLogger().severe("Exception in BufferedPaymentThread, stopping economy payments!");
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
Jobs.consoleMsg("&e[Jobs] Buffered payment thread shutdown.");
|
||||
//Jobs.getPluginLogger().info("Buffered payment thread shutdown");
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
|
@ -32,7 +32,6 @@ public class DatabaseSaveThread extends Thread {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
//Jobs.getPluginLogger().info("Started database save task");
|
||||
|
||||
Jobs.consoleMsg("&e[Jobs] Started database save task.");
|
||||
|
||||
@ -47,7 +46,6 @@ public class DatabaseSaveThread extends Thread {
|
||||
Jobs.getPlayerManager().saveAll();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
//Jobs.getPluginLogger().severe("Exception in DatabaseSaveTask, stopping auto save!");
|
||||
Jobs.consoleMsg("&c[Jobs] Exception in DatabaseSaveTask, stopping auto save!");
|
||||
running = false;
|
||||
}
|
||||
@ -55,8 +53,6 @@ public class DatabaseSaveThread extends Thread {
|
||||
|
||||
Jobs.consoleMsg("&e[Jobs] Database save task shutdown!");
|
||||
|
||||
//Jobs.getPluginLogger().info("Database save task shutdown");
|
||||
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
|
Loading…
Reference in New Issue
Block a user