mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-06 16:27:59 +01:00
Fixing damage dealth to mobs caching
This commit is contained in:
parent
281542d745
commit
c8936fc653
@ -1557,6 +1557,7 @@ public abstract class JobsDAO {
|
|||||||
if (conn == null)
|
if (conn == null)
|
||||||
return false;
|
return false;
|
||||||
PreparedStatement prest = null;
|
PreparedStatement prest = null;
|
||||||
|
boolean done = true;
|
||||||
try {
|
try {
|
||||||
prest = conn.prepareStatement("DELETE FROM `" + getJobsTableName() + "` WHERE `" + JobsTableFields.userid.getCollumn() + "` = ? AND `" + JobsTableFields.jobid.getCollumn()
|
prest = conn.prepareStatement("DELETE FROM `" + getJobsTableName() + "` WHERE `" + JobsTableFields.userid.getCollumn() + "` = ? AND `" + JobsTableFields.jobid.getCollumn()
|
||||||
+ "` = ?;");
|
+ "` = ?;");
|
||||||
@ -1565,11 +1566,11 @@ public abstract class JobsDAO {
|
|||||||
prest.execute();
|
prest.execute();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return false;
|
done = false;
|
||||||
} finally {
|
} finally {
|
||||||
close(prest);
|
close(prest);
|
||||||
}
|
}
|
||||||
return true;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1093,7 +1093,7 @@ public final class JobsPaymentListener implements Listener {
|
|||||||
Jobs.action(Jobs.getPlayerManager().getJobsPlayer(player), new ItemActionInfo(event.getResult(), ActionType.SMELT));
|
Jobs.action(Jobs.getPlayerManager().getJobsPlayer(player), new ItemActionInfo(event.getResult(), ActionType.SMELT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onEntityDamageByPlayer(EntityDamageEvent event) {
|
public void onEntityDamageByPlayer(EntityDamageEvent event) {
|
||||||
if (!Jobs.getGCManager().MonsterDamageUse || !(event instanceof EntityDamageByEntityEvent)
|
if (!Jobs.getGCManager().MonsterDamageUse || !(event instanceof EntityDamageByEntityEvent)
|
||||||
|| !Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
|| !Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
||||||
@ -1120,7 +1120,7 @@ public final class JobsPaymentListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onEntityDamageByProjectile(EntityDamageByEntityEvent event) {
|
public void onEntityDamageByProjectile(EntityDamageByEntityEvent event) {
|
||||||
if (!Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
if (!Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user