AppleCore

AppleCore

56M Downloads

Thaumcraft 4 derpy wand casting

Russoul opened this issue ยท 14 comments

commented

As the title says, there is a bug that derps the animation of the wand from thaumcraft while casting or channeling with it. I think there may be issues with other mods too.

commented

How do you know this is related to AppleCore?

commented

Because i can't replicate the issue without applecore installed (hunger overhaul and spice of life are not installed)

commented

Try with only Thaumcraft and AppleCore just to verify. This seems really weird but I guess possible.

commented

Yeah, i've just tried to load up only with thaumcraft(newest - Thaumcraft 4.2.1.1) and applecore, the issue still exists

commented

By the way, im using forge 1217

commented

Does this happen on 1208?

commented

It's definitely possible. AppleCore alters how item use duration works to fix a Forge bug when altering the use duration of an item using PlayerUseItemEvent (if you increase the duration, it would just delay the animation, not make it longer). See: https://github.com/squeek502/AppleCore/blob/master/java/squeek/applecore/asm/reference/EntityPlayerModifications.java#L21-L47

I'll have to look at what Thaumcraft is doing.

commented

I'm not actually sure what's going on, as the AppleCore code doesn't seem like it'd affect Thaumcraft. Thaumcraft is using EnumAction.bow and player.setItemInUse(itemstack, 2147483647), with ItemWandCasting also returning 2147483647 from getMaxItemUseDuration. None of that would be affected by AppleCore.

@Russoul, what's different about the animation? Which wand/foci are you using? What are you doing with it?

commented

Any focus, vis drawing. The animation does not play fully, it just flicks. I think it somehow resets the item in use duration

commented

Doesn't seem to be doing that for me.

commented

Have you replicated that yourself ?

commented

Yes, it does

commented

Ok, it looks like Thaumcraft is doing something weird that I can't figure out the purpose of. Every client tick, Thaumcraft calls player.setItemInUse(player.inventory.getCurrentItem(), player.getItemInUseCount()), thereby resetting the item usage (using the last count as the new duration). I see how this could be potentially useful (the client ItemStack changes all the time due to server syncing, so it's effectively keeping player.itemInUse synced), but I can't find anywhere in the Thaumcraft code that this is actually taken advantage of (there are seemingly no calls to player.getItemInUse() that depend on the state of the ItemStack being updated).

From a logical point of view, it breaks some common sense assumptions, like the Forge event PlayerUseItemEvent.Start being called every tick on the client instead of only when the item usage actually starts.

I'm not really sure how to resolve it. I'll report the issue to Thaumcraft and see if we can figure something out.

commented

Whoops, I was doing dumb stuff while testing which caused AppleCore not to get loaded. You're right, it flickers like crazy. I'll try to fix it.