Added feature where 6b6t is automatically added to the server list if not already there
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package me.itskronx11.anarchymod.mixin;
|
||||
|
||||
import me.itskronx11.anarchymod.Domains;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.multiplayer.ServerList;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ServerList.class)
|
||||
public class ServerListMixin {
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
"package": "me.itskronx11.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin"
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.itskronx11.anarchymod.mixin;
|
||||
|
||||
import me.itskronx11.anarchymod.Domains;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.multiplayer.ServerList;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ServerList.class)
|
||||
public class ServerListMixin {
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
"package": "me.itskronx11.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin"
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.itskronx11.anarchymod.mixin;
|
||||
|
||||
import me.itskronx11.anarchymod.Domains;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.multiplayer.ServerList;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ServerList.class)
|
||||
public class ServerListMixin {
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
"package": "me.itskronx11.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin"
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.itskronx11.anarchymod.mixin;
|
||||
|
||||
import me.itskronx11.anarchymod.Domains;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.multiplayer.ServerList;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ServerList.class)
|
||||
public class ServerListMixin {
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
"package": "me.itskronx11.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin"
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
Reference in New Issue
Block a user