Fishing rod in offhand, bobber immediately disappears/goes to 0,0
Resolved
Fixed
45
When using a fishing rod in the offhand slot, the bobber is spawned and immediately removed - the game only checks if you're holding a rod in your main hand.
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the net.minecraft.entity.projectile.EntityFishHook.onUpdate() method only tests if the player is holding a fishing rod in his main hand.
There are however multiple other fixes required as well. The net.minecraft.item.ItemFishingRod.ItemFishingRod().new IItemPropertyGetter() {...}.apply(ItemStack, World, EntityLivingBase) method needs to be changed to show a casted fishing rod for the offhand. The problem is that currently no hand parameter is provided so the complete method needs to be changed.
The net.minecraft.client.renderer.entity.RenderFish.doRender(EntityFishHook, double, double, double, float, float) method needs to be changed as well to draw the line from the correct hand.
There's also a visual bug where the line goes away from the player about 15 blocks or so and also another line to the player where the bobber appears. The line always goes to the east. Just reported this bug.
Duplicate ofMC-83109