mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-30 21:07:48 +01:00
Special exception for armor stands in wildstacker
This commit is contained in:
parent
757d621e0d
commit
30ca00073f
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user