1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

StackMobs build seems to be working

This commit is contained in:
montlikadani 2020-12-18 20:15:45 +01:00
parent 8cd5061ece
commit 89649acb9e
5 changed files with 15 additions and 18 deletions

View File

@ -195,7 +195,6 @@ public class PlayerManager {
}
jPlayer.setPaymentLimit(Jobs.getJobsDAO().getPlayersLimits(jPlayer));
jPlayer.setPoints(Jobs.getJobsDAO().getPlayerPoints(jPlayer));
}
// Lets load quest progression

View File

@ -88,7 +88,7 @@ public class HookManager {
}
private static boolean setWorldGuard() {
if (JobsHook.WorldGuard.enabled()) {
if (JobsHook.WorldGuard.isEnabled()) {
worldGuardManager = new WorldGuardManager();
Jobs.consoleMsg("&e[Jobs] WorldGuard detected.");
return true;
@ -98,7 +98,7 @@ public class HookManager {
}
private static void setMythicManager() {
if (!JobsHook.MythicMobs.enabled())
if (!JobsHook.MythicMobs.isEnabled())
return;
try {
@ -128,21 +128,21 @@ public class HookManager {
}
private static void setMyPetManager() {
if (JobsHook.MyPet.enabled()) {
if (JobsHook.MyPet.isEnabled()) {
myPetManager = new MyPetManager();
Jobs.consoleMsg("&e[Jobs] MyPet detected.");
}
}
private static void setStackMobHandler() {
if (JobsHook.StackMob.enabled()) {
if (JobsHook.StackMob.isEnabled()) {
stackMobHandler = new StackMobHandler();
}
}
private static void setWildStackerHandler() {
if (JobsHook.WildStacker.enabled()) {
if (JobsHook.WildStacker.isEnabled()) {
wildStackerHandler = new WildStackerHandler();
}
}
}
}

View File

@ -10,12 +10,12 @@ public enum JobsHook {
MythicMobs,
mcMMO;
Boolean enabled = null;
private Boolean enabled;
public boolean enabled() {
public boolean isEnabled() {
if (enabled == null) {
enabled = Jobs.getInstance().getServer().getPluginManager().getPlugin(this.name()) != null &&
Jobs.getInstance().getServer().getPluginManager().isPluginEnabled(this.name());
enabled = Jobs.getInstance().getServer().getPluginManager().getPlugin(name()) != null &&
Jobs.getInstance().getServer().getPluginManager().isPluginEnabled(name());
}
return enabled;
}

View File

@ -17,9 +17,7 @@ public class StackMobHandler extends HookPlugin {
}
public HashSet<StackEntity> getStackEntities() {
return new HashSet<>();
// waiting for the author to fix build issue
//return getPlugin().getEntityManager().getStackEntities();
return getPlugin().getEntityManager().getStackEntities();
}
@Override

View File

@ -304,7 +304,7 @@ public class JobsPaymentListener implements Listener {
if (jDamager == null || sheep.getColor() == null)
return;
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.enabled() && HookManager.getWildStackerHandler().isStackedEntity(sheep)) {
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(sheep)) {
for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) {
if (stacked.getType() == sheep.getType()) {
Jobs.action(jDamager, new CustomKillInfo(((Sheep) stacked.getLivingEntity()).getColor().name(), ActionType.SHEAR));
@ -537,7 +537,7 @@ public class JobsPaymentListener implements Listener {
if (jDamager == null)
return;
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.enabled() && HookManager.getWildStackerHandler().isStackedEntity(animal)) {
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(animal)) {
for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) {
if (stacked.getType() == animal.getType()) {
Jobs.action(jDamager, new EntityActionInfo(stacked.getLivingEntity(), ActionType.TAME));
@ -1244,7 +1244,7 @@ public class JobsPaymentListener implements Listener {
return;
}
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.enabled() && HookManager.getWildStackerHandler().isStackedEntity(lVictim)) {
if (Jobs.getGCManager().payForStackedEntities && JobsHook.WildStacker.isEnabled() && HookManager.getWildStackerHandler().isStackedEntity(lVictim)) {
for (com.bgsoftware.wildstacker.api.objects.StackedEntity stacked : HookManager.getWildStackerHandler().getStackedEntities()) {
if (stacked.getType() == lVictim.getType()) {
Jobs.action(jDamager, new EntityActionInfo(stacked.getLivingEntity(), ActionType.KILL), e.getDamager(), stacked.getLivingEntity());
@ -1582,7 +1582,7 @@ public class JobsPaymentListener implements Listener {
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.isCancelled())
return;
Player p = event.getPlayer();
if (!Jobs.getGCManager().canPerformActionInWorld(p.getWorld()))
return;