MineColonies

MineColonies

53M Downloads

On LootTable Load Event, all loot tables set to null. No blocks drop

eractnod opened this issue ยท 1 comments

commented

Prerequisites

  • [x ] I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
  • [x ] I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
  • [x ] I made sure that this issue is not a duplicate of any existing issue.

Context

  • Minecraft Version: 1.16.3
  • MineColonies Version: minecolonies0.13.360-BETA-universal.jar
  • Structurize Version: structurize-0.13.92-ALPHA-universal.jar
  • Related Mods and their Versions: Ediblebugs 1.1.05_MC1.16.3.jar

Expected behavior

Normal block drops when block harvested.

Actual behavior

No blocks drop when harvesting. Checked dirt, grass, and oak logs.

Steps to reproduce the issue

  1. Create a modpack with the latest forge version. I have Forge 34.1.23 Mods to add are JEI, EdibleBugs, Minecolonies, and Structurize.
  2. Start the modpack, create a world. Try to harvest a block. Nothing will drop.
  3. No blocks will drop.

Removing just Minecolonies and try again, blocks will drop.

Logs

  • latest.log:
    eractnod/gist:ef16cb8d0be4d0f4cf6ecf8723403841

  • crashlog:
    Just in case I didn't to the gist correctly, here is the first part of the latest.log that shows the first error.

[15:23:15] [Render thread/ERROR]: Exception caught during firing event: null
Index: 2
Listeners:
0: NORMAL
1: ASM: com.eractnod.ediblebugs.EdibleBugs@2fe71a7c onLootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
2: ASM: class com.minecolonies.coremod.event.EventHandler onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
java.lang.NullPointerException
at net.minecraft.loot.LootTable.lambda$addPool$2(LootTable.java:207)
at net.minecraft.loot.LootTable$$Lambda$5964/38414808.test(Unknown Source)
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449)
at net.minecraft.loot.LootTable.addPool(LootTable.java:207)
at com.minecolonies.coremod.loot.SupplyLoot.addLootToEvent(SupplyLoot.java:90)
at com.minecolonies.coremod.event.EventHandler.onLootTableLoad(EventHandler.java:103)
at net.minecraftforge.eventbus.ASMEventHandler_58_EventHandler_onLootTableLoad_LootTableLoadEvent.invoke(.dynamic)
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297)
at net.minecraftforge.event.ForgeEventFactory.loadLootTable(ForgeEventFactory.java:653)
at net.minecraftforge.common.ForgeHooks.loadLootTable(ForgeHooks.java:838)
at net.minecraft.loot.LootTableManager.lambda$apply$0(LootTableManager.java:40)
at net.minecraft.loot.LootTableManager$$Lambda$5960/2126780064.accept(Unknown Source)
at java.util.HashMap.forEach(HashMap.java:1280)
at net.minecraft.loot.LootTableManager.func_212853_a_(LootTableManager.java:38)
at net.minecraft.loot.LootTableManager.func_212853_a_(LootTableManager.java:16)
at net.minecraft.client.resources.ReloadListener.func_215269_a(SourceFile:13)
at net.minecraft.client.resources.ReloadListener$$Lambda$4239/615535250.accept(Unknown Source)
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656)
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632)
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
at net.minecraft.resources.AsyncReloader.func_219557_a(SourceFile:71)
at net.minecraft.resources.AsyncReloader$$Lambda$4367/536603592.run(Unknown Source)
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144)
at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23)
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118)
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(SourceFile:127)
at net.minecraft.client.Minecraft.func_238189_a_(Minecraft.java:1808)
at net.minecraft.client.Minecraft.func_238195_a_(Minecraft.java:1661)
at net.minecraft.client.Minecraft.func_238192_a_(Minecraft.java:1635)
at net.minecraft.client.gui.screen.CreateWorldScreen.func_195352_j(CreateWorldScreen.java:260)
at net.minecraft.client.gui.screen.CreateWorldScreen.lambda$func_231160_c_$9(CreateWorldScreen.java:205)
at net.minecraft.client.gui.screen.CreateWorldScreen$$Lambda$5216/835787160.onPress(Unknown Source)
at net.minecraft.client.gui.widget.button.Button.func_230930_b_(SourceFile:33)
at net.minecraft.client.gui.widget.button.AbstractButton.func_230982_a_(SourceFile:16)
at net.minecraft.client.gui.widget.Widget.func_231044_a_(Widget.java:136)
at net.minecraft.client.gui.INestedGuiEventHandler.func_231044_a_(SourceFile:27)
at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:87)
at net.minecraft.client.MouseHelper$$Lambda$4900/578294406.run(Unknown Source)
at net.minecraft.client.gui.screen.Screen.func_231153_a_(Screen.java:427)
at net.minecraft.client.MouseHelper.func_198023_a(MouseHelper.java:85)
at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:175)
at net.minecraft.client.MouseHelper$$Lambda$4899/1602076154.run(Unknown Source)
at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(SourceFile:94)
at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:174)
at net.minecraft.client.MouseHelper$$Lambda$4192/318434010.invoke(Unknown Source)
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
at org.lwjgl.system.JNI.invokeV(Native Method)
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101)
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:109)
at net.minecraft.client.MainWindow.func_227802_e_(MainWindow.java:304)
at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:973)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:584)
at net.minecraft.client.main.Main.main(Main.java:184)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51)
at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$414/1205419533.call(Unknown Source)
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)

[15:23:15] [Render thread/ERROR]: Couldn't parse loot table minecraft:blocks/jungle_log
java.lang.NullPointerException: null
at net.minecraft.loot.LootTable.lambda$addPool$2(LootTable.java:207) ~[?:?]
at net.minecraft.loot.LootTable$$Lambda$5964/38414808.test(Unknown Source) ~[?:?]
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:1.8.0_51]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351) ~[?:1.8.0_51]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[?:1.8.0_51]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:1.8.0_51]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:1.8.0_51]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_51]
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449) ~[?:1.8.0_51]
at net.minecraft.loot.LootTable.addPool(LootTable.java:207) ~[?:?]
at com.minecolonies.coremod.loot.SupplyLoot.addLootToEvent(SupplyLoot.java:90) ~[?:0.13.360-BETA]
at com.minecolonies.coremod.event.EventHandler.onLootTableLoad(EventHandler.java:103) ~[?:0.13.360-BETA]
at net.minecraftforge.eventbus.ASMEventHandler_58_EventHandler_onLootTableLoad_LootTableLoadEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-3.0.3-service.jar:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:297) ~[eventbus-3.0.3-service.jar:?]
at net.minecraftforge.event.ForgeEventFactory.loadLootTable(ForgeEventFactory.java:653) ~[?:?]
at net.minecraftforge.common.ForgeHooks.loadLootTable(ForgeHooks.java:838) ~[?:?]
at net.minecraft.loot.LootTableManager.lambda$apply$0(LootTableManager.java:40) [?:?]
at net.minecraft.loot.LootTableManager$$Lambda$5960/2126780064.accept(Unknown Source) [?:?]
at java.util.HashMap.forEach(HashMap.java:1280) [?:1.8.0_51]
at net.minecraft.loot.LootTableManager.func_212853_a_(LootTableManager.java:38) [?:?]
at net.minecraft.loot.LootTableManager.func_212853_a_(LootTableManager.java:16) [?:?]
at net.minecraft.client.resources.ReloadListener.func_215269_a(SourceFile:13) [?:?]
at net.minecraft.client.resources.ReloadListener$$Lambda$4239/615535250.accept(Unknown Source) [?:?]
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) [?:1.8.0_51]
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632) [?:1.8.0_51]
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442) [?:1.8.0_51]
at net.minecraft.resources.AsyncReloader.func_219557_a(SourceFile:71) [?:?]
at net.minecraft.resources.AsyncReloader$$Lambda$4367/536603592.run(Unknown Source) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) [?:?]
at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213161_c(SourceFile:127) [?:?]
at net.minecraft.client.Minecraft.func_238189_a_(Minecraft.java:1808) [?:?]
at net.minecraft.client.Minecraft.func_238195_a_(Minecraft.java:1661) [?:?]
at net.minecraft.client.Minecraft.func_238192_a_(Minecraft.java:1635) [?:?]
at net.minecraft.client.gui.screen.CreateWorldScreen.func_195352_j(CreateWorldScreen.java:260) [?:?]
at net.minecraft.client.gui.screen.CreateWorldScreen.lambda$func_231160_c_$9(CreateWorldScreen.java:205) [?:?]
at net.minecraft.client.gui.screen.CreateWorldScreen$$Lambda$5216/835787160.onPress(Unknown Source) [?:?]
at net.minecraft.client.gui.widget.button.Button.func_230930_b_(SourceFile:33) [?:?]
at net.minecraft.client.gui.widget.button.AbstractButton.func_230982_a_(SourceFile:16) [?:?]
at net.minecraft.client.gui.widget.Widget.func_231044_a_(Widget.java:136) [?:?]
at net.minecraft.client.gui.INestedGuiEventHandler.func_231044_a_(SourceFile:27) [?:?]
at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:87) [?:?]
at net.minecraft.client.MouseHelper$$Lambda$4900/578294406.run(Unknown Source) [?:?]
at net.minecraft.client.gui.screen.Screen.func_231153_a_(Screen.java:427) [?:?]
at net.minecraft.client.MouseHelper.func_198023_a(MouseHelper.java:85) [?:?]
at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:175) [?:?]
at net.minecraft.client.MouseHelper$$Lambda$4899/1602076154.run(Unknown Source) [?:?]
at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(SourceFile:94) [?:?]
at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:174) [?:?]
at net.minecraft.client.MouseHelper$$Lambda$4192/318434010.invoke(Unknown Source) [?:?]
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) [lwjgl-glfw-3.2.2.jar:build 10]
at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10]
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) [lwjgl-glfw-3.2.2.jar:build 10]
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:109) [?:?]
at net.minecraft.client.MainWindow.func_227802_e_(MainWindow.java:304) [?:?]
at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:973) [?:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:584) [?:?]
at net.minecraft.client.main.Main.main(Main.java:184) [?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.3-34.1.23.jar:34.1]
at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$414/1205419533.call(Unknown Source) [forge-1.16.3-34.1.23.jar:34.1]
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-7.0.1.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-7.0.1.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-7.0.1.jar:?]
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-7.0.1.jar:?]
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-7.0.1.jar:?]

Notes

This issue started with version 1.16.3. These two mods worked fine together in 1.16.1. In EdibleBugs, this is how I add my bugs to vanilla block drops.
@SubscribeEvent
public void onLootLoad(LootTableLoadEvent event) {
if(EdiblebugsConfig.ALLOWWOODBUGS.get()){
if (event.getName().equals(new ResourceLocation("minecraft","blocks/oak_log"))) {
event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/oak_log"))).build());
}
if (event.getName().equals(new ResourceLocation("minecraft","blocks/spruce_log"))) {
event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/spruce_log"))).build());
}
if (event.getName().equals(new ResourceLocation("minecraft","blocks/birch_log"))) {
event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/birch_log"))).build());
}
if (event.getName().equals(new ResourceLocation("minecraft","blocks/jungle_log"))) {
event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/jungle_log"))).build());
}
if (event.getName().equals(new ResourceLocation("minecraft","blocks/acacia_log"))) {
event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/acacia_log"))).build());
}
if (event.getName().equals(new ResourceLocation("minecraft","blocks/dark_oak_log"))) {
event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/dark_oak_log"))).build());
}
}

    if(EdiblebugsConfig.ALLOWSANDBUGS.get()){
        if (event.getName().equals(new ResourceLocation("minecraft","blocks/sand"))) {
            event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs","blocks/sand"))).build());
        }
    }

    if(EdiblebugsConfig.ALLOWDIRTBUGS.get()) {
        if (event.getName().equals(new ResourceLocation("minecraft", "blocks/dirt"))) {
            event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs", "blocks/dirt"))).build());
        }
    }

    if(EdiblebugsConfig.ALLOWGRASSBUGS.get()) {
        if (event.getName().equals(new ResourceLocation("minecraft", "blocks/grass_block"))) {
            event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation("ediblebugs", "blocks/grass_block"))).build());
        }
    }

And here is the JSON file for the oak_log block. They are similar for all wood types, dirt, grass, and sand.
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "ediblebugs:woodtermite"
},
{
"type": "minecraft:item",
"name": "ediblebugs:carpenterant"
},
{
"type": "minecraft:item",
"name": "ediblebugs:jumilbug"
},
{
"type": "minecraft:item",
"name": "ediblebugs:witchettygrub"
}
],
"conditions": [
{
"condition": "minecraft:random_chance",
"chance": 0.05
}
]
}
]
}

This issue could very well be mine. I am looking for help in resolving.


Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.
commented

I was able to correct this issue. Changed my LootTableLoadEvent to more match yours, PneumaticCraft, and Forbidden Arcanus. Blocks drop again with both mods installed together.

public void onLootLoad(LootTableLoadEvent event) {
    String prefix = "minecraft:blocks/";
    String name = event.getName().toString();

    if (name.startsWith(prefix)) {
        String file = name.substring(name.indexOf(prefix) + prefix.length());
        switch (file) {
            case "oak_log": if(EdiblebugsConfig.ALLOWWOODBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "dark_oak_log": if(EdiblebugsConfig.ALLOWWOODBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "birch_log": if(EdiblebugsConfig.ALLOWWOODBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "spruce_log": if(EdiblebugsConfig.ALLOWWOODBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "jungle_log": if(EdiblebugsConfig.ALLOWWOODBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "acacia_log": if(EdiblebugsConfig.ALLOWWOODBUGS.get()) event.getTable().addPool(getInjectPool(file));break;

            case "grass_block": if(EdiblebugsConfig.ALLOWGRASSBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "sand": if(EdiblebugsConfig.ALLOWSANDBUGS.get()) event.getTable().addPool(getInjectPool(file));break;
            case "dirt": if(EdiblebugsConfig.ALLOWDIRTBUGS.get()) event.getTable().addPool(getInjectPool(file)); break;
            default: break;
        }
    }