public static @Nullable CapturedMob create(@Nullable NBTTagCompound nbt) { if (nbt != null && containsSoul(nbt)) { return new CapturedMob(nbt); } else { return null; } }
@SuppressWarnings("null") public static @Nullable CapturedMob create(@Nonnull ItemStack stack) { if (containsSoul(stack)) { return new CapturedMob(stack.getTagCompound()); } else { return null; } }
public static @Nullable CapturedMob create(@Nullable Entity entity) { if (!(entity instanceof EntityLivingBase) || !entity.isEntityAlive() || entity.world.isRemote || entity instanceof EntityPlayer || isBlacklisted(entity)) { return null; } return new CapturedMob((EntityLivingBase) entity); }
public static @Nullable CapturedMob create(@Nullable ResourceLocation entityId) { if (entityId == null || !EntityList.isRegistered(entityId) || !EntityUtil.isRegisteredMob(entityId)) { return null; } return new CapturedMob(entityId); }