Sk1erLLC / Patcher

A Forge mod full of Vanilla bug fixes, Quality of Life improvements, and performance enhancements.
Other
232 stars 60 forks source link

resolve NPE in NetHandlerPlayClient#handleSpawnPlayer for both 1.8.9 … #152

Closed Alexdoru closed 1 year ago

Alexdoru commented 1 year ago

…& 1.12.2

image

Alexdoru commented 1 year ago

Is this impossible to do with a mixin?

One could do an inject before, check the hashmap before hand and if it returns null do callback.cancel() but I didn't feel like checking the hasmap twice. Other than that I don't see how this could be done with mixins.

DJtheRedstoner commented 1 year ago

Mixin should be used for all new injections, unless it's absolutely necessary to use ASM.

Alexdoru commented 1 year ago

Mixin should be used for all new injections, unless it's absolutely necessary to use ASM.

is it possible to fix the bug without checking the haskmap twice ? like is there a mixin injector that allows you to catch the return value of a certain method invokation and then decide to cancel the whole method (inject a return) based on that

DJtheRedstoner commented 1 year ago

No, just check the hashmap twice. Lookups are O(1).

Alexdoru commented 1 year ago

No, just check the hashmap twice. Lookups are O(1).

it's done