mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 14:29:07 +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)
|
||||
return false;
|
||||
PreparedStatement prest = null;
|
||||
boolean done = true;
|
||||
try {
|
||||
prest = conn.prepareStatement("DELETE FROM `" + getJobsTableName() + "` WHERE `" + JobsTableFields.userid.getCollumn() + "` = ? AND `" + JobsTableFields.jobid.getCollumn()
|
||||
+ "` = ?;");
|
||||
@ -1565,11 +1566,11 @@ public abstract class JobsDAO {
|
||||
prest.execute();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
done = false;
|
||||
} finally {
|
||||
close(prest);
|
||||
}
|
||||
return true;
|
||||
return done;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1093,11 +1093,11 @@ public final class JobsPaymentListener implements Listener {
|
||||
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) {
|
||||
if (!Jobs.getGCManager().MonsterDamageUse || !(event instanceof EntityDamageByEntityEvent)
|
||||
|| !Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
||||
return;
|
||||
return;
|
||||
|
||||
Entity ent = event.getEntity();
|
||||
if (ent instanceof Player || !(ent instanceof Damageable))
|
||||
@ -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) {
|
||||
if (!Jobs.getGCManager().canPerformActionInWorld(event.getEntity().getWorld()))
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user