mirror of
https://github.com/darksaid98/draggable_lists.git
synced 2026-12-01 14:38:47 +00:00
Fixes #18 - Reset cursor when screen changes
This commit is contained in:
2 files changed
+26
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package com.mrmelon54.DraggableLists.mixin;
|
||||
|
||||
import com.mojang.blaze3d.platform.Window;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Minecraft.class)
|
||||
public abstract class MinecraftMixin {
|
||||
@Shadow
|
||||
public abstract Window getWindow();
|
||||
|
||||
@Inject(method = "setScreen", at = @At("HEAD"))
|
||||
private void injectedSetScreen(Screen screen, CallbackInfo ci) {
|
||||
// reset cursor when screen changes
|
||||
GLFW.glfwSetCursor(getWindow().getWindow(), GLFW.glfwCreateStandardCursor(GLFW.GLFW_ARROW_CURSOR));
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,12 @@
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"minVersion": "0.8",
|
||||
"client": [
|
||||
"packs.PackSelectionModelMixin",
|
||||
"MinecraftMixin",
|
||||
"packs.PackSelectionModel_EntryBaseMixin",
|
||||
"packs.PackSelectionModelMixin",
|
||||
"packs.PackSelectionScreenMixin",
|
||||
"packs.TransferableSelectionListMixin",
|
||||
"packs.TransferableSelectionList_PackEntryMixin",
|
||||
"packs.TransferableSelectionListMixin",
|
||||
"server.JoinMultiplayerScreenMixin",
|
||||
"server.OnlineServerEntryMixin",
|
||||
"server.ServerListMixin",
|
||||
|
||||
Reference in new issue
Block a user