mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-20 07:01:22 +01:00
Fix for TNTBreak action not works when entity type is not ender crystal
Fixes #912
This commit is contained in:
parent
e52e954843
commit
08e4893e81
@ -363,9 +363,6 @@ public class editjobs implements Cmd {
|
||||
meta = keyValue.getMeta();
|
||||
int id = keyValue.getId();
|
||||
|
||||
if (actionT == ActionType.TNTBREAK)
|
||||
Jobs.getGCManager().setTntFinder(true);
|
||||
|
||||
double income = 0D,
|
||||
points = 0D,
|
||||
experience = 0D;
|
||||
|
@ -627,6 +627,9 @@ public class ConfigManager {
|
||||
type = CMIMaterial.getGeneralMaterialName(type);
|
||||
}
|
||||
|
||||
if (actionType == ActionType.TNTBREAK)
|
||||
Jobs.getGCManager().setTntFinder(true);
|
||||
|
||||
KeyValues kv = new KeyValues();
|
||||
kv.setId(id);
|
||||
kv.setMeta(meta);
|
||||
@ -1210,9 +1213,6 @@ public class ConfigManager {
|
||||
subType = keyValue.getSubType(),
|
||||
meta = keyValue.getMeta();
|
||||
|
||||
if (actionType == ActionType.TNTBREAK)
|
||||
Jobs.getGCManager().setTntFinder(true);
|
||||
|
||||
double income = section.getDouble("income", 0.0);
|
||||
income = updateValue(CurrencyType.MONEY, income);
|
||||
double points = section.getDouble("points", 0.0);
|
||||
|
@ -1509,7 +1509,7 @@ public class JobsPaymentListener implements Listener {
|
||||
if (type != EntityType.PRIMED_TNT && type != EntityType.MINECART_TNT && type != CMIEntityType.ENDER_CRYSTAL.getType())
|
||||
return;
|
||||
|
||||
if (!Jobs.getGCManager().isUseTntFinder() || type != CMIEntityType.ENDER_CRYSTAL.getType())
|
||||
if (!Jobs.getGCManager().isUseTntFinder() && type != CMIEntityType.ENDER_CRYSTAL.getType())
|
||||
return;
|
||||
|
||||
double closest = 60.0;
|
||||
@ -1541,13 +1541,15 @@ public class JobsPaymentListener implements Listener {
|
||||
if (jPlayer == null)
|
||||
return;
|
||||
|
||||
String meta = "enderCrystalDamage";
|
||||
if (type == CMIEntityType.ENDER_CRYSTAL.getType() && e.hasMetadata(meta) && !e.getMetadata(meta).isEmpty()) {
|
||||
Entity killed = (Entity) e.getMetadata(meta).get(0).value();
|
||||
if (killed != null) {
|
||||
Jobs.action(jPlayer, new EntityActionInfo(killed, ActionType.KILL));
|
||||
killed.removeMetadata(meta, plugin);
|
||||
return;
|
||||
if (!Jobs.getGCManager().isUseTntFinder() && type == CMIEntityType.ENDER_CRYSTAL.getType()) {
|
||||
String meta = "enderCrystalDamage";
|
||||
if (type == CMIEntityType.ENDER_CRYSTAL.getType() && e.hasMetadata(meta) && !e.getMetadata(meta).isEmpty()) {
|
||||
Entity killed = (Entity) e.getMetadata(meta).get(0).value();
|
||||
if (killed != null) {
|
||||
Jobs.action(jPlayer, new EntityActionInfo(killed, ActionType.KILL));
|
||||
killed.removeMetadata(meta, plugin);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user