mirror of
https://github.com/darksaid98/draggable_lists.git
synced 2026-12-01 22:15:45 +00:00
Update some stuff before 1.20.4
This commit is contained in:
14 files changed
+88
-76
No files matched your search
+6
-6
@@ -35,7 +35,7 @@ public abstract class MixinTransferableSelectionList extends ObjectSelectionList
|
||||
private double draggable_lists$softScrollingOrigin = 0;
|
||||
|
||||
public MixinTransferableSelectionList(Minecraft minecraft, int i, int j, int k, int l, int m) {
|
||||
super(minecraft, i, j, k, l, m);
|
||||
super(minecraft, i, j, k, l);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,7 +97,7 @@ public abstract class MixinTransferableSelectionList extends ObjectSelectionList
|
||||
|
||||
@Unique
|
||||
boolean draggable_lists$updateDragEvent(double mouseX, double mouseY) {
|
||||
if (mouseX < x0) {
|
||||
if (mouseX < getX()) {
|
||||
draggable_lists$draggingStartX = mouseX;
|
||||
}
|
||||
double y = draggable_lists$capYCoordinate((int) mouseY, true);
|
||||
@@ -122,7 +122,7 @@ public abstract class MixinTransferableSelectionList extends ObjectSelectionList
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
|
||||
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
|
||||
super.render(guiGraphics, mouseX, mouseY, delta);
|
||||
|
||||
if (this.draggable_lists$draggingObject instanceof ResourcePackEntryDuckProvider duckProvider) {
|
||||
@@ -157,8 +157,8 @@ public abstract class MixinTransferableSelectionList extends ObjectSelectionList
|
||||
|
||||
@Unique
|
||||
int draggable_lists$capYCoordinate(int y, boolean useScreenSpace) {
|
||||
int scrollableTop = y0 + (useScreenSpace ? 0 : (int) Math.max(headerHeight - getScrollAmount() + 2, 0)) + 2;
|
||||
int scrollableHeight = y1 - y0 - (useScreenSpace ? 0 : itemHeight + (int) Math.max(headerHeight - getScrollAmount() + 2, 0));
|
||||
int scrollableTop = getY() + (useScreenSpace ? 0 : (int) Math.max(headerHeight - getScrollAmount() + 2, 0)) + 2;
|
||||
int scrollableHeight = getBottom() - getY() - (useScreenSpace ? 0 : itemHeight + (int) Math.max(headerHeight - getScrollAmount() + 2, 0));
|
||||
if (y < scrollableTop) y = scrollableTop;
|
||||
if (y > scrollableTop + scrollableHeight) y = scrollableTop + scrollableHeight;
|
||||
return y;
|
||||
@@ -176,7 +176,7 @@ public abstract class MixinTransferableSelectionList extends ObjectSelectionList
|
||||
|
||||
@Unique
|
||||
boolean draggable_lists$dragResourcePack(ResourcePackEntryDuckProvider underlyingPackProvider, double mouseY) {
|
||||
int m = Mth.floor(mouseY - (double) y0) - this.headerHeight + (int) this.getScrollAmount() - 4;
|
||||
int m = Mth.floor(mouseY - (double) getY()) - this.headerHeight + (int) this.getScrollAmount() - 4;
|
||||
int n = m / this.itemHeight;
|
||||
|
||||
PackSelectionModel.Entry pack = underlyingPackProvider.draggable_lists$getUnderlyingPack();
|
||||
|
||||
+6
-6
@@ -53,7 +53,7 @@ public abstract class MixinServerSelectionList extends ObjectSelectionList<Serve
|
||||
private double draggable_lists$softScrollingOrigin = 0;
|
||||
|
||||
public MixinServerSelectionList(Minecraft minecraftClient, int i, int j, int k, int l, int m) {
|
||||
super(minecraftClient, i, j, k, l, m);
|
||||
super(minecraftClient, i, j, k, l);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,8 +138,8 @@ public abstract class MixinServerSelectionList extends ObjectSelectionList<Serve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
|
||||
super.render(guiGraphics, mouseX, mouseY, delta);
|
||||
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
|
||||
super.renderWidget(guiGraphics, mouseX, mouseY, delta);
|
||||
|
||||
if (this.draggable_lists$draggingObject instanceof ServerEntryDuckProvider duckProvider) {
|
||||
int z = Mth.floor(mouseY + draggable_lists$draggingOffsetY);
|
||||
@@ -173,8 +173,8 @@ public abstract class MixinServerSelectionList extends ObjectSelectionList<Serve
|
||||
|
||||
@Unique
|
||||
int draggable_lists$capYCoordinate(int y, boolean useScreenSpace) {
|
||||
int scrollableTop = y0 + 4;
|
||||
int scrollableHeight = y1 - y0 - (useScreenSpace ? 2 : itemHeight + 2);
|
||||
int scrollableTop = y + 4;
|
||||
int scrollableHeight = getBottom() - getY() - (useScreenSpace ? 2 : itemHeight + 2);
|
||||
if (y < scrollableTop) y = scrollableTop;
|
||||
if (y > scrollableTop + scrollableHeight) y = scrollableTop + scrollableHeight;
|
||||
return y;
|
||||
@@ -196,7 +196,7 @@ public abstract class MixinServerSelectionList extends ObjectSelectionList<Serve
|
||||
int i = multiplayerScreenDuckProvider.draggable_lists$getIndexOfServerInfo(underlyingServerProvider.draggable_lists$getUnderlyingServer());
|
||||
if (i == -1) return false;
|
||||
|
||||
int m = Mth.floor(mouseY - (double) this.y0) - this.headerHeight + (int) this.getScrollAmount() - 4;
|
||||
int m = Mth.floor(mouseY - (double) this.getY()) - this.headerHeight + (int) this.getScrollAmount() - 4;
|
||||
int n = m / this.itemHeight;
|
||||
|
||||
if (n >= 0 && n < onlineServers.size()) {
|
||||
|
||||
Reference in new issue
Block a user