Fix toolbox regression

- Fix toolbox menu closing regression
This commit is contained in:
PepperBell 2021-11-28 18:50:27 -08:00
parent b0ec966b98
commit 68bf1f399a

View file

@ -351,14 +351,6 @@ public class RadialToolboxMenu extends AbstractSimiScreen {
@Override
public boolean keyPressed(int code, int scanCode, int modifiers) {
InputConstants.Key mouseKey = InputConstants.getKey(code, scanCode);
if (AllKeys.TOOLBELT.getKeybind()
.isActiveAndMatches(mouseKey)) {
onClose();
ToolboxHandlerClient.COOLDOWN = 2;
return true;
}
KeyMapping[] hotbarBinds = minecraft.options.keyHotbarSlots;
for (int i = 0; i < hotbarBinds.length && i < 8; i++) {
if (hotbarBinds[i].matches(code, scanCode)) {
@ -385,6 +377,17 @@ public class RadialToolboxMenu extends AbstractSimiScreen {
return super.keyPressed(code, scanCode, modifiers);
}
@Override
public boolean keyReleased(int code, int scanCode, int modifiers) {
InputConstants.Key mouseKey = InputConstants.getKey(code, scanCode);
if (AllKeys.TOOLBELT.getKeybind()
.isActiveAndMatches(mouseKey)) {
onClose();
return true;
}
return super.keyReleased(code, scanCode, modifiers);
}
public static enum State {
SELECT_BOX, SELECT_ITEM, SELECT_ITEM_UNEQUIP, DETACH
}