[Fabric] Progressive Archery

[Fabric] Progressive Archery

18k Downloads

[1.20.6] Arrows don't get consumed (using both modded/vanilla bows) and loading/using vanilla crossbows crashes the game.

pnk2u opened this issue ยท 8 comments

commented

I've tried this with both the trinkets version and the regular version using runClient in IntelliJ to confirm what I've experienced in my personal playing.

commented

Hello, thank you for writing in. Would you please provide the crash report? That would let me know where things went wrong.

commented

Hello! So, the fact that arrows are not getting consumed has no crash report, of course, and the crash report for the crossbow crash reads as follows:

Description: Unexpected error

java.lang.ClassCastException: class net.minecraft.item.CrossbowItem cannot be cast to class solipingen.progressivearchery.item.ModCrossbowItem (net.minecraft.item.CrossbowItem and solipingen.progressivearchery.item.ModCrossbowItem are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @5faeada1)
	at solipingen.progressivearchery.item.ModCrossbowItem.getModProjectileType(ModCrossbowItem.java:114)
	at net.minecraft.item.CrossbowItem.handler$zlj001$progressivearchery$injectedUse(CrossbowItem.java:583)
	at net.minecraft.item.CrossbowItem.use(CrossbowItem.java)
	at net.minecraft.item.ItemStack.use(ItemStack.java:377)
	at net.minecraft.client.network.ClientPlayerInteractionManager.method_41929(ClientPlayerInteractionManager.java:388)
	at net.minecraft.client.network.ClientPlayerInteractionManager.sendSequencedPacket(ClientPlayerInteractionManager.java:280)
	at net.minecraft.client.network.ClientPlayerInteractionManager.interactItem(ClientPlayerInteractionManager.java:380)
	at net.minecraft.client.MinecraftClient.doItemUse(MinecraftClient.java:1922)
	at net.minecraft.client.MinecraftClient.handleInputEvents(MinecraftClient.java:2158)
	at net.minecraft.client.MinecraftClient.tick(MinecraftClient.java:1989)
	at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1281)
	at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:888)
	at net.minecraft.client.main.Main.main(Main.java:265)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
commented

Thank you. May I ask, which version of Progressive Archery was this on?

commented

The newest one at the time of posting. 1.1.7-1.20.6 (as mentioned both the trinkets and non-trinkets-version are affected)

commented

Thank you for waiting. This issue has been addressed in most recent update v1.2.0-1.21. Please feel free to check if it has been fixed. If no update is made here within this week, I will close this issue as resolved.

commented

Thank you, the issue I had described does now no longer occur, so it has successfully been fixed. If I may ask though, just out of curiosity (and since I've recently started developing mods myself), what exactly has caused the bug/how did you fix it? :o

commented

It was a simple class casting mistake. The vanilla BowItem, which is what the vanilla minecraft:bow is an instance of, is different from ModBowItem, the mod class that the mod's additional bows instantiate. In my mixin of BowItem, I had accidentally left a method trying to cast BowItem to ModBowItem and use one of its methods. Since neither extends the other, the game crashes from this casting attempt.

Hope your own mods turn out well.

commented

Ah, I see. That makes sense. Thanks for taking the time to explain it and for the kind wishes.
As the issue has been resolved, I will now close it. (: