mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-06-25 22:25:08 +02:00
null checks
This commit is contained in:
parent
3311c03bc9
commit
8d9a478c66
|
@ -55,14 +55,15 @@ public class StackingTask extends BukkitRunnable {
|
||||||
|
|
||||||
nextEntity:
|
nextEntity:
|
||||||
for (Entity entityO : world.getEntities()) {
|
for (Entity entityO : world.getEntities()) {
|
||||||
if (entityO instanceof Player) continue;
|
if (entityO == null || entityO instanceof Player) continue;
|
||||||
|
|
||||||
if (entityO instanceof Item && instance.getConfig().getBoolean("Main.Stack Items")) {
|
if (entityO instanceof Item && instance.getConfig().getBoolean("Main.Stack Items")) {
|
||||||
ItemStack item = ((Item) entityO).getItemStack();
|
ItemStack item = ((Item) entityO).getItemStack();
|
||||||
|
|
||||||
if (entityO.hasMetadata("grabbed")) continue;
|
if (entityO.hasMetadata("grabbed")
|
||||||
|
|| item == null
|
||||||
if (entityO.isCustomNameVisible() && !entityO.getCustomName().contains(TextComponent.convertToInvisibleString("IS")) || item.hasItemMeta() && item.getItemMeta().hasDisplayName())
|
|| entityO.isCustomNameVisible() && !entityO.getCustomName().contains(TextComponent.convertToInvisibleString("IS"))
|
||||||
|
|| item.hasItemMeta() && item.getItemMeta().hasDisplayName())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int specific = instance.getItemFile().getConfig().getInt("Items." + item.getType().name() + ".Max Stack Size");
|
int specific = instance.getItemFile().getConfig().getInt("Items." + item.getType().name() + ".Max Stack Size");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user