Skip to content

Commit

Permalink
fix offhand item render
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Aug 20, 2023
1 parent 30b4a42 commit 55b6b21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version = 1.18
yarn_mappings = 1.18+build.1
loader_version = 0.14.19

mod_version = 1.4.0
mod_version = 1.4.1
maven_group = net.krlite
archives_base_name = verticality

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ private void renderHotbarItem(InGameHud inGameHud, int x, int y, float tickDelta
)
private void fixOffhandItem(Args args) {
int x = args.get(2);
if (MinecraftClient.getInstance().player != null && MinecraftClient.getInstance().player.getMainArm() == Arm.LEFT)
if (MinecraftClient.getInstance().player != null && MinecraftClient.getInstance().player.getMainArm() == Arm.LEFT && Verticality.enabled())
// Don't use 'MinecraftClient.getInstance().options.getMainArm()' as vanilla doesn't use it neither, otherwise causing the offhand item out-of-phase
args.set(2, (int) Math.round(x - 2 * ((x + 8) - Verticality.width() / 2.0))); // Revert the x-coordinate of the item
else args.set(2, x);
}

@Inject(
Expand Down

0 comments on commit 55b6b21

Please sign in to comment.