Item Generator and Server finder
This commit is contained in:
committed by
Cloudburst
parent
ea106d6f70
commit
97d42528bc
@@ -0,0 +1,12 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(MultiplayerScreen.class)
|
||||
public interface MultiplayerScreenAccessor {
|
||||
@Accessor("serverListWidget")
|
||||
MultiplayerServerListWidget getServerListWidget();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import anticope.rejects.gui.servers.ServerManagerScreen;
|
||||
import meteordevelopment.meteorclient.gui.GuiThemes;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(MultiplayerScreen.class)
|
||||
public abstract class MultiplayerScreenMixin extends Screen {
|
||||
protected MultiplayerScreenMixin(Text title) {
|
||||
super(title);
|
||||
}
|
||||
|
||||
@Inject(method = "init", at = @At("TAIL"))
|
||||
private void onInit(CallbackInfo info) {
|
||||
addDrawableChild(new ButtonWidget(this.width - 75 - 3 - 75 - 2 - 75 - 2, 3, 75, 20, Text.literal("Servers"), button -> {
|
||||
client.setScreen(new ServerManagerScreen(GuiThemes.get(), (MultiplayerScreen) (Object) this));
|
||||
}));
|
||||
}
|
||||
}
|
||||
14
src/main/java/anticope/rejects/mixin/ServerListAccessor.java
Normal file
14
src/main/java/anticope/rejects/mixin/ServerListAccessor.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package anticope.rejects.mixin;
|
||||
|
||||
import net.minecraft.client.network.ServerInfo;
|
||||
import net.minecraft.client.option.ServerList;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ServerList.class)
|
||||
public interface ServerListAccessor {
|
||||
@Accessor
|
||||
List<ServerInfo> getServers();
|
||||
}
|
||||
Reference in New Issue
Block a user