Skip to content

Commit

Permalink
UDOC-0 - Fix container offset when swapping items to hotbar slots
Browse files Browse the repository at this point in the history
  • Loading branch information
telvarost committed Apr 4, 2024
1 parent 3a2386a commit 7500a7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=b1.7.3+build.8
loader_version=0.14.24-babric.1

# Mod Properties
mod_version = 1.3.1
mod_version = 1.3.2
maven_group = pl.telvarost
archives_base_name = mojangfixstationapi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ private void onKeyPressed(char character, int keyCode, CallbackInfo ci) {
}

if (keyCode >= Keyboard.KEY_1 && keyCode <= Keyboard.KEY_9) {
if (this.minecraft.player.inventory.getCursorStack() == null)
if ( (null != this.container.slots)
&& (10 <= this.container.slots.size())
) {
if (this.minecraft.player.inventory.getCursorStack() == null)
this.minecraft.interactionManager.clickSlot(this.container.syncId, slot.id, 0, false, this.minecraft.player);
this.minecraft.interactionManager.clickSlot(this.container.syncId, (this.container.slots.size() - 10) + keyCode - 1, 0, false, this.minecraft.player);
this.minecraft.interactionManager.clickSlot(this.container.syncId, slot.id, 0, false, this.minecraft.player);
this.minecraft.interactionManager.clickSlot(this.container.syncId, 35 + keyCode - 1, 0, false, this.minecraft.player);
this.minecraft.interactionManager.clickSlot(this.container.syncId, slot.id, 0, false, this.minecraft.player);
}
}
}
}

0 comments on commit 7500a7b

Please sign in to comment.