mirror of
https://github.com/darksaid98/draggable_lists.git
synced 2026-12-02 22:16:55 +00:00
1 file changed
+16
-2
+16
-2
@@ -1,20 +1,31 @@
|
|||||||
package com.mrmelon54.DraggableLists.mixin.packs;
|
package com.mrmelon54.DraggableLists.mixin.packs;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.packs.PackSelectionModel;
|
||||||
import net.minecraft.client.gui.screens.packs.PackSelectionScreen;
|
import net.minecraft.client.gui.screens.packs.PackSelectionScreen;
|
||||||
import net.minecraft.client.gui.screens.packs.TransferableSelectionList;
|
import net.minecraft.client.gui.screens.packs.TransferableSelectionList;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mixin(PackSelectionScreen.class)
|
@Mixin(PackSelectionScreen.class)
|
||||||
public class PackSelectionScreenMixin extends Screen {
|
public abstract class PackSelectionScreenMixin extends Screen {
|
||||||
@Shadow
|
@Shadow
|
||||||
private TransferableSelectionList selectedPackList;
|
private TransferableSelectionList selectedPackList;
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
private TransferableSelectionList availablePackList;
|
private TransferableSelectionList availablePackList;
|
||||||
|
|
||||||
|
@Shadow @Final private PackSelectionModel model;
|
||||||
|
|
||||||
|
@Shadow protected abstract void closeWatcher();
|
||||||
|
|
||||||
protected PackSelectionScreenMixin(Component component) {
|
protected PackSelectionScreenMixin(Component component) {
|
||||||
super(component);
|
super(component);
|
||||||
}
|
}
|
||||||
@@ -44,6 +55,9 @@ public class PackSelectionScreenMixin extends Screen {
|
|||||||
public void onClose() {
|
public void onClose() {
|
||||||
if (selectedPackList.isDragging()) selectedPackList.mouseReleased(0, 0, 0);
|
if (selectedPackList.isDragging()) selectedPackList.mouseReleased(0, 0, 0);
|
||||||
if (availablePackList.isDragging()) availablePackList.mouseReleased(0, 0, 0);
|
if (availablePackList.isDragging()) availablePackList.mouseReleased(0, 0, 0);
|
||||||
super.onClose();
|
|
||||||
|
// from PackSelectionScreen::onClose()
|
||||||
|
this.model.commit();
|
||||||
|
this.closeWatcher();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user