Skip to content

Commit

Permalink
Update RawMouseHelper.java
Browse files Browse the repository at this point in the history
Allows player rotation to be changed correctly
  • Loading branch information
seanld03 committed Dec 24, 2022
1 parent 82b2dfa commit fdf4803
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/main/java/mod/seanld/rawinput/RawMouseHelper.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
package mod.seanld.rawinput;
import net.minecraft.util.MouseHelper;
import org.lwjgl.input.Mouse;

public class RawMouseHelper extends MouseHelper {

@Override
public void mouseXYChange()
{
this.deltaX = RawInput.dx;
RawInput.dx = 0;
this.deltaY = -RawInput.dy;
RawInput.dy = 0;
this.deltaX = RawInputHandler.dx;
RawInputHandler.dx = 0;
this.deltaY = -RawInputHandler.dy;
RawInputHandler.dy = 0;
}
@Override
public void grabMouseCursor()
{
if (Boolean.parseBoolean(System.getProperty("fml.noGrab","false"))) return;
Mouse.setGrabbed(true);
this.deltaX = 0;
RawInputHandler.dx = 0;
this.deltaY = 0;
RawInputHandler.dy = 0;
}
}

0 comments on commit fdf4803

Please sign in to comment.