mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 23:25:10 +01:00
Even more touchscreen improvements
- Fixed #222 Touch-specific improvements - Interactive items can now be used correctly - Drop button now works - Most Keybinds will now work correctly while in touchscreen mode - Added Touch category to simple options screen
This commit is contained in:
@@ -4,6 +4,8 @@ import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.entity.projectile.ProjectileUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.UseAction;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
@@ -57,4 +59,8 @@ public class TouchUtils {
|
||||
|
||||
return new Vec3d(target.x, target.y, target.z).add(camera.getPos());
|
||||
}
|
||||
public static boolean hasInWorldUseAction(ItemStack stack) {
|
||||
UseAction action = stack.getUseAction();
|
||||
return action == UseAction.BOW || action == UseAction.BRUSH || action == UseAction.SPEAR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user