First Beta for 1.10.0!

- Separate movement and camera joysticks to fix boat movement (again)
- Fixed crashes with various mods
- Compatibility for Sodium 0.6.0
- Updated MidnightLib to 1.6.1
This commit is contained in:
Martin Prokoph
2024-08-30 12:07:23 +02:00
parent c0af00f2a3
commit 24d169b4c2
9 changed files with 50 additions and 32 deletions

View File

@@ -58,10 +58,19 @@ public class AxisStorage {
}
this.polarity = currentPlusState ? AxisStorage.Polarity.PLUS : currentMinusState ? AxisStorage.Polarity.MINUS : AxisStorage.Polarity.ZERO;
}
/**
* Returns the specified axis as a button.
*
* @param positive true if the axis part is positive, else false
* @return the axis as a button
*/
public int getButtonId(boolean positive) {
return ButtonBinding.axisAsButton(axis, positive);
}
public void setupButtonStates() {
var posButton = ButtonBinding.axisAsButton(axis, true);
var negButton = ButtonBinding.axisAsButton(axis, false);
var posButton = getButtonId(true);
var negButton = getButtonId(false);
var previousPlusState = STATES.getOrDefault(posButton, ButtonState.NONE);
var previousMinusState = STATES.getOrDefault(negButton, ButtonState.NONE);