CleanroomMC/GroovyScript

Reload failure

zfms4188 opened this issue · 3 comments

https://pastebin.com/9xAUYUke
GroovyScript ver 1.0.1

The reload failed, but the restart game script worked

This is from the Forestry's API:

public class TreeManager {
    @Nullable
    public static ICharcoalManager charcoalManager;
    ...
}

This is from the Charcoal Pile code:

removeScripted().forEach(((CharcoalManagerAccessor) TreeManager.charcoalManager).getWalls()::remove);

So, supposedly, the NPE occurs when charcoalManager is accessed, although we're clearly checking whether Arboriculture is enabled:

    @Override
    @GroovyBlacklist
    public boolean isEnabled() {
        return ForestryAPI.moduleManager.isModuleEnabled("forestry", ForestryModuleUids.ARBORICULTURE);
    }

But I think that's not the right module because there is a separate Charcoal module:

public class ForestryModuleUids {
    public static final String APICULTURE = "apiculture";
    public static final String ARBORICULTURE = "arboriculture";
    public static final String CHARCOAL = "charcoal";
    ...
}

So this is the possible cause of the issue, going to test it now.

confirmed this being the issue as NPE occurs when charcoal module is disabled and stops occuring when AGRICULTURE is swapped to CHARCOAL

confirmed this being the issue as NPE occurs when charcoal module is disabled and stops occuring when AGRICULTURE is swapped to CHARCOAL

I reactivated it. Now reload everything fine!