Compare commits
@@ -80,14 +80,33 @@ jobs:
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
|
||||
run: |
|
||||
gh release create "${{ inputs.version }}" \
|
||||
--title "${{ inputs.version }}" \
|
||||
--notes "${{ steps.changelog.outputs.changelog }}" \
|
||||
mc-1.21.8/build/libs/anarchymod-mc-1.21.8-${{ inputs.version }}.jar \
|
||||
mc-1.21.9/build/libs/anarchymod-mc-1.21.9-${{ inputs.version }}.jar \
|
||||
mc-1.21.10/build/libs/anarchymod-mc-1.21.10-${{ inputs.version }}.jar \
|
||||
mc-1.21.11/build/libs/anarchymod-mc-1.21.11-${{ inputs.version }}.jar
|
||||
VERSION="${{ inputs.version }}"
|
||||
REPO="${{ github.repository }}"
|
||||
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}"
|
||||
|
||||
NOTES=$(cat <<EOF
|
||||
## Downloads
|
||||
|
||||
| Minecraft Version | Download |
|
||||
|---|---|
|
||||
| 1.21.8 | [\`anarchymod-mc-1.21.8-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.8-${VERSION}.jar) |
|
||||
| 1.21.9 | [\`anarchymod-mc-1.21.9-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.9-${VERSION}.jar) |
|
||||
| 1.21.10 | [\`anarchymod-mc-1.21.10-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.10-${VERSION}.jar) |
|
||||
| 1.21.11 | [\`anarchymod-mc-1.21.11-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.11-${VERSION}.jar) |
|
||||
|
||||
${CHANGELOG}
|
||||
EOF
|
||||
)
|
||||
|
||||
gh release create "${VERSION}" \
|
||||
--title "AnarchyMod ${VERSION}" \
|
||||
--notes "${NOTES}" \
|
||||
mc-1.21.8/build/libs/anarchymod-mc-1.21.8-${VERSION}.jar \
|
||||
mc-1.21.9/build/libs/anarchymod-mc-1.21.9-${VERSION}.jar \
|
||||
mc-1.21.10/build/libs/anarchymod-mc-1.21.10-${VERSION}.jar \
|
||||
mc-1.21.11/build/libs/anarchymod-mc-1.21.11-${VERSION}.jar
|
||||
|
||||
set-after-version:
|
||||
needs: build
|
||||
|
||||
@@ -21,6 +21,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Set version
|
||||
run: sed -i "s/version = \".*\"/version = \"${{ inputs.version }}\"/" build.gradle.kts
|
||||
|
||||
+29
-9
@@ -1,14 +1,34 @@
|
||||
.gradle/
|
||||
build/
|
||||
out/
|
||||
# Compiled plugin files
|
||||
target/
|
||||
|
||||
# IDE files
|
||||
.idea/
|
||||
.vscode/*
|
||||
.settings/*
|
||||
.classpath
|
||||
.project
|
||||
.factorypath
|
||||
|
||||
# UML
|
||||
*.plantuml
|
||||
|
||||
# Gradle
|
||||
.kotlin
|
||||
.gradle
|
||||
**/build/
|
||||
!src/**/build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
*.ipr
|
||||
|
||||
.vscode/
|
||||
|
||||
.DS_Store
|
||||
.kotlin/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
**/run/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[](https://github.com/6b6t/AnarchyMod/actions/workflows/build.yml)
|
||||
[](LICENSE)
|
||||
|
||||
🔓 Client-side Fabric mod for anarchy Minecraft servers — unblocks servers and auto-adds 6b6t to the server list.
|
||||
🔓 Bypass a potential Mojang blacklist of 6b6t - the biggest anarchy server in the world.
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "net.blockhost"
|
||||
version = "1.0.0"
|
||||
version = "1.0.3"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -8,54 +8,57 @@ import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class Domains {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger("AnarchyMod-Domains");
|
||||
private static final String DOMAINS_URL = "https://www.6b6t.org/api/anarchy-mod.json";
|
||||
|
||||
private static final Set<String> DEFAULT = Set.of(
|
||||
"*.6b6t.org", "*.10b10t.org", "*.6b6t.cc", "*.6b6t.me",
|
||||
"*.7b7t.me", "*.8b8t.org", "*.alacity.net",
|
||||
"*.anarchypvp.pw", "*.l2x9.org", "*.simpleanarchy.org"
|
||||
"*.6b6t.org", "*.10b10t.org", "*.6b6t.cc", "*.6b6t.me",
|
||||
"*.7b7t.me", "*.8b8t.org", "*.alacity.net",
|
||||
"*.anarchypvp.pw", "*.l2x9.org", "*.simpleanarchy.org"
|
||||
);
|
||||
|
||||
private static final Set<String> domains = new HashSet<>();
|
||||
private static final Gson gson = new Gson();
|
||||
|
||||
static {
|
||||
DEFAULT.forEach(d -> domains.add(d.toLowerCase()));
|
||||
DEFAULT.forEach(d -> domains.add(d.toLowerCase(Locale.ROOT)));
|
||||
loadRemote();
|
||||
}
|
||||
|
||||
private static void loadRemote() {
|
||||
try {
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
try (HttpClient client = HttpClient.newHttpClient()) {
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create(DOMAINS_URL))
|
||||
.GET()
|
||||
.build();
|
||||
.uri(URI.create(DOMAINS_URL))
|
||||
.timeout(Duration.ofSeconds(15))
|
||||
.GET()
|
||||
.build();
|
||||
|
||||
HttpResponse<String> response =
|
||||
client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
|
||||
JsonObject json = gson.fromJson(response.body(), JsonObject.class);
|
||||
JsonArray array = json.getAsJsonArray("domains");
|
||||
if (array == null) return;
|
||||
|
||||
array.forEach(element ->
|
||||
domains.add(element.getAsString().toLowerCase())
|
||||
domains.add(element.getAsString().toLowerCase(Locale.ROOT))
|
||||
);
|
||||
|
||||
} catch (Exception ignored) {
|
||||
} catch (Throwable t) {
|
||||
LOGGER.warning("Failed to load domains from remote, using defaults: " + t.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean contains(String input) {
|
||||
if (input == null) return false;
|
||||
|
||||
String domain = input.toLowerCase();
|
||||
String domain = input.toLowerCase(Locale.ROOT);
|
||||
|
||||
if (domain.startsWith("*.")) {
|
||||
domain = domain.substring(2);
|
||||
@@ -67,7 +70,6 @@ public class Domains {
|
||||
}
|
||||
|
||||
for (String entry : domains) {
|
||||
|
||||
if (entry.startsWith("*.")) {
|
||||
String base = entry.substring(2);
|
||||
if (domain.equals(base) || domain.endsWith("." + base)) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 292 B |
@@ -17,6 +17,12 @@ base {
|
||||
repositories {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources.srcDir(project(":common").sourceSets["main"].resources.srcDirs)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
@@ -25,11 +31,6 @@ dependencies {
|
||||
implementation(project(":common"))
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output)
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("minecraft_version", minecraftVersion)
|
||||
@@ -57,6 +58,8 @@ java {
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output.classesDirs)
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("RETURN"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ServerListMixin {
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
@Inject(method = "load", at = @At("RETURN"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"description": "Bypass a potential Mojang blacklist of 6b6t - the biggest anarchy server in the world.",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
@@ -21,6 +21,13 @@
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"modmenu.discord": "https://6b6t.org/discord"
|
||||
}
|
||||
}
|
||||
},
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
|
||||
@@ -17,6 +17,12 @@ base {
|
||||
repositories {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources.srcDir(project(":common").sourceSets["main"].resources.srcDirs)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
@@ -25,11 +31,6 @@ dependencies {
|
||||
implementation(project(":common"))
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output)
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("minecraft_version", minecraftVersion)
|
||||
@@ -57,6 +58,8 @@ java {
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output.classesDirs)
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("RETURN"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ServerListMixin {
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
@Inject(method = "load", at = @At("RETURN"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"description": "Bypass a potential Mojang blacklist of 6b6t - the biggest anarchy server in the world.",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
@@ -21,6 +21,13 @@
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"modmenu.discord": "https://6b6t.org/discord"
|
||||
}
|
||||
}
|
||||
},
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
|
||||
@@ -17,6 +17,12 @@ base {
|
||||
repositories {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources.srcDir(project(":common").sourceSets["main"].resources.srcDirs)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
@@ -25,11 +31,6 @@ dependencies {
|
||||
implementation(project(":common"))
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output)
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("minecraft_version", minecraftVersion)
|
||||
@@ -57,6 +58,8 @@ java {
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output.classesDirs)
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("RETURN"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ServerListMixin {
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
@Inject(method = "load", at = @At("RETURN"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"description": "Bypass a potential Mojang blacklist of 6b6t - the biggest anarchy server in the world.",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
@@ -21,6 +21,13 @@
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"modmenu.discord": "https://6b6t.org/discord"
|
||||
}
|
||||
}
|
||||
},
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
|
||||
@@ -17,6 +17,12 @@ base {
|
||||
repositories {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
resources.srcDir(project(":common").sourceSets["main"].resources.srcDirs)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
@@ -25,11 +31,6 @@ dependencies {
|
||||
implementation(project(":common"))
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output)
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("minecraft_version", minecraftVersion)
|
||||
@@ -57,6 +58,8 @@ java {
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output.classesDirs)
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("RETURN"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ServerListMixin {
|
||||
@Final
|
||||
private List<ServerData> serverList;
|
||||
|
||||
@Inject(method = "load", at = @At("TAIL"))
|
||||
@Inject(method = "load", at = @At("RETURN"))
|
||||
public void afterLoad(CallbackInfo ci) {
|
||||
if (serverList.stream().noneMatch(data -> Domains.contains(data.ip))) {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"description": "Bypass a potential Mojang blacklist of 6b6t - the biggest anarchy server in the world.",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
@@ -21,6 +21,13 @@
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"modmenu.discord": "https://6b6t.org/discord"
|
||||
}
|
||||
}
|
||||
},
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
|
||||
Reference in New Issue
Block a user