mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-14 07:35:10 +01:00
Improved Range Combat While Eye Tracking
Adjusted the dynamic camera sensitivity while using an item intended to be used at a distance: the bow, crossbow, trident, and splash potion. The deadzone is now ignored, making slight adjustments to aim a little easier. The deadzone was meant to assist mining and building, but it is a hindrance in ranged combat.
This commit is contained in:
@@ -115,8 +115,15 @@ public abstract class MouseMixin implements MouseAccessor {
|
||||
cursorXSmoother.clear();
|
||||
cursorYSmoother.clear();
|
||||
}
|
||||
net.minecraft.item.ItemStack items = client.player != null ? client.player.getActiveItem() : net.minecraft.item.ItemStack.EMPTY;
|
||||
boolean isUsingLongRangedTool = (leftButtonClicked &&
|
||||
items.getUseAction() == net.minecraft.util.UseAction.BOW &&
|
||||
items.getUseAction() == net.minecraft.util.UseAction.CROSSBOW &&
|
||||
items.getUseAction() == net.minecraft.util.UseAction.SPEAR)
|
||||
||
|
||||
items.getItem() instanceof net.minecraft.item.ThrowablePotionItem;
|
||||
EyeTrackerHandler.updateMouseWithEyeTracking(x + cursorDeltaX, y + cursorDeltaY, client,
|
||||
lastMouseUpdateTime, leftButtonClicked, cursorXSmoother, cursorYSmoother);
|
||||
lastMouseUpdateTime, leftButtonClicked, isUsingLongRangedTool, cursorXSmoother, cursorYSmoother);
|
||||
lastMouseUpdateTime = GlfwUtil.getTime();
|
||||
cursorDeltaX = 0.0;
|
||||
cursorDeltaY = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user