1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Fix for sqlite truncate

This commit is contained in:
Zrips 2016-01-11 11:19:09 +02:00
parent d8e1896b6b
commit 11e374c0f3
4 changed files with 27 additions and 17 deletions

View File

@ -746,12 +746,18 @@ public abstract class JobsDAO {
public synchronized void saveExplore() {
if (!Jobs.getExplore().isExploreEnabled())
return;
JobsConnection conn = getConnection();
if (conn == null)
return;
try {
PreparedStatement prest = conn.prepareStatement("TRUNCATE TABLE `" + prefix + "explore`;");
PreparedStatement prest = null;
if (ConfigManager.getJobsConfiguration().storageMethod.equalsIgnoreCase("sqlite")) {
prest = conn.prepareStatement("DELETE from `" + prefix + "explore`;");
} else
prest = conn.prepareStatement("TRUNCATE TABLE `" + prefix + "explore`;");
prest.execute();
prest.close();
@ -780,7 +786,7 @@ public abstract class JobsDAO {
public synchronized void loadExplore() {
if (!Jobs.getExplore().isExploreEnabled())
return;
JobsConnection conn = getConnection();
if (conn == null)
return;

View File

@ -1098,7 +1098,7 @@ public class JobsPaymentListener implements Listener {
if (event.getEntityType() != EntityType.PRIMED_TNT && event.getEntityType() != EntityType.MINECART_TNT)
return;
double closest = 30.0;
double closest = 60.0;
Player player = null;
Location loc = event.getEntity().getLocation();
for (Player i : Bukkit.getOnlinePlayers()) {
@ -1113,7 +1113,7 @@ public class JobsPaymentListener implements Listener {
}
}
if (player == null || closest == 30.0)
if (player == null || closest == 60.0)
return;
if (!player.isOnline())

View File

@ -77,17 +77,21 @@ public class ActionBar {
if (!Jobs.actionbartoggle.containsKey(playername) && ConfigManager.getJobsConfiguration().JobsToggleEnabled)
Jobs.actionbartoggle.put(playername, true);
if (playername != null && Jobs.actionbartoggle.size() > 0)
if (Jobs.actionbartoggle.containsKey(playername)) {
Boolean show = Jobs.actionbartoggle.get(playername);
Player abp = (Player) payment.getOfflinePlayer();
if (abp != null && show) {
String Message = Language.getMessage("command.toggle.output.paid");
Message = Message.replace("[amount]", String.format("%.2f", payment.getAmount()));
Message = Message.replace("[exp]", String.format("%.2f", payment.getExp()));
ActionBar.send(abp, ChatColor.GREEN + Message);
}
}
if (playername == null)
return;
if (!Jobs.actionbartoggle.containsKey(playername))
return;
Boolean show = Jobs.actionbartoggle.get(playername);
Player abp = (Player) payment.getOfflinePlayer();
if (abp != null && show) {
String Message = Language.getMessage("command.toggle.output.paid");
Message = Message.replace("[amount]", String.format("%.2f", payment.getAmount()));
Message = Message.replace("[exp]", String.format("%.2f", payment.getExp()));
ActionBar.send(abp, ChatColor.GREEN + Message);
}
}
public static void send(Player receivingPacket, String msg) {

View File

@ -1,7 +1,7 @@
name: Jobs
description: Jobs Plugin for the BukkitAPI
main: com.gamingmesh.jobs.JobsPlugin
version: 2.59.0
version: 2.59.1
author: phrstbrn
softdepend: [Vault, CoreProtect, MythicMobs, McMMO]
commands: