Skip to content

Commit

Permalink
fix: prevent rounding to int when processing keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Octol1ttle committed Oct 1, 2024
1 parent 843a3a6 commit 6ddea55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
package nl.enjarai.doabarrelroll.flight;

import java.util.HashMap;
import java.util.Map;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Smoother;
import nl.enjarai.doabarrelroll.DoABarrelRoll;
import nl.enjarai.doabarrelroll.DoABarrelRollClient;
import nl.enjarai.doabarrelroll.ModKeybindings;
import nl.enjarai.doabarrelroll.api.event.RollContext;
import nl.enjarai.doabarrelroll.api.rotation.RotationInstant;
import nl.enjarai.doabarrelroll.config.ModConfig;
import nl.enjarai.doabarrelroll.config.Sensitivity;
import nl.enjarai.doabarrelroll.math.MagicNumbers;

import java.util.HashMap;
import java.util.Map;

public class RotationModifiers {
public static final double ROLL_REORIENT_CUTOFF = Math.sqrt(10.0 / 3.0);

public static RollContext.ConfiguresRotation buttonControls(double power) {
return (rotationInstant, context) -> {
var delta = power * context.getRenderDelta();
var pitch = 0;
var yaw = 0;
var roll = 0;
var pitch = 0.0;
var yaw = 0.0;
var roll = 0.0;

if (ModKeybindings.PITCH_UP.isPressed()) {
pitch -= delta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import dev.isxander.controlify.api.event.ControlifyEvents;
import dev.isxander.controlify.bindings.BindContext;
import net.minecraft.text.Text;
import net.minecraft.util.math.MathHelper;
import nl.enjarai.doabarrelroll.DoABarrelRoll;
import nl.enjarai.doabarrelroll.DoABarrelRollClient;
import nl.enjarai.doabarrelroll.ModKeybindings;
Expand Down

0 comments on commit 6ddea55

Please sign in to comment.