talrey/CreateDeco

[1.20.1 Forge] Gold and Netherite coin stacks cannot be placed, cause exceptions, were not registered as blocks

Closed this issue · 2 comments

Minecraft 1.20.1
Forge 47.2.17
Flywheel 0.6.10-7 (interesting - this versions doesn't show up in Modrinth's app)
Create 0.5.1f
Create Deco 2.0.0-forge-1.20.1

ran via Modrinth

When I place gold coin stacks or netherite coin stacks, the item is consumed and no coin stack block is placed. Looking at the logs, I see an exception:


Full log:
[debug.log](https://github.com/talrey/CreateDeco/files/13981676/debug.log)

[18Jan2024 13:09:48.504] [Server thread/ERROR] [net.minecraft.network.protocol.PacketUtils/]: Failed to handle packet net.minecraft.network.protocol.game.ServerboundUseItemOnPacket@6217fc26, suppressing error
java.lang.NullPointerException: Cannot invoke "com.tterrag.registrate.util.entry.BlockEntry.getDefaultState()" because the return value of "java.util.HashMap.get(Object)" is null
	at com.github.talrey.createdeco.items.CoinStackItem.placeBlock(CoinStackItem.java:45) ~[createdeco-2.0.0-forge-1.20.1.jar%23159!/:?]
	at com.github.talrey.createdeco.items.CoinStackItem.m_6225_(CoinStackItem.java:56) ~[createdeco-2.0.0-forge-1.20.1.jar%23159!/:?]
	at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:585) ~[forge-1.20.1-47.2.17-universal.jar%23165!/:?]
	at net.minecraft.world.item.ItemStack.m_41661_(ItemStack.java:245) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.level.ServerPlayerGameMode.m_7179_(ServerPlayerGameMode.java:358) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.m_6371_(ServerGamePacketListenerImpl.java:1057) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.m_5797_(ServerboundUseItemOnPacket.java:34) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.m_5797_(ServerboundUseItemOnPacket.java:8) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.network.protocol.PacketUtils.m_263899_(PacketUtils.java:22) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:770) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:753) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:747) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:732) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:665) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23160!/:?]
	at java.lang.Thread.run(Unknown Source) ~[?:?]

Looking earlier in the log, I notice Create Deco didn't register coin stack blocks for these metals:

[18Jan2024 13:03:10.761] [modloading-worker-0/DEBUG] [com.tterrag.registrate.AbstractRegistrate/REGISTRATE.REGISTER]: Captured registration for entry brass_coinstack of type minecraft:block
[18Jan2024 13:03:10.761] [modloading-worker-0/DEBUG] [com.tterrag.registrate.AbstractRegistrate/REGISTRATE.REGISTER]: Captured registration for entry iron_coinstack of type minecraft:block
[18Jan2024 13:03:10.761] [modloading-worker-0/DEBUG] [com.tterrag.registrate.AbstractRegistrate/REGISTRATE.REGISTER]: Captured registration for entry copper_coinstack of type minecraft:block
[18Jan2024 13:03:10.762] [modloading-worker-0/DEBUG] [com.tterrag.registrate.AbstractRegistrate/REGISTRATE.REGISTER]: Captured registration for entry industrial_iron_coinstack of type minecraft:block
[18Jan2024 13:03:10.762] [modloading-worker-0/DEBUG] [com.tterrag.registrate.AbstractRegistrate/REGISTRATE.REGISTER]: Captured registration for entry zinc_coinstack of type minecraft:block

full log:
debug.log

fixed in 2.0.1