Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CommandAPI loading on old versions (tested 1.19)
This was a similar issue to what was brought up here: #594 (comment). It seems that having `NMS_1_21_R1::new` as a method reference still loads the `NMS_1_21_R1` class enough that Java gets mad. On 1.19, trying to load the CommandAPI gives `java.lang.VerifyError: Bad type on operand stack - Type 'net/minecraft/commands/CommandBuildContext' (current frame, stack[1]) is not assignable to 'net/minecraft/core/HolderLookup$a'` with the stacktrace going through that line. Moving all references to the `NMS_1_21_R1` class into the if statements allowed loading on 1.19 as expected. That does mean the slight inconvenience of having to specify and update the latest NMS object in two place.
- Loading branch information