GoryMoon / HorsePower

Other
10 stars 6 forks source link

problem with TFC log items vs blocks #52

Closed kotoroshinoto closed 2 years ago

kotoroshinoto commented 2 years ago

I am using the terrafirmagreg modpack (uses 1.12.2).

from what I've been able to investigate, there is a divide of sorts in the code between the log item and the log block that is placed in world when you right click with it.

It doesn't seem like the automatic log item detection that drives the recipe generation is working correclty.

when I attempt to put the recipe on a crafting table, the server issues an exception: java.util.concurrent.ExecutionException: java.lang.ClassCastException: net.dries007.tfc.objects.items.ItemMisc cannot be cast to net.minecraft.item.ItemBlock

I'm not sure which item is the one actually throwing the error, but if it is the log, I suspect the log item cannot be cast to a block. the TFC code likely handles that automatically behind the scenes without casting (placing the item generates the block which harvesting the block nets the item).

How would this be rectified? Can we use crafttweaker to tell it to use the log block as the texture item while using the log item for the recipe?

kotoroshinoto commented 2 years ago

Some additional information: looking at the jei entries that were automatically created for the log items, I can pull one out ,but I can't place it in the world without a crash (client side at least), probably related to the same issue of attempting to treat the log item as a block and failing.

I CAN however use the give command as such: /give horsepower:chopper 1 0 {textureBlock: {id:block:tfc:wood/log/oak, Count:1, Damage:0}}, which looks correct and can be placed.

kotoroshinoto commented 2 years ago

was hoping this would temporarily work around the problem, but something seems to be choking:

https://pastebin.com/HpBr0syB

kotoroshinoto commented 2 years ago

here is a bit more of the trace

java.util.concurrent.ExecutionException: java.lang.ClassCastException: net.dries007.tfc.objects.items.ItemMisc cannot be cast to net.minecraft.item.ItemBlock at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_301] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_301] at net.minecraft.util.Util.runTask(SourceFile:531) [h.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:723) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:397) [nz.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_301] Caused by: java.lang.ClassCastException: net.dries007.tfc.objects.items.ItemMisc cannot be cast to net.minecraft.item.ItemBlock at se.gory_moon.horsepower.recipes.ShapedChoppingRecipe.getCraftingResult(ShapedChoppingRecipe.java:55) ~[ShapedChoppingRecipe.class:?] at net.minecraft.inventory.Container.slotChangedCraftingGrid(Container.java:798) ~[afr.class:?] at net.minecraft.inventory.ContainerWorkbench.onCraftMatrixChanged(SourceFile:51) ~[afz.class:?] at net.minecraft.inventory.InventoryCrafting.setInventorySlotContents(SourceFile:93) ~[afy.class:?] at net.minecraft.inventory.Slot.putStack(Slot.java:70) ~[agr.class:?] at net.minecraft.inventory.Container.slotClick(Container.java:281) ~[afr.class:?] at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:1162) ~[pa.class:?] at net.minecraft.network.play.client.CPacketClickWindow.processPacket(CPacketClickWindow.java:38) ~[lf.class:?] at net.minecraft.network.play.client.CPacketClickWindow.processPacket(CPacketClickWindow.java:12) ~[lf.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_301] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_301] at net.minecraft.util.Util.runTask(SourceFile:529) ~[h.class:?]

kotoroshinoto commented 2 years ago

I tried setting B:"Use Dynamic Chopping Crafting"=false on the client and server, but that crash still happens.

kotoroshinoto commented 2 years ago

My apologies, i now realize that a fork of this mod for TFC is where I should be reporting this issue:

https://github.com/ACGaming/HorsePowerTFC/issues/1