mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
Add support for binding a key to toggle the Travellers Belt toolbar in inventories
This adds support for swapping the toolbar in inventories. For now, no key is assigned by default, so one must be added from the NEI options for this to take effect.
This commit is contained in:
1 parent
a6066582a2
commit
996d9adb48
4 files changed
+83
-5
No files matched your search
@@ -174,10 +174,7 @@ public class ArmorControls {
|
||||
}
|
||||
}
|
||||
if (key == ArmorControls.beltSwap) {
|
||||
if (ArmorProxyClient.armorExtended.inventory[3] != null) {
|
||||
PlayerAbilityHelper.swapBelt(mc.thePlayer, ArmorProxyClient.armorExtended);
|
||||
toggleBelt();
|
||||
}
|
||||
doBeltSwapIfPossible();
|
||||
}
|
||||
if (key == ArmorControls.zoomKey) {
|
||||
zoom = !zoom;
|
||||
@@ -217,7 +214,17 @@ public class ArmorControls {
|
||||
updateServer(packet);
|
||||
}
|
||||
|
||||
private void toggleBelt() {
|
||||
public static boolean doBeltSwapIfPossible()
|
||||
{
|
||||
if (ArmorProxyClient.armorExtended.inventory[3] != null) {
|
||||
PlayerAbilityHelper.swapBelt(mc.thePlayer, ArmorProxyClient.armorExtended);
|
||||
toggleBelt();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void toggleBelt() {
|
||||
AbstractPacket packet = new BeltPacket();
|
||||
updateServer(packet);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user