1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 04:25:15 +01:00

Re-add StackMob support

Temporary it is solved by using flat-jar until the repository is inaccessible.

- Fixed the ordering of shop items
This commit is contained in:
montlikadani 2021-04-02 15:14:03 +02:00
parent 22f985aa88
commit 7e5ab9bb9c
18 changed files with 119 additions and 78 deletions

BIN
libs/StackMob-5.5.3.jar Normal file

Binary file not shown.

View File

@ -156,6 +156,10 @@
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId> <artifactId>log4j-slf4j-impl</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- PlaceholderAPI --> <!-- PlaceholderAPI -->
@ -187,8 +191,9 @@
<dependency> <dependency>
<groupId>com.github.Nathat23</groupId> <groupId>com.github.Nathat23</groupId>
<artifactId>StackMob-5</artifactId> <artifactId>StackMob-5</artifactId>
<version>master-SNAPSHOT</version> <version>5.5.3</version>
<scope>provided</scope> <scope>system</scope>
<systemPath>${basedir}/libs/StackMob-5.5.3.jar</systemPath>
</dependency> </dependency>
<!-- MyPet --> <!-- MyPet -->
<dependency> <dependency>

View File

@ -111,6 +111,25 @@ public class ItemBoostManager {
if (one.equalsIgnoreCase("exampleBoost")) if (one.equalsIgnoreCase("exampleBoost"))
continue; continue;
List<Job> jobs = new ArrayList<>();
for (String oneJ : cfg.get(one + ".jobs", Arrays.asList(""))) {
if (oneJ.equalsIgnoreCase("all")) {
jobs.addAll(Jobs.getJobs());
} else {
Job job = Jobs.getJob(oneJ);
if (job != null) {
jobs.add(job);
} else {
Jobs.getPluginLogger().warning("Cant determine job by " + oneJ + " name for " + one + " boosted item!");
}
}
}
if (jobs.isEmpty()) {
Jobs.getPluginLogger().warning("Jobs list is empty for " + one + " boosted item!");
continue;
}
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
if (cfg.getC().isList(one + ".lore")) { if (cfg.getC().isList(one + ".lore")) {
for (String eachLine : cfg.get(one + ".lore", Arrays.asList(""))) { for (String eachLine : cfg.get(one + ".lore", Arrays.asList(""))) {
@ -143,25 +162,6 @@ public class ItemBoostManager {
b.add(oneC, cfg.get(one + "." + typeName + "Boost", 1D) - 1); b.add(oneC, cfg.get(one + "." + typeName + "Boost", 1D) - 1);
} }
List<Job> jobs = new ArrayList<>();
for (String oneJ : cfg.get(one + ".jobs", Arrays.asList(""))) {
if (oneJ.equalsIgnoreCase("all")) {
jobs.addAll(Jobs.getJobs());
} else {
Job job = Jobs.getJob(oneJ);
if (job != null) {
jobs.add(job);
} else {
Jobs.getPluginLogger().warning("Cant determine job by " + oneJ + " name for " + one + " boosted item!");
}
}
}
if (jobs.isEmpty()) {
Jobs.getPluginLogger().warning("Jobs list is empty for " + one + " boosted item!");
continue;
}
CMIMaterial mat = cfg.getC().isString(one + ".id") ? CMIMaterial.get(cfg.get(one + ".id", "Stone")) : null; CMIMaterial mat = cfg.getC().isString(one + ".id") ? CMIMaterial.get(cfg.get(one + ".id", "Stone")) : null;
String name = cfg.getC().isString(one + ".name") ? cfg.get(one + ".name", "") : null; String name = cfg.getC().isString(one + ".name") ? cfg.get(one + ".name", "") : null;
@ -181,7 +181,7 @@ public class ItemBoostManager {
// Lets add into legacy map // Lets add into legacy map
if (one.contains("_")) { if (one.contains("_")) {
item.setLegacyKey(one.split("_")[1].toLowerCase()); item.setLegacyKey(one.split("_", 2)[1].toLowerCase());
LEGACY.put(item.getLegacyKey(), item); LEGACY.put(item.getLegacyKey(), item);
} }

View File

@ -374,17 +374,17 @@ public class Placeholder {
} }
private static JobProgression getProgFromValue(JobsPlayer user, String value) { private static JobProgression getProgFromValue(JobsPlayer user, String value) {
JobProgression j = null;
try { try {
int id = Integer.parseInt(value); int id = Integer.parseInt(value);
if (id > 0) if (id > 0)
j = user.getJobProgression().get(id - 1); return user.getJobProgression().get(id - 1);
} catch (Exception e) { } catch (IndexOutOfBoundsException | NumberFormatException e) {
Job job = Jobs.getJob(value); Job job = Jobs.getJob(value);
if (job != null) if (job != null)
j = user.getJobProgression(job); return user.getJobProgression(job);
} }
return j;
return null;
} }
private static Job getJobFromValue(String value) { private static Job getJobFromValue(String value) {

View File

@ -337,6 +337,7 @@ public class PlayerManager {
for (JobProgression oneJ : jPlayer.getJobProgression()) for (JobProgression oneJ : jPlayer.getJobProgression())
dao.insertJob(jPlayer, oneJ); dao.insertJob(jPlayer, oneJ);
dao.saveLog(jPlayer); dao.saveLog(jPlayer);
dao.savePoints(jPlayer); dao.savePoints(jPlayer);
dao.recordPlayersLimits(jPlayer); dao.recordPlayersLimits(jPlayer);
@ -850,13 +851,16 @@ public class PlayerManager {
if (cmd.contains(":")) { if (cmd.contains(":")) {
String[] split = cmd.split(":", 2); String[] split = cmd.split(":", 2);
String command = split[1]; String command = "";
if (split.length > 1) {
command = split[1];
command = command.replace("[playerName]", player.getName()); command = command.replace("[playerName]", player.getName());
command = command.replace("[job]", job.getName()); command = command.replace("[job]", job.getName());
}
if (split[0].equalsIgnoreCase("player:")) { if (split[0].equalsIgnoreCase("player:")) {
player.performCommand(command); player.performCommand(command);
} else if (split[0].equalsIgnoreCase("console:")) { } else {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
} }
} else { } else {
@ -1108,7 +1112,7 @@ public class PlayerManager {
boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay)); boost.add(BoostOf.PetPay, new BoostMultiplier().add(petPay));
} }
if (victim != null && victim.hasMetadata(getMobSpawnerMetadata())) { if (victim != null && victim.hasMetadata(mobSpawnerMetadata)) {
Double amount = Jobs.getPermissionManager().getMaxPermission(player, "jobs.nearspawner", false, false); Double amount = Jobs.getPermissionManager().getMaxPermission(player, "jobs.nearspawner", false, false);
if (amount != 0D) if (amount != 0D)
boost.add(BoostOf.NearSpawner, new BoostMultiplier().add(amount)); boost.add(BoostOf.NearSpawner, new BoostMultiplier().add(amount));

View File

@ -138,9 +138,12 @@ public class jobsSign {
} }
public String getIdentifier() { public String getIdentifier() {
if (getType() != SignTopType.toplist) SignTopType type = getType();
return getType().toString();
return jobName != null ? jobName + ":" + getType().toString() : getType().toString(); if (type != SignTopType.toplist)
return type.toString();
return jobName != null ? jobName + ":" + type.toString() : type.toString();
} }
public static String getIdentifier(Job job, SignTopType type) { public static String getIdentifier(Job job, SignTopType type) {

View File

@ -25,27 +25,28 @@ public class area implements Cmd {
Player player = (Player) sender; Player player = (Player) sender;
RestrictedAreaManager ra = Jobs.getRestrictedAreaManager();
if (args.length == 3) { if (args.length == 3) {
if (args[0].equalsIgnoreCase("add")) { if (args[0].equalsIgnoreCase("add")) {
if (!Jobs.hasPermission(player, "jobs.area.add", true)) if (!Jobs.hasPermission(player, "jobs.area.add", true))
return true; return true;
String name = args[1];
double bonus = 0D; double bonus = 0D;
try { try {
bonus = Double.parseDouble(args[2]); bonus = Double.parseDouble(args[2]);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return false; return false;
} }
boolean wg = false; boolean wg = false;
String name = args[1];
if (name.startsWith("wg:")) { if (name.startsWith("wg:")) {
wg = true; wg = true;
name = name.substring("wg:".length(), name.length()); name = name.substring("wg:".length(), name.length());
} }
RestrictedAreaManager ra = Jobs.getRestrictedAreaManager();
if (ra.isExist(name)) { if (ra.isExist(name)) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.area.output.exist")); sender.sendMessage(Jobs.getLanguage().getMessage("command.area.output.exist"));
return true; return true;
@ -78,6 +79,7 @@ public class area implements Cmd {
if (!Jobs.hasPermission(player, "jobs.area.remove", true)) if (!Jobs.hasPermission(player, "jobs.area.remove", true))
return true; return true;
RestrictedAreaManager ra = Jobs.getRestrictedAreaManager();
String name = args[1]; String name = args[1];
if (!ra.isExist(name)) { if (!ra.isExist(name)) {

View File

@ -421,7 +421,7 @@ public class editjobs implements Cmd {
String materialName = jInfo.getName().toLowerCase().replace('_', ' '); String materialName = jInfo.getName().toLowerCase().replace('_', ' ');
materialName = Character.toUpperCase(materialName.charAt(0)) + materialName.substring(1); materialName = Character.toUpperCase(materialName.charAt(0)) + materialName.substring(1);
materialName = Jobs.getNameTranslatorManager().Translate(materialName, jInfo); materialName = Jobs.getNameTranslatorManager().translate(materialName, jInfo);
materialName = CMIChatColor.translate(materialName); materialName = CMIChatColor.translate(materialName);
rm.addText(Jobs.getLanguage().getMessage("command.editjobs.help.list.material", "%materialname%", jInfo.getName())) rm.addText(Jobs.getLanguage().getMessage("command.editjobs.help.list.material", "%materialname%", jInfo.getName()))

View File

@ -133,7 +133,7 @@ public class editquests implements Cmd {
String objName = target.toLowerCase().replace('_', ' '); String objName = target.toLowerCase().replace('_', ' ');
objName = Character.toUpperCase(objName.charAt(0)) + objName.substring(1); objName = Character.toUpperCase(objName.charAt(0)) + objName.substring(1);
if (o != null) if (o != null)
objName = Jobs.getNameTranslatorManager().Translate(objName, o.getAction(), o.getTargetId(), objName = Jobs.getNameTranslatorManager().translate(objName, o.getAction(), o.getTargetId(),
o.getTargetMeta(), target); o.getTargetMeta(), target);
objName = org.bukkit.ChatColor.translateAlternateColorCodes('&', objName); objName = org.bukkit.ChatColor.translateAlternateColorCodes('&', objName);

View File

@ -105,7 +105,7 @@ public class quests implements Cmd {
for (java.util.Map<String, QuestObjective> oneAction : q.getQuest().getObjectives().values()) { for (java.util.Map<String, QuestObjective> oneAction : q.getQuest().getObjectives().values()) {
for (Entry<String, QuestObjective> oneObjective : oneAction.entrySet()) { for (Entry<String, QuestObjective> oneObjective : oneAction.entrySet()) {
hoverList.add(Jobs.getLanguage().getMessage("command.info.output." + oneObjective.getValue().getAction().toString().toLowerCase() + ".info") + " " + hoverList.add(Jobs.getLanguage().getMessage("command.info.output." + oneObjective.getValue().getAction().toString().toLowerCase() + ".info") + " " +
Jobs.getNameTranslatorManager().Translate(oneObjective.getKey(), oneObjective.getValue().getAction(), oneObjective.getValue().getTargetId(), oneObjective.getValue() Jobs.getNameTranslatorManager().translate(oneObjective.getKey(), oneObjective.getValue().getAction(), oneObjective.getValue().getTargetId(), oneObjective.getValue()
.getTargetMeta(), oneObjective.getValue().getTargetName()) .getTargetMeta(), oneObjective.getValue().getTargetName())
+ " " + q.getAmountDone(oneObjective.getValue()) + "/" + " " + q.getAmountDone(oneObjective.getValue()) + "/"
+ oneObjective.getValue().getAmount()); + oneObjective.getValue().getAmount());

View File

@ -25,11 +25,11 @@ public class NameTranslatorManager {
private final List<NameList> ListOfEntities = new ArrayList<>(), ListOfColors = new ArrayList<>(); private final List<NameList> ListOfEntities = new ArrayList<>(), ListOfColors = new ArrayList<>();
private final Map<String, NameList> ListOfEnchants = new HashMap<>(), ListOfMMEntities = new HashMap<>(); private final Map<String, NameList> ListOfEnchants = new HashMap<>(), ListOfMMEntities = new HashMap<>();
public String Translate(String materialName, JobInfo info) { public String translate(String materialName, JobInfo info) {
return Translate(materialName, info.getActionType(), info.getId(), info.getMeta(), info.getName()); return translate(materialName, info.getActionType(), info.getId(), info.getMeta(), info.getName());
} }
public String Translate(String materialName, ActionType action, Integer id, String meta, String name) { public String translate(String materialName, ActionType action, Integer id, String meta, String name) {
// Translating name to user friendly // Translating name to user friendly
if (Jobs.getGCManager().UseCustomNames) if (Jobs.getGCManager().UseCustomNames)
switch (action) { switch (action) {

View File

@ -321,7 +321,7 @@ public class ShopManager {
int i = 0; int i = 0;
int y = 1; int y = 1;
for (String category : new java.util.HashSet<>(categories)) { for (String category : new ArrayList<>(categories)) {
ConfigurationSection nameSection = confCategory.getConfigurationSection(category); ConfigurationSection nameSection = confCategory.getConfigurationSection(category);
if (nameSection == null) { if (nameSection == null) {
continue; continue;
@ -372,12 +372,12 @@ public class ShopManager {
sItem.setRequiredTotalLevels(nameSection.getInt("RequiredTotalLevels")); sItem.setRequiredTotalLevels(nameSection.getInt("RequiredTotalLevels"));
if (nameSection.isList("RequiredJobLevels")) { if (nameSection.isList("RequiredJobLevels")) {
HashMap<String, Integer> requiredJobs = new HashMap<>(); Map<String, Integer> requiredJobs = new HashMap<>();
for (String one : nameSection.getStringList("RequiredJobLevels")) { for (String one : nameSection.getStringList("RequiredJobLevels")) {
if (!one.contains("-")) if (!one.contains("-"))
continue; continue;
String[] split = one.split("-"); String[] split = one.split("-", 2);
String job = split[0]; String job = split[0];
int lvl = 1; int lvl = 1;
if (split.length > 1) { if (split.length > 1) {
@ -430,7 +430,7 @@ public class ShopManager {
if (!eachLine.contains("=")) if (!eachLine.contains("="))
continue; continue;
String[] split = eachLine.split("="); String[] split = eachLine.split("=", 2);
Enchantment ench = CMIEnchantment.getEnchantment(split[0]); Enchantment ench = CMIEnchantment.getEnchantment(split[0]);
Integer level = 1; Integer level = 1;
if (split.length > 1) { if (split.length > 1) {

View File

@ -543,10 +543,6 @@ public class Job {
this.quests.addAll(quests == null ? new ArrayList<>() : quests); this.quests.addAll(quests == null ? new ArrayList<>() : quests);
} }
// public Quest getNextQuest() {
// return getNextQuest(null, null);
// }
public Quest getNextQuest(List<String> excludeQuests, Integer level) { public Quest getNextQuest(List<String> excludeQuests, Integer level) {
List<Quest> ls = new ArrayList<>(quests); List<Quest> ls = new ArrayList<>(quests);
Collections.shuffle(ls); Collections.shuffle(ls);

View File

@ -35,30 +35,34 @@ public class JobConditions {
this.node = node; this.node = node;
for (String one : requires) { for (String one : requires) {
if (one.toLowerCase().contains("j:")) { String cond = one.toLowerCase();
String jobName = one.toLowerCase().replace("j:", "").split("-")[0];
if (cond.contains("j:")) {
String[] split = cond.replace("j:", "").split("-", 2);
int jobLevel = 0; int jobLevel = 0;
try { try {
jobLevel = Integer.valueOf(one.toLowerCase().replace("j:", "").split("-")[1]); jobLevel = Integer.valueOf(split[1]);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
continue; continue;
} }
requiresJobs.put(jobName, jobLevel); requiresJobs.put(split[0], jobLevel);
} }
if (one.toLowerCase().contains("p:")) { if (cond.contains("p:")) {
requiresPerm.add(one.replace("p:", "")); requiresPerm.add(one.replace("p:", ""));
} }
} }
for (String one : perform) { for (String one : perform) {
if (!one.toLowerCase().contains("p:")) one = one.toLowerCase();
if (!one.contains("p:"))
continue; continue;
String clean = one.toLowerCase().substring("p:".length()); String clean = one.substring("p:".length());
if (clean.contains("-")) { if (clean.contains("-")) {
String[] split = clean.split("-"); String[] split = clean.split("-", 2);
performPerm.put(split[0], split[1].equalsIgnoreCase("true")); performPerm.put(split[0], split[1].equalsIgnoreCase("true"));
} else { } else {
performPerm.put(clean, true); performPerm.put(clean, true);

View File

@ -77,9 +77,9 @@ public class JobInfo {
} }
public String getRealisticName() { public String getRealisticName() {
String materialName = getName().toLowerCase().replace('_', ' '); String materialName = name.toLowerCase().replace('_', ' ');
materialName = Character.toUpperCase(materialName.charAt(0)) + materialName.substring(1); materialName = Character.toUpperCase(materialName.charAt(0)) + materialName.substring(1);
materialName = Jobs.getNameTranslatorManager().Translate(actionType == ActionType.MMKILL ? getName() : materialName, this); materialName = Jobs.getNameTranslatorManager().translate(actionType == ActionType.MMKILL ? name : materialName, this);
materialName = CMIChatColor.translate(materialName); materialName = CMIChatColor.translate(materialName);
return materialName; return materialName;
} }

View File

@ -165,7 +165,8 @@ public class BlockOwnerShip {
} }
public int getTotal(UUID uuid) { public int getTotal(UUID uuid) {
return blockOwnerShips.getOrDefault(uuid, new ArrayList<>()).size(); List<blockLoc> list = blockOwnerShips.get(uuid);
return list == null ? 0 : list.size();
} }
public void load() { public void load() {
@ -192,12 +193,13 @@ public class BlockOwnerShip {
for (String one : section.getKeys(false)) { for (String one : section.getKeys(false)) {
String value = section.getString(one); String value = section.getString(one);
List<String> ls = new ArrayList<>(); List<String> ls = new ArrayList<>();
if (value.contains(";")) if (value.contains(";"))
ls.addAll(Arrays.asList(value.split(";"))); ls.addAll(Arrays.asList(value.split(";")));
else else
ls.add(value); ls.add(value);
UUID uuid = null; UUID uuid;
try { try {
uuid = UUID.fromString(one); uuid = UUID.fromString(one);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
@ -255,6 +257,7 @@ public class BlockOwnerShip {
for (Map.Entry<UUID, List<blockLoc>> one : blockOwnerShips.entrySet()) { for (Map.Entry<UUID, List<blockLoc>> one : blockOwnerShips.entrySet()) {
String full = ""; String full = "";
for (blockLoc oneL : one.getValue()) { for (blockLoc oneL : one.getValue()) {
if (!full.isEmpty()) if (!full.isEmpty())
full += ";"; full += ";";

View File

@ -1,6 +1,6 @@
package com.gamingmesh.jobs.hooks.stackMob; package com.gamingmesh.jobs.hooks.stackMob;
import java.util.HashSet; import java.util.Collection;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -16,7 +16,7 @@ public class StackMobHandler extends HookPlugin {
return getPlugin().getEntityManager().isStackedEntity(entity); return getPlugin().getEntityManager().isStackedEntity(entity);
} }
public HashSet<StackEntity> getStackEntities() { public Collection<StackEntity> getStackEntities() {
return getPlugin().getEntityManager().getStackEntities(); return getPlugin().getEntityManager().getStackEntities();
} }

View File

@ -303,12 +303,20 @@ public class JobsPaymentListener implements Listener {
if (jDamager == null || sheep.getColor() == null) if (jDamager == null || sheep.getColor() == null)
return; return;
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(sheep)) { if (Jobs.getGCManager().payForStackedEntities) {
if (JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(sheep)) {
for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) { for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) {
if (stacked.getType() == sheep.getType()) { if (stacked.getType() == sheep.getType()) {
Jobs.action(jDamager, new CustomKillInfo(((Sheep) stacked.getLivingEntity()).getColor().name(), ActionType.SHEAR)); Jobs.action(jDamager, new CustomKillInfo(((Sheep) stacked.getLivingEntity()).getColor().name(), ActionType.SHEAR));
} }
} }
} else if (JobsHook.StackMob.isEnabled() && HookManager.getStackMobHandler().isStacked(sheep)) {
for (uk.antiperson.stackmob.entity.StackEntity stacked : HookManager.getStackMobHandler().getStackEntities()) {
if (stacked.getEntity().getType() == sheep.getType()) {
Jobs.action(jDamager, new CustomKillInfo(((Sheep) stacked.getEntity()).getColor().name(), ActionType.SHEAR));
}
}
}
} }
Jobs.action(jDamager, new CustomKillInfo(sheep.getColor().name(), ActionType.SHEAR)); Jobs.action(jDamager, new CustomKillInfo(sheep.getColor().name(), ActionType.SHEAR));
@ -537,12 +545,20 @@ public class JobsPaymentListener implements Listener {
if (jDamager == null) if (jDamager == null)
return; return;
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(animal)) { if (Jobs.getGCManager().payForStackedEntities) {
if (JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(animal)) {
for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) { for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) {
if (stacked.getType() == animal.getType()) { if (stacked.getType() == animal.getType()) {
Jobs.action(jDamager, new EntityActionInfo(stacked.getLivingEntity(), ActionType.TAME)); Jobs.action(jDamager, new EntityActionInfo(stacked.getLivingEntity(), ActionType.TAME));
} }
} }
} else if (JobsHook.StackMob.isEnabled() && HookManager.getStackMobHandler().isStacked(animal)) {
for (uk.antiperson.stackmob.entity.StackEntity stacked : HookManager.getStackMobHandler().getStackEntities()) {
if (stacked.getEntity().getType() == animal.getType()) {
Jobs.action(jDamager, new EntityActionInfo(stacked.getEntity(), ActionType.TAME));
}
}
}
} }
Jobs.action(jDamager, new EntityActionInfo(animal, ActionType.TAME)); Jobs.action(jDamager, new EntityActionInfo(animal, ActionType.TAME));
@ -1230,12 +1246,20 @@ public class JobsPaymentListener implements Listener {
return; return;
} }
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(lVictim)) { if (Jobs.getGCManager().payForStackedEntities) {
if (JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(lVictim)) {
for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) { for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) {
if (stacked.getType() == lVictim.getType()) { if (stacked.getType() == lVictim.getType()) {
Jobs.action(jDamager, new EntityActionInfo(stacked.getLivingEntity(), ActionType.KILL), e.getDamager(), stacked.getLivingEntity()); Jobs.action(jDamager, new EntityActionInfo(stacked.getLivingEntity(), ActionType.KILL), e.getDamager(), stacked.getLivingEntity());
} }
} }
} else if (JobsHook.StackMob.isEnabled() && HookManager.getStackMobHandler().isStacked(lVictim)) {
for (uk.antiperson.stackmob.entity.StackEntity stacked : HookManager.getStackMobHandler().getStackEntities()) {
if (stacked.getEntity().getType() == lVictim.getType()) {
Jobs.action(jDamager, new EntityActionInfo(stacked.getEntity(), ActionType.KILL), e.getDamager(), stacked.getEntity());
}
}
}
} }
Jobs.action(jDamager, new EntityActionInfo(lVictim, ActionType.KILL), e.getDamager(), lVictim); Jobs.action(jDamager, new EntityActionInfo(lVictim, ActionType.KILL), e.getDamager(), lVictim);