mirror of
https://github.com/darksaid98/draggable_lists.git
synced 2026-12-01 14:38:47 +00:00
1 file changed
+16
-2
+16
-2
@@ -1,20 +1,31 @@
|
||||
package com.mrmelon54.DraggableLists.mixin.packs;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
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.TransferableSelectionList;
|
||||
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.Shadow;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(PackSelectionScreen.class)
|
||||
public class PackSelectionScreenMixin extends Screen {
|
||||
public abstract class PackSelectionScreenMixin extends Screen {
|
||||
@Shadow
|
||||
private TransferableSelectionList selectedPackList;
|
||||
|
||||
@Shadow
|
||||
private TransferableSelectionList availablePackList;
|
||||
|
||||
@Shadow @Final private PackSelectionModel model;
|
||||
|
||||
@Shadow protected abstract void closeWatcher();
|
||||
|
||||
protected PackSelectionScreenMixin(Component component) {
|
||||
super(component);
|
||||
}
|
||||
@@ -44,6 +55,9 @@ public class PackSelectionScreenMixin extends Screen {
|
||||
public void onClose() {
|
||||
if (selectedPackList.isDragging()) selectedPackList.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