diff --git a/src/main/java/com/gamingmesh/jobs/hooks/wildStacker/WildStackerHandler.java b/src/main/java/com/gamingmesh/jobs/hooks/wildStacker/WildStackerHandler.java index 5c5c5396..c116f669 100644 --- a/src/main/java/com/gamingmesh/jobs/hooks/wildStacker/WildStackerHandler.java +++ b/src/main/java/com/gamingmesh/jobs/hooks/wildStacker/WildStackerHandler.java @@ -6,19 +6,17 @@ import org.bukkit.entity.Player; import com.bgsoftware.wildstacker.api.WildStackerAPI; import com.bgsoftware.wildstacker.api.objects.StackedEntity; +import net.Zrips.CMILib.Version.Version; + public class WildStackerHandler { public int getEntityAmount(LivingEntity entity) { - if (entity instanceof Player) + if (entity instanceof Player || Version.isCurrentEqualOrHigher(Version.v1_8_R1) && entity instanceof org.bukkit.entity.ArmorStand) return 0; StackedEntity stacked = WildStackerAPI.getStackedEntity(entity); - if(stacked == null) { - return 0; - } - - return stacked.getStackAmount(); + return stacked == null ? 0 : stacked.getStackAmount(); } } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 4f823a64..2a2d3f54 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -171,10 +171,10 @@ public class JobsListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerJoin(final PlayerJoinEvent event) { - if (!Jobs.getGCManager().MultiServerCompatability()) + if (Jobs.getGCManager().MultiServerCompatability()) { + CMIScheduler.runTaskLater(() -> Jobs.getPlayerManager().playerJoin(event.getPlayer()), 40L); + } else { Jobs.getPlayerManager().playerJoin(event.getPlayer()); - else { - CMIScheduler.get().runTaskLater(() -> Jobs.getPlayerManager().playerJoin(event.getPlayer()), 40L); } }