mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-26 23:12:58 +00:00
Extract tool config keybind handling into method
This commit is contained in:
1 parent
496112d24d
commit
bacae705ad
1 file changed
+6
-2
+6
-2
@@ -39,7 +39,7 @@ public class KeyInputHandler {
|
||||
if (KeyBindings.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (KeyBindings.toolConfig.isPressed()) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
handleToolConfigKey();
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null
|
||||
&& Minecraft.getMinecraft().thePlayer.getItemInUse() == null) {
|
||||
DraconicEvolution.network
|
||||
@@ -83,7 +83,7 @@ public class KeyInputHandler {
|
||||
if (KeyBindings.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (KeyBindings.toolConfig.isPressed()) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
handleToolConfigKey();
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
|
||||
|
||||
@@ -125,6 +125,10 @@ public class KeyInputHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToolConfigKey() {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
|
||||
}
|
||||
|
||||
private int previouseSlot(int i, int c) {
|
||||
if (c > 0 && c < 8) return c + i;
|
||||
if (c == 0 && i < 0) return 8;
|
||||
|
||||
Reference in new issue
Block a user