BCLib

BCLib

31M Downloads

[Bug] Crash while using Crooks from the Crooked Crooks Mod

justliliandev opened this issue ยท 0 comments

commented

What happened?

This crash appeared with the Quilt Mod Loader, however this can occur at any time with Fabric as well
This is caused, because crooked crooks initialized the DiggerItem#blocks field with null, even though the field is not marked as nullable. This is not an issue in CrookedCrooks, because that mod overrides all usages of that private field.
A posssible fix for this would be to not use return dig.bclib_getBlockTag().equals(tag); in this method
but to replace it with dig.bclib_getBlockTag() == tag . This works, because TagKeys are interned (the same Identifier builds the same TagKey Instance). This would fix any issues occuring with null here

BCLib

2.1.2

Fabric API

using quilt 3.0.0-beta.19

Fabric Loader

using quilt 0.17.6

Minecraft

1.19.2

Relevant log output

java.lang.NullPointerException: Cannot invoke "net.minecraft.class_6862.equals(Object)" because the return value of "org.betterx.worlds.together.mixin.common.DiggerItemAccessor.bclib_getBlockTag()" is null
	at org.betterx.worlds.together.tag.v3.TagManager.isToolWithMineableTag(TagManager.java:121)
	at org.betterx.bclib.items.tool.BaseShearsItem.isShear(BaseShearsItem.java:20)
	at net.minecraft.block.LeavesBlock.getDroppedStacks(LeavesBlock:526)
	at net.minecraft.block.AbstractBlock$AbstractBlockState.getDroppedStacks(AbstractBlock:960)
	at net.minecraft.block.Block.getDroppedStacks(Block:339)
	at net.minecraft.block.Block.dropStacks(Block:365)
	at io.github.ennuil.crooked_crooks.events.MultiplyDropsEvent.lambda$registerEvent$0(MultiplyDropsEvent.java:21)
	at net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents.lambda$static$2(PlayerBlockBreakEvents.java:62)
	at net.minecraft.server.network.ServerPlayerInteractionManager.handler$doh000$onBlockBroken(ServerPlayerInteractionManager:2621)
	at net.minecraft.server.network.ServerPlayerInteractionManager.tryBreakBlock(ServerPlayerInteractionManager:262)
	at net.minecraft.server.network.ServerPlayerInteractionManager.update(ServerPlayerInteractionManager:106)
	at net.minecraft.server.network.ServerPlayerEntity.tick(ServerPlayerEntity:443)
	at net.minecraft.server.world.ServerWorld.tickEntity(ServerWorld:712)
	at net.minecraft.world.World.tickEntity(World:466)
	at net.minecraft.server.world.ServerWorld.method_31420(ServerWorld:371)
	at net.minecraft.world.EntityList.forEach(EntityList:54)
	at net.minecraft.server.world.ServerWorld.tick(ServerWorld:339)
	at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:875)
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer:819)
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer:98)
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:665)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:257)
	at java.lang.Thread.run(Thread.java:833)

Other Mods

https://modrinth.com/mod/crooked-crooks 3.1.0