Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsure if serious or not, getting a number of repeated naturesaura recipe(?) big error traces in log #344

Open
hiimrickross opened this issue Feb 1, 2024 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@hiimrickross
Copy link

hi, while looking thru logs / hunting crashes for other things, i noticed there is big sections of recipe failures for naturesaura in there.
sophisticatednaturesalexcaves.txt

is this inconsequential, or might cause problems?

@Ellpeck Ellpeck added bug Something isn't working question Further information is requested labels Mar 7, 2024
@Ellpeck
Copy link
Owner

Ellpeck commented Mar 7, 2024

Hi! Does this also happen with just Nature's Aura and Patchouli installed?

@AndreAugustoDev
Copy link

This issue might be caused by these functions above
The JEINaturesAuraPlugin.registerItemSubtypes#registration.registerSubtypeInterpreter definition doesn't check if the return value of getEffect can be null.
The return value of ItemEffectPowder.getEffect can indeed be null.
JEINaturesAuraPlugin.registerItemSubtypes#registration.registerSubtypeInterpreter doesn't know how to correct handle a null return value.
It seems that the return value of ItemEffectPowder.getEffect is null, and JEINaturesAuraPlugin.registerItemSubtypes#registration.registerSubtypeInterpreter is unable to process this.

public static ResourceLocation getEffect(ItemStack stack) {
if (!stack.hasTag())
return null;
var effect = stack.getTag().getString("effect");
if (effect.isEmpty())
return null;
return new ResourceLocation(effect);
}

@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
registration.registerSubtypeInterpreter(VanillaTypes.ITEM_STACK, ModItems.EFFECT_POWDER, (stack, context) -> ItemEffectPowder.getEffect(stack).toString());
registration.registerSubtypeInterpreter(VanillaTypes.ITEM_STACK, ModItems.AURA_BOTTLE, (stack, context) -> ItemAuraBottle.getType(stack).getName().toString());
var auraInterpreter = (IIngredientSubtypeInterpreter<ItemStack>) (stack, context) -> {
var container = stack.getCapability(NaturesAuraAPI.AURA_CONTAINER_ITEM_CAPABILITY);
if (container != null)
return String.valueOf(container.getStoredAura());
return IIngredientSubtypeInterpreter.NONE;
};
registration.registerSubtypeInterpreter(VanillaTypes.ITEM_STACK, ModItems.AURA_CACHE, auraInterpreter);
registration.registerSubtypeInterpreter(VanillaTypes.ITEM_STACK, ModItems.AURA_TROVE, auraInterpreter);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants