mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 22:38:06 +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.WildStackerAPI;
|
||||||
import com.bgsoftware.wildstacker.api.objects.StackedEntity;
|
import com.bgsoftware.wildstacker.api.objects.StackedEntity;
|
||||||
|
|
||||||
|
import net.Zrips.CMILib.Version.Version;
|
||||||
|
|
||||||
public class WildStackerHandler {
|
public class WildStackerHandler {
|
||||||
|
|
||||||
public int getEntityAmount(LivingEntity entity) {
|
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;
|
return 0;
|
||||||
|
|
||||||
StackedEntity stacked = WildStackerAPI.getStackedEntity(entity);
|
StackedEntity stacked = WildStackerAPI.getStackedEntity(entity);
|
||||||
|
|
||||||
if(stacked == null) {
|
return stacked == null ? 0 : stacked.getStackAmount();
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stacked.getStackAmount();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,10 +171,10 @@ public class JobsListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlayerJoin(final PlayerJoinEvent event) {
|
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());
|
Jobs.getPlayerManager().playerJoin(event.getPlayer());
|
||||||
else {
|
|
||||||
CMIScheduler.get().runTaskLater(() -> Jobs.getPlayerManager().playerJoin(event.getPlayer()), 40L);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user