Skip to content

Commit

Permalink
start and login
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamesuta committed Jan 27, 2018
1 parent 0f49bde commit 898cb60
Show file tree
Hide file tree
Showing 19 changed files with 194 additions and 125 deletions.
25 changes: 13 additions & 12 deletions 1.10.2/src/main/java/net/teamfruit/serverobserver/Compat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.teamfruit.serverobserver;

import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;

import javax.annotation.Nonnull;

Expand All @@ -12,11 +13,11 @@
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiListExtended.IGuiListEntry;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ServerListEntryNormal;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
Expand Down Expand Up @@ -77,6 +78,11 @@ public void setPinged(final ServerData serverData, final boolean pinged) {
serverData.pinged = pinged;
}

@Override
public void ping(final GuiMultiplayer mpgui, final ServerData serverData) throws Exception {
mpgui.getOldServerPinger().ping(serverData);
}

@Override
public String getDefaultSound() {
return SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP.getSoundName().toString();
Expand All @@ -92,29 +98,24 @@ public void selectServer(final GuiMultiplayer mpgui, final int index) {
mpgui.selectServer(index);
}

@Override
public int countServers(final GuiMultiplayer mpgui) {
return mpgui.getServerList().countServers();
}

@Override
public ServerData getServerData(final GuiMultiplayer mpgui, final int index) {
return mpgui.getServerList().getServerData(index);
}

@Override
public IGuiListEntry getListEntry(final GuiMultiplayer mpgui, final int index) {
return mpgui.serverListSelector.getListEntry(index);
public ServerList getServerList(final GuiMultiplayer mpgui) {
return mpgui.getServerList();
}

@Override
public ServerData getServerData(final ServerListEntryNormal entry) {
return entry.getServerData();
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
}

@Override
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
public ThreadPoolExecutor getThreadPool() {
return ServerListEntryNormal.EXECUTOR;
}

public static class SkeletonButton extends GuiButton {
Expand Down
3 changes: 2 additions & 1 deletion 1.10.2/src/main/resources/META-INF/serverobserver_at.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public net.minecraft.client.gui.GuiMultiplayer field_146803_h # serverListSelector
public net.minecraft.client.gui.GuiDisconnected field_175353_i # textHeight
public net.minecraft.client.gui.GuiDisconnected field_146307_h # parentScreen
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.ServerListEntryNormal field_148302_b # threadPool
25 changes: 13 additions & 12 deletions 1.11.2/src/main/java/net/teamfruit/serverobserver/Compat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.teamfruit.serverobserver;

import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;

import javax.annotation.Nonnull;

Expand All @@ -12,11 +13,11 @@
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiListExtended.IGuiListEntry;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ServerListEntryNormal;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
Expand Down Expand Up @@ -77,6 +78,11 @@ public void setPinged(final ServerData serverData, final boolean pinged) {
serverData.pinged = pinged;
}

@Override
public void ping(final GuiMultiplayer mpgui, final ServerData serverData) throws Exception {
mpgui.getOldServerPinger().ping(serverData);
}

@Override
public String getDefaultSound() {
return SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP.getSoundName().toString();
Expand All @@ -92,29 +98,24 @@ public void selectServer(final GuiMultiplayer mpgui, final int index) {
mpgui.selectServer(index);
}

@Override
public int countServers(final GuiMultiplayer mpgui) {
return mpgui.getServerList().countServers();
}

@Override
public ServerData getServerData(final GuiMultiplayer mpgui, final int index) {
return mpgui.getServerList().getServerData(index);
}

@Override
public IGuiListEntry getListEntry(final GuiMultiplayer mpgui, final int index) {
return mpgui.serverListSelector.getListEntry(index);
public ServerList getServerList(final GuiMultiplayer mpgui) {
return mpgui.getServerList();
}

@Override
public ServerData getServerData(final ServerListEntryNormal entry) {
return entry.getServerData();
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
}

@Override
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
public ThreadPoolExecutor getThreadPool() {
return ServerListEntryNormal.EXECUTOR;
}

public static class SkeletonButton extends GuiButton {
Expand Down
3 changes: 2 additions & 1 deletion 1.11.2/src/main/resources/META-INF/serverobserver_at.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public net.minecraft.client.gui.GuiMultiplayer field_146803_h # serverListSelector
public net.minecraft.client.gui.GuiDisconnected field_175353_i # textHeight
public net.minecraft.client.gui.GuiDisconnected field_146307_h # parentScreen
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.ServerListEntryNormal field_148302_b # threadPool
25 changes: 13 additions & 12 deletions 1.12.2/src/main/java/net/teamfruit/serverobserver/Compat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.teamfruit.serverobserver;

import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;

import javax.annotation.Nonnull;

Expand All @@ -12,11 +13,11 @@
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiListExtended.IGuiListEntry;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ServerListEntryNormal;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
Expand Down Expand Up @@ -77,6 +78,11 @@ public void setPinged(final ServerData serverData, final boolean pinged) {
serverData.pinged = pinged;
}

@Override
public void ping(final GuiMultiplayer mpgui, final ServerData serverData) throws Exception {
mpgui.getOldServerPinger().ping(serverData);
}

@Override
public String getDefaultSound() {
return SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP.getSoundName().toString();
Expand All @@ -92,29 +98,24 @@ public void selectServer(final GuiMultiplayer mpgui, final int index) {
mpgui.selectServer(index);
}

@Override
public int countServers(final GuiMultiplayer mpgui) {
return mpgui.getServerList().countServers();
}

@Override
public ServerData getServerData(final GuiMultiplayer mpgui, final int index) {
return mpgui.getServerList().getServerData(index);
}

@Override
public IGuiListEntry getListEntry(final GuiMultiplayer mpgui, final int index) {
return mpgui.serverListSelector.getListEntry(index);
public ServerList getServerList(final GuiMultiplayer mpgui) {
return mpgui.getServerList();
}

@Override
public ServerData getServerData(final ServerListEntryNormal entry) {
return entry.getServerData();
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
}

@Override
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
public ThreadPoolExecutor getThreadPool() {
return ServerListEntryNormal.EXECUTOR;
}

public static class SkeletonButton extends GuiButton {
Expand Down
3 changes: 2 additions & 1 deletion 1.12.2/src/main/resources/META-INF/serverobserver_at.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public net.minecraft.client.gui.GuiMultiplayer field_146803_h # serverListSelector
public net.minecraft.client.gui.GuiDisconnected field_175353_i # textHeight
public net.minecraft.client.gui.GuiDisconnected field_146307_h # parentScreen
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.ServerListEntryNormal field_148302_b # threadPool
21 changes: 11 additions & 10 deletions 1.7.10/src/main/java/net/teamfruit/serverobserver/Compat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.teamfruit.serverobserver;

import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;

import javax.annotation.Nonnull;

Expand All @@ -11,11 +12,11 @@
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiListExtended.IGuiListEntry;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ServerListEntryNormal;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
Expand Down Expand Up @@ -75,6 +76,11 @@ public void setPinged(final ServerData serverData, final boolean pinged) {
serverData.field_78841_f = pinged;
}

@Override
public void ping(final GuiMultiplayer mpgui, final ServerData serverData) throws Exception {
mpgui.func_146789_i().func_147224_a(serverData);
}

private final String defaultSound = "minecraft:random.orb";

@Override
Expand All @@ -93,8 +99,8 @@ public void selectServer(final GuiMultiplayer mpgui, final int index) {
}

@Override
public int countServers(final GuiMultiplayer mpgui) {
return mpgui.func_146795_p().countServers();
public ServerList getServerList(final GuiMultiplayer mpgui) {
return mpgui.func_146795_p();
}

@Override
Expand All @@ -103,13 +109,8 @@ public ServerData getServerData(final GuiMultiplayer mpgui, final int index) {
}

@Override
public IGuiListEntry getListEntry(final GuiMultiplayer mpgui, final int index) {
return mpgui.field_146803_h.getListEntry(index);
}

@Override
public ServerData getServerData(final ServerListEntryNormal entry) {
return entry.func_148296_a();
public ThreadPoolExecutor getThreadPool() {
return ServerListEntryNormal.field_148302_b;
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion 1.7.10/src/main/resources/META-INF/serverobserver_at.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public net.minecraft.client.gui.GuiMultiplayer field_146803_h # serverListSelector
public net.minecraft.client.gui.GuiDisconnected field_175353_i # textHeight
public net.minecraft.client.gui.GuiDisconnected field_146307_h # parentScreen
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.ServerListEntryNormal field_148302_b # threadPool
25 changes: 13 additions & 12 deletions 1.8.9/src/main/java/net/teamfruit/serverobserver/Compat.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.teamfruit.serverobserver;

import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;

import javax.annotation.Nonnull;

Expand All @@ -11,11 +12,11 @@
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiListExtended.IGuiListEntry;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ServerListEntryNormal;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
Expand Down Expand Up @@ -74,6 +75,11 @@ public void setPinged(final ServerData serverData, final boolean pinged) {
serverData.field_78841_f = pinged;
}

@Override
public void ping(final GuiMultiplayer mpgui, final ServerData serverData) throws Exception {
mpgui.getOldServerPinger().ping(serverData);
}

private final String defaultSound = "minecraft:random.orb";

@Override
Expand All @@ -91,29 +97,24 @@ public void selectServer(final GuiMultiplayer mpgui, final int index) {
mpgui.selectServer(index);
}

@Override
public int countServers(final GuiMultiplayer mpgui) {
return mpgui.getServerList().countServers();
}

@Override
public ServerData getServerData(final GuiMultiplayer mpgui, final int index) {
return mpgui.getServerList().getServerData(index);
}

@Override
public IGuiListEntry getListEntry(final GuiMultiplayer mpgui, final int index) {
return mpgui.serverListSelector.getListEntry(index);
public ServerList getServerList(final GuiMultiplayer mpgui) {
return mpgui.getServerList();
}

@Override
public ServerData getServerData(final ServerListEntryNormal entry) {
return entry.getServerData();
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
}

@Override
public GuiButton createSkeletonButton(final int buttonId, final int x, final int y, final int widthIn, final int heightIn, final String buttonText, final SkeletonButtonDrawInside inside) {
return new SkeletonButton(this, buttonId, x, y, widthIn, heightIn, buttonText, inside);
public ThreadPoolExecutor getThreadPool() {
return ServerListEntryNormal.field_148302_b;
}

public static class SkeletonButton extends GuiButton {
Expand Down
3 changes: 2 additions & 1 deletion 1.8.9/src/main/resources/META-INF/serverobserver_at.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public net.minecraft.client.gui.GuiMultiplayer field_146803_h # serverListSelector
public net.minecraft.client.gui.GuiDisconnected field_175353_i # textHeight
public net.minecraft.client.gui.GuiDisconnected field_146307_h # parentScreen
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.GuiMultiplayer func_146791_a(Lnet/minecraft/client/multiplayer/ServerData;)V # connectToServer
public net.minecraft.client.gui.ServerListEntryNormal field_148302_b # threadPool
Loading

0 comments on commit 898cb60

Please sign in to comment.