Nature's Aura

Nature's Aura

19M Downloads

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

hiimrickross opened this issue ยท 2 comments

commented

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?

commented

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

commented

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);