mirror of
https://github.com/ViaVersion/ViaForge.git
synced 2024-11-08 10:09:36 +01:00
Fixed GUI rendering
This commit is contained in:
parent
25af1896f5
commit
10547649ad
@ -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) {
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user