Fixed GUI rendering

This commit is contained in:
FlorianMichael 2024-02-14 23:18:56 +01:00
parent 25af1896f5
commit 10547649ad
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
6 changed files with 14 additions and 8 deletions

View File

@ -27,6 +27,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -133,12 +134,12 @@ public class GuiProtocolSelector extends GuiScreen {
@Override
protected int getSize() {
return ProtocolVersion.getProtocols().size();
return ProtocolVersionList.getProtocolsNewToOld().size();
}
@Override
protected void elementClicked(int index, boolean b, int i1, int i2) {
finishedCallback.finished(ProtocolVersion.getProtocols().get(index), parent);
finishedCallback.finished(ProtocolVersionList.getProtocolsNewToOld().get(index), parent);
}
@Override
@ -154,7 +155,7 @@ public class GuiProtocolSelector extends GuiScreen {
@Override
protected void drawSlot(int index, int x, int y, int slotHeight, int mouseX, int mouseY, float partialTicks) {
final ProtocolVersion targetVersion = ViaForgeCommon.getManager().getTargetVersion();
final ProtocolVersion version = ProtocolVersion.getProtocols().get(index);
final ProtocolVersion version = ProtocolVersionList.getProtocolsNewToOld().get(index);
String color;
if (targetVersion == version) {

View File

@ -30,6 +30,7 @@ import net.minecraft.client.gui.widget.list.ExtendedList;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
@ -122,7 +123,7 @@ public class GuiProtocolSelector extends Screen {
public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) {
super(client, width, height, top, bottom, slotHeight);
for (ProtocolVersion version : ProtocolVersion.getProtocols()) {
for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) {
addEntry(new SlotEntry(version));
}
}

View File

@ -30,6 +30,7 @@ import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.glfw.GLFW;
import java.util.UUID;
@ -121,7 +122,7 @@ public class GuiProtocolSelector extends Screen {
public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) {
super(client, width, height, top, bottom, slotHeight);
for (ProtocolVersion version : ProtocolVersion.getProtocols()) {
for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) {
addEntry(new SlotEntry(version));
}
}

View File

@ -30,6 +30,7 @@ import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.glfw.GLFW;
import java.util.UUID;
@ -121,7 +122,7 @@ public class GuiProtocolSelector extends Screen {
public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) {
super(client, width, height, top, bottom, slotHeight);
for (ProtocolVersion version : ProtocolVersion.getProtocols()) {
for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) {
addEntry(new SlotEntry(version));
}
}

View File

@ -29,6 +29,7 @@ import net.minecraft.client.gui.components.ObjectSelectionList;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.glfw.GLFW;
import java.util.UUID;
@ -120,7 +121,7 @@ public class GuiProtocolSelector extends Screen {
public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) {
super(client, width, height, top, bottom, slotHeight);
for (ProtocolVersion version : ProtocolVersion.getProtocols()) {
for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) {
addEntry(new SlotEntry(version));
}
}

View File

@ -29,6 +29,7 @@ import net.minecraft.client.gui.components.ObjectSelectionList;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.raphimc.vialoader.util.ProtocolVersionList;
import org.lwjgl.glfw.GLFW;
import java.util.UUID;
@ -120,7 +121,7 @@ public class GuiProtocolSelector extends Screen {
public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) {
super(client, width, height - top - bottom, top, slotHeight);
for (ProtocolVersion version : ProtocolVersion.getProtocols()) {
for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) {
addEntry(new SlotEntry(version));
}
}