Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c8cf83e7f | ||
|
|
1a571e42e2 | ||
|
|
ddd6174fc0 | ||
|
|
ff15da1b62 | ||
|
|
209f02c6cd | ||
|
|
f64fb2dfdb | ||
|
|
213061f125 | ||
|
|
6a6c92ea0a | ||
|
|
61ec7e32cc | ||
|
|
5c1d513d35 | ||
|
|
7e3c9abbca | ||
|
|
1d3527b834 | ||
|
|
e102f65531 | ||
|
|
8ee4a0763c | ||
|
|
d985762d7a | ||
|
|
493a15d34d | ||
|
|
7ae7110f90 | ||
|
|
bba6fc3b3e | ||
|
|
5d32b1a447 | ||
|
|
026a1260f9 | ||
|
|
b85506f476 | ||
|
|
0a3b019962 | ||
|
|
d2676ac1d2 | ||
|
|
37815c4858 | ||
|
|
d5317783f0 | ||
|
|
1f623d9501 | ||
|
|
16ce2ccbd2 | ||
|
|
4803212976 | ||
|
|
7a0b60c559 | ||
|
|
7a9d02673b | ||
|
|
9159dff6ad | ||
|
|
0fbb447f7a | ||
|
|
e07e8ab1da | ||
|
|
35820562be | ||
|
|
0fe333b7be | ||
|
|
b46282d294 | ||
|
|
8ca683768a | ||
|
|
c8c7699d9e | ||
|
|
95962939a2 |
+122
-8
@@ -2,7 +2,7 @@ name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
@@ -14,32 +14,146 @@ jobs:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
java-version: 25
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v5
|
||||
- uses: gradle/actions/setup-gradle@v6
|
||||
|
||||
- run: ./gradlew build
|
||||
- run: ./gradlew chiseledBuild
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.19.4
|
||||
path: versions/1.19.4/build/libs/anarchymod-mc-1.19.4-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20
|
||||
path: versions/1.20/build/libs/anarchymod-mc-1.20-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20.1
|
||||
path: versions/1.20.1/build/libs/anarchymod-mc-1.20.1-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20.2
|
||||
path: versions/1.20.2/build/libs/anarchymod-mc-1.20.2-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20.3
|
||||
path: versions/1.20.3/build/libs/anarchymod-mc-1.20.3-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20.4
|
||||
path: versions/1.20.4/build/libs/anarchymod-mc-1.20.4-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20.5
|
||||
path: versions/1.20.5/build/libs/anarchymod-mc-1.20.5-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.20.6
|
||||
path: versions/1.20.6/build/libs/anarchymod-mc-1.20.6-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21
|
||||
path: versions/1.21/build/libs/anarchymod-mc-1.21-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.1
|
||||
path: versions/1.21.1/build/libs/anarchymod-mc-1.21.1-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.2
|
||||
path: versions/1.21.2/build/libs/anarchymod-mc-1.21.2-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.3
|
||||
path: versions/1.21.3/build/libs/anarchymod-mc-1.21.3-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.4
|
||||
path: versions/1.21.4/build/libs/anarchymod-mc-1.21.4-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.5
|
||||
path: versions/1.21.5/build/libs/anarchymod-mc-1.21.5-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.6
|
||||
path: versions/1.21.6/build/libs/anarchymod-mc-1.21.6-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.7
|
||||
path: versions/1.21.7/build/libs/anarchymod-mc-1.21.7-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.8
|
||||
path: mc-1.21.8/build/libs/anarchymod-mc-1.21.8-*.jar
|
||||
path: versions/1.21.8/build/libs/anarchymod-mc-1.21.8-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.9
|
||||
path: mc-1.21.9/build/libs/anarchymod-mc-1.21.9-*.jar
|
||||
path: versions/1.21.9/build/libs/anarchymod-mc-1.21.9-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.10
|
||||
path: mc-1.21.10/build/libs/anarchymod-mc-1.21.10-*.jar
|
||||
path: versions/1.21.10/build/libs/anarchymod-mc-1.21.10-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-1.21.11
|
||||
path: mc-1.21.11/build/libs/anarchymod-mc-1.21.11-*.jar
|
||||
path: versions/1.21.11/build/libs/anarchymod-mc-1.21.11-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-26.1
|
||||
path: versions/26.1/build/libs/anarchymod-mc-26.1-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-26.1.1
|
||||
path: versions/26.1.1/build/libs/anarchymod-mc-26.1.1-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: anarchymod-mc-26.1.2
|
||||
path: versions/26.1.2/build/libs/anarchymod-mc-26.1.2-*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
name: Release
|
||||
name: Publish Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Release version (e.g. 1.1.0)"
|
||||
description: 'Version to release'
|
||||
required: true
|
||||
after-version:
|
||||
description: "Next snapshot version (e.g. 1.2.0-SNAPSHOT)"
|
||||
description: 'Snapshot version after release'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
set-release-version:
|
||||
uses: ./.github/workflows/set-version.yml
|
||||
@@ -22,28 +19,36 @@ jobs:
|
||||
build:
|
||||
needs: set-release-version
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-java@v5
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v6
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v5
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew chiseledBuild
|
||||
|
||||
- run: ./gradlew build
|
||||
|
||||
- name: Generate changelog
|
||||
- name: Build Changelog
|
||||
id: changelog
|
||||
uses: mikepenz/release-changelog-builder-action@v6
|
||||
with:
|
||||
commitMode: true
|
||||
mode: COMMIT
|
||||
toTag: ${{ github.ref }}
|
||||
configurationJson: |
|
||||
{
|
||||
"template": "#{{CHANGELOG}}",
|
||||
"commit_template": "- [`#{{SHORT_MERGE_SHA}}`](https://github.com/#{{OWNER}}/#{{REPO}}/commit/#{{MERGE_SHA}}) #{{TITLE}}",
|
||||
"categories": [
|
||||
{ "title": "## Features", "labels": ["feat", "feature"] },
|
||||
{ "title": "## Fixes", "labels": ["fix", "bug"] },
|
||||
@@ -53,16 +58,14 @@ jobs:
|
||||
{ "title": "## Build", "labels": ["build", "chore", "ci"] },
|
||||
{ "title": "## Other", "labels": [] }
|
||||
],
|
||||
"empty_template": "no changes",
|
||||
"label_extractor": [
|
||||
{
|
||||
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
|
||||
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
|
||||
"on_property": "title",
|
||||
"method": "match",
|
||||
"target": "$1"
|
||||
}
|
||||
],
|
||||
"template": "#{{CHANGELOG}}",
|
||||
"pr_template": "- [`#{{SHORT_MERGE_SHA}}`](https://github.com/#{{OWNER}}/#{{REPO}}/commit/#{{MERGE_SHA}}) #{{TITLE}}",
|
||||
"custom_placeholders": [
|
||||
{
|
||||
"name": "SHORT_MERGE_SHA",
|
||||
@@ -91,10 +94,29 @@ jobs:
|
||||
|
||||
| Minecraft Version | Download |
|
||||
|---|---|
|
||||
| 1.19.4 | [\`anarchymod-mc-1.19.4-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.19.4-${VERSION}.jar) |
|
||||
| 1.20 | [\`anarchymod-mc-1.20-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20-${VERSION}.jar) |
|
||||
| 1.20.1 | [\`anarchymod-mc-1.20.1-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20.1-${VERSION}.jar) |
|
||||
| 1.20.2 | [\`anarchymod-mc-1.20.2-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20.2-${VERSION}.jar) |
|
||||
| 1.20.3 | [\`anarchymod-mc-1.20.3-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20.3-${VERSION}.jar) |
|
||||
| 1.20.4 | [\`anarchymod-mc-1.20.4-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20.4-${VERSION}.jar) |
|
||||
| 1.20.5 | [\`anarchymod-mc-1.20.5-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20.5-${VERSION}.jar) |
|
||||
| 1.20.6 | [\`anarchymod-mc-1.20.6-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.20.6-${VERSION}.jar) |
|
||||
| 1.21 | [\`anarchymod-mc-1.21-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21-${VERSION}.jar) |
|
||||
| 1.21.1 | [\`anarchymod-mc-1.21.1-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.1-${VERSION}.jar) |
|
||||
| 1.21.2 | [\`anarchymod-mc-1.21.2-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.2-${VERSION}.jar) |
|
||||
| 1.21.3 | [\`anarchymod-mc-1.21.3-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.3-${VERSION}.jar) |
|
||||
| 1.21.4 | [\`anarchymod-mc-1.21.4-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.4-${VERSION}.jar) |
|
||||
| 1.21.5 | [\`anarchymod-mc-1.21.5-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.5-${VERSION}.jar) |
|
||||
| 1.21.6 | [\`anarchymod-mc-1.21.6-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.6-${VERSION}.jar) |
|
||||
| 1.21.7 | [\`anarchymod-mc-1.21.7-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-1.21.7-${VERSION}.jar) |
|
||||
| 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) |
|
||||
| 26.1 | [\`anarchymod-mc-26.1-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-26.1-${VERSION}.jar) |
|
||||
| 26.1.1 | [\`anarchymod-mc-26.1.1-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-26.1.1-${VERSION}.jar) |
|
||||
| 26.1.2 | [\`anarchymod-mc-26.1.2-${VERSION}.jar\`](${DOWNLOAD_URL}/anarchymod-mc-26.1.2-${VERSION}.jar) |
|
||||
|
||||
${CHANGELOG}
|
||||
EOF
|
||||
@@ -103,10 +125,29 @@ jobs:
|
||||
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
|
||||
versions/1.19.4/build/libs/anarchymod-mc-1.19.4-${VERSION}.jar \
|
||||
versions/1.20/build/libs/anarchymod-mc-1.20-${VERSION}.jar \
|
||||
versions/1.20.1/build/libs/anarchymod-mc-1.20.1-${VERSION}.jar \
|
||||
versions/1.20.2/build/libs/anarchymod-mc-1.20.2-${VERSION}.jar \
|
||||
versions/1.20.3/build/libs/anarchymod-mc-1.20.3-${VERSION}.jar \
|
||||
versions/1.20.4/build/libs/anarchymod-mc-1.20.4-${VERSION}.jar \
|
||||
versions/1.20.5/build/libs/anarchymod-mc-1.20.5-${VERSION}.jar \
|
||||
versions/1.20.6/build/libs/anarchymod-mc-1.20.6-${VERSION}.jar \
|
||||
versions/1.21/build/libs/anarchymod-mc-1.21-${VERSION}.jar \
|
||||
versions/1.21.1/build/libs/anarchymod-mc-1.21.1-${VERSION}.jar \
|
||||
versions/1.21.2/build/libs/anarchymod-mc-1.21.2-${VERSION}.jar \
|
||||
versions/1.21.3/build/libs/anarchymod-mc-1.21.3-${VERSION}.jar \
|
||||
versions/1.21.4/build/libs/anarchymod-mc-1.21.4-${VERSION}.jar \
|
||||
versions/1.21.5/build/libs/anarchymod-mc-1.21.5-${VERSION}.jar \
|
||||
versions/1.21.6/build/libs/anarchymod-mc-1.21.6-${VERSION}.jar \
|
||||
versions/1.21.7/build/libs/anarchymod-mc-1.21.7-${VERSION}.jar \
|
||||
versions/1.21.8/build/libs/anarchymod-mc-1.21.8-${VERSION}.jar \
|
||||
versions/1.21.9/build/libs/anarchymod-mc-1.21.9-${VERSION}.jar \
|
||||
versions/1.21.10/build/libs/anarchymod-mc-1.21.10-${VERSION}.jar \
|
||||
versions/1.21.11/build/libs/anarchymod-mc-1.21.11-${VERSION}.jar \
|
||||
versions/26.1/build/libs/anarchymod-mc-26.1-${VERSION}.jar \
|
||||
versions/26.1.1/build/libs/anarchymod-mc-26.1.1-${VERSION}.jar \
|
||||
versions/26.1.2/build/libs/anarchymod-mc-26.1.2-${VERSION}.jar
|
||||
|
||||
set-after-version:
|
||||
needs: build
|
||||
|
||||
@@ -1,30 +1,35 @@
|
||||
name: Set Version
|
||||
name: set-version
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version to set (e.g. 1.1.0 or 1.2.0-SNAPSHOT)"
|
||||
description: 'Version to set'
|
||||
required: true
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version to set"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
set-version:
|
||||
name: Set Version
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set version
|
||||
run: sed -i "s/version = \".*\"/version = \"${{ inputs.version }}\"/" build.gradle.kts
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v7
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
commit_message: "chore(release): bump version to ${{ inputs.version }}"
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Set Version
|
||||
run: sed -i "s/mod_version=.*/mod_version=${{ inputs.version }}/" gradle.properties
|
||||
|
||||
- name: Commit Version
|
||||
uses: stefanzweifel/git-auto-commit-action@v7
|
||||
with:
|
||||
commit_message: 'chore(release): bump version to ${{ inputs.version }}'
|
||||
|
||||
+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
|
||||
|
||||
@@ -15,20 +15,40 @@
|
||||
|
||||
| Minecraft | Module |
|
||||
|-----------|--------------|
|
||||
| 1.19.4 | `mc-1.19.4` |
|
||||
| 1.20 | `mc-1.20` |
|
||||
| 1.20.1 | `mc-1.20.1` |
|
||||
| 1.20.2 | `mc-1.20.2` |
|
||||
| 1.20.3 | `mc-1.20.3` |
|
||||
| 1.20.4 | `mc-1.20.4` |
|
||||
| 1.20.5 | `mc-1.20.5` |
|
||||
| 1.20.6 | `mc-1.20.6` |
|
||||
| 1.21 | `mc-1.21` |
|
||||
| 1.21.1 | `mc-1.21.1` |
|
||||
| 1.21.2 | `mc-1.21.2` |
|
||||
| 1.21.3 | `mc-1.21.3` |
|
||||
| 1.21.4 | `mc-1.21.4` |
|
||||
| 1.21.5 | `mc-1.21.5` |
|
||||
| 1.21.6 | `mc-1.21.6` |
|
||||
| 1.21.7 | `mc-1.21.7` |
|
||||
| 1.21.8 | `mc-1.21.8` |
|
||||
| 1.21.9 | `mc-1.21.9` |
|
||||
| 1.21.10 | `mc-1.21.10` |
|
||||
| 1.21.11 | `mc-1.21.11` |
|
||||
| 26.1 | `mc-26.1` |
|
||||
| 26.1.1 | `mc-26.1.1` |
|
||||
| 26.1.2 | `mc-26.1.2` |
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install [Fabric Loader](https://fabricmc.net/) and [Fabric API](https://modrinth.com/mod/fabric-api) for your Minecraft version
|
||||
1. Install [Fabric Loader](https://fabricmc.net/) and [Fabric API](https://modrinth.com/mod/fabric-api) for your
|
||||
Minecraft version
|
||||
2. Download the matching JAR from [Releases](https://github.com/6b6t/AnarchyMod/releases)
|
||||
3. Place the JAR in your `.minecraft/mods` folder
|
||||
|
||||
## Building from Source
|
||||
|
||||
Requires Java 21+.
|
||||
Requires Java 25+ for the full multi-version build.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/6b6t/AnarchyMod.git
|
||||
|
||||
+70
-11
@@ -1,20 +1,79 @@
|
||||
plugins {
|
||||
id("java")
|
||||
id("net.fabricmc.fabric-loom-remap") version "1.16.2"
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
group = "net.blockhost"
|
||||
version = "1.0.1"
|
||||
val minecraftVersion = stonecutter.current.project
|
||||
val loaderVersion = property("loader_version") as String
|
||||
val fabricApiVersion = property("fabric_api_version") as String
|
||||
val javaVersion = (property("java_version") as String).toInt()
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
version = property("mod_version")!!
|
||||
group = property("maven_group")!!
|
||||
|
||||
base {
|
||||
archivesName.set("anarchymod-mc-${minecraftVersion}")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(platform("org.junit:junit-bom:6.0.3"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
||||
implementation("com.google.code.gson:gson:2.14.0")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
loom {
|
||||
runConfigs.all {
|
||||
ideConfigGenerated(true)
|
||||
runDir = "../../run"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("minecraft_version", minecraftVersion)
|
||||
inputs.property("loader_version", loaderVersion)
|
||||
inputs.property("java_version", javaVersion)
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
"version" to project.version,
|
||||
"minecraft_version" to minecraftVersion,
|
||||
"loader_version" to loaderVersion,
|
||||
"java_version" to javaVersion
|
||||
)
|
||||
}
|
||||
|
||||
filesMatching("anarchymod.mixins.json") {
|
||||
expand(
|
||||
"java_version" to javaVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(javaVersion)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
artifactId = base.archivesName.get()
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
version = rootProject.version
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.google.code.gson:gson:2.13.2")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
LocalizedResourceName=AnarchyMod
|
||||
@@ -1 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
mod_version=1.2.1
|
||||
maven_group=net.blockhost
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
Vendored
+10
-21
@@ -23,8 +23,8 @@
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,7 +65,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
@@ -73,21 +73,10 @@ goto fail
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
plugins {
|
||||
id("fabric-loom") version "1.15.4"
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
val minecraftVersion = property("minecraft_version") as String
|
||||
val loaderVersion = property("loader_version") as String
|
||||
val fabricApiVersion = property("fabric_api_version") as String
|
||||
|
||||
version = rootProject.version
|
||||
group = property("maven_group")!!
|
||||
|
||||
base {
|
||||
archivesName.set("anarchymod-${project.name}")
|
||||
}
|
||||
|
||||
repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
||||
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)
|
||||
inputs.property("loader_version", loaderVersion)
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
"version" to project.version,
|
||||
"minecraft_version" to minecraftVersion,
|
||||
"loader_version" to loaderVersion,
|
||||
"fabric_api_version" to fabricApiVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(21)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
artifactId = base.archivesName.get()
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.10
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.138.4+1.21.10
|
||||
# Mod Properties
|
||||
maven_group=net.blockhost
|
||||
archives_base_name=mc-1.21.10
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class JoinPayload implements CustomPacketPayload {
|
||||
|
||||
public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("anarchymod", "join");
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, JoinPayload> CODEC =
|
||||
StreamCodec.of(
|
||||
(payload, buf) -> {},
|
||||
buf -> new JoinPayload()
|
||||
);
|
||||
|
||||
public static final Type<JoinPayload> TYPE =
|
||||
new Type<>(ID);
|
||||
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.blockhost.anarchymod.mixin;
|
||||
|
||||
import com.mojang.patchy.BlockedServers;
|
||||
import net.blockhost.anarchymod.Domains;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "net.blockhost.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.11
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.141.3+1.21.11
|
||||
# Mod Properties
|
||||
maven_group=net.blockhost
|
||||
archives_base_name=mc-1.21.11
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
|
||||
public class AnarchyMod implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
PayloadTypeRegistry.playC2S().register(JoinPayload.TYPE, JoinPayload.CODEC);
|
||||
ClientPlayConnectionEvents.JOIN.register((listener, sender, client) -> {
|
||||
if (client.getCurrentServer() != null && Domains.contains(client.getCurrentServer().ip))
|
||||
sender.sendPacket(new JoinPayload());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
public class JoinPayload implements CustomPacketPayload {
|
||||
|
||||
public static final Identifier ID = Identifier.fromNamespaceAndPath("anarchymod", "join");
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, JoinPayload> CODEC =
|
||||
StreamCodec.of(
|
||||
(payload, buf) -> {},
|
||||
buf -> new JoinPayload()
|
||||
);
|
||||
|
||||
public static final Type<JoinPayload> TYPE =
|
||||
new Type<>(ID);
|
||||
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.blockhost.anarchymod.mixin;
|
||||
|
||||
import com.mojang.patchy.BlockedServers;
|
||||
import net.blockhost.anarchymod.Domains;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package net.blockhost.anarchymod.mixin;
|
||||
|
||||
import net.blockhost.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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "net.blockhost.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
"issues": "https://github.com/6b6t/AnarchyMod/issues",
|
||||
"sources": "https://github.com/6b6t/AnarchyMod"
|
||||
},
|
||||
"license": "MIT",
|
||||
"icon": "assets/anarchymod/icon.png",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
"net.blockhost.anarchymod.AnarchyMod"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"minecraft": "${minecraft_version}",
|
||||
"java": ">=21"
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
plugins {
|
||||
id("fabric-loom") version "1.15.4"
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
val minecraftVersion = property("minecraft_version") as String
|
||||
val loaderVersion = property("loader_version") as String
|
||||
val fabricApiVersion = property("fabric_api_version") as String
|
||||
|
||||
version = rootProject.version
|
||||
group = property("maven_group")!!
|
||||
|
||||
base {
|
||||
archivesName.set("anarchymod-${project.name}")
|
||||
}
|
||||
|
||||
repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
||||
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)
|
||||
inputs.property("loader_version", loaderVersion)
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
"version" to project.version,
|
||||
"minecraft_version" to minecraftVersion,
|
||||
"loader_version" to loaderVersion,
|
||||
"fabric_api_version" to fabricApiVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(21)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
artifactId = base.archivesName.get()
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.8
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.136.1+1.21.8
|
||||
# Mod Properties
|
||||
maven_group=net.blockhost
|
||||
archives_base_name=mc-1.21.8
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
|
||||
public class AnarchyMod implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
PayloadTypeRegistry.playC2S().register(JoinPayload.TYPE, JoinPayload.CODEC);
|
||||
ClientPlayConnectionEvents.JOIN.register((listener, sender, client) -> {
|
||||
if (client.getCurrentServer() != null && Domains.contains(client.getCurrentServer().ip))
|
||||
sender.sendPacket(new JoinPayload());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class JoinPayload implements CustomPacketPayload {
|
||||
|
||||
public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("anarchymod", "join");
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, JoinPayload> CODEC =
|
||||
StreamCodec.of(
|
||||
(payload, buf) -> {},
|
||||
buf -> new JoinPayload()
|
||||
);
|
||||
|
||||
public static final Type<JoinPayload> TYPE =
|
||||
new Type<>(ID);
|
||||
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package net.blockhost.anarchymod.mixin;
|
||||
|
||||
import net.blockhost.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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "net.blockhost.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
"issues": "https://github.com/6b6t/AnarchyMod/issues",
|
||||
"sources": "https://github.com/6b6t/AnarchyMod"
|
||||
},
|
||||
"license": "MIT",
|
||||
"icon": "assets/anarchymod/icon.png",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
"net.blockhost.anarchymod.AnarchyMod"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"minecraft": "${minecraft_version}",
|
||||
"java": ">=21"
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
plugins {
|
||||
id("fabric-loom") version "1.15.4"
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
val minecraftVersion = property("minecraft_version") as String
|
||||
val loaderVersion = property("loader_version") as String
|
||||
val fabricApiVersion = property("fabric_api_version") as String
|
||||
|
||||
version = rootProject.version
|
||||
group = property("maven_group")!!
|
||||
|
||||
base {
|
||||
archivesName.set("anarchymod-${project.name}")
|
||||
}
|
||||
|
||||
repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
||||
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)
|
||||
inputs.property("loader_version", loaderVersion)
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand(
|
||||
"version" to project.version,
|
||||
"minecraft_version" to minecraftVersion,
|
||||
"loader_version" to loaderVersion,
|
||||
"fabric_api_version" to fabricApiVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(21)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${base.archivesName.get()}" }
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
artifactId = base.archivesName.get()
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.9
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.134.1+1.21.9
|
||||
# Mod Properties
|
||||
maven_group=net.blockhost
|
||||
archives_base_name=mc-1.21.9
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
|
||||
public class AnarchyMod implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
PayloadTypeRegistry.playC2S().register(JoinPayload.TYPE, JoinPayload.CODEC);
|
||||
ClientPlayConnectionEvents.JOIN.register((listener, sender, client) -> {
|
||||
if (client.getCurrentServer() != null && Domains.contains(client.getCurrentServer().ip))
|
||||
sender.sendPacket(new JoinPayload());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class JoinPayload implements CustomPacketPayload {
|
||||
|
||||
public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("anarchymod", "join");
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, JoinPayload> CODEC =
|
||||
StreamCodec.of(
|
||||
(payload, buf) -> {},
|
||||
buf -> new JoinPayload()
|
||||
);
|
||||
|
||||
public static final Type<JoinPayload> TYPE =
|
||||
new Type<>(ID);
|
||||
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.blockhost.anarchymod.mixin;
|
||||
|
||||
import com.mojang.patchy.BlockedServers;
|
||||
import net.blockhost.anarchymod.Domains;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(BlockedServers.class)
|
||||
public class BlockedServersMixin {
|
||||
|
||||
@Inject(method = "isBlockedServerHostName", at = @At("TAIL"), cancellable = true, remap = false)
|
||||
public void isBlockedServerHostName(String server, CallbackInfoReturnable<Boolean> cir) {
|
||||
boolean contains = Domains.contains(server);
|
||||
if (contains) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package net.blockhost.anarchymod.mixin;
|
||||
|
||||
import net.blockhost.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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"authors": ["6b6t"],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
"issues": "https://github.com/6b6t/AnarchyMod/issues",
|
||||
"sources": "https://github.com/6b6t/AnarchyMod"
|
||||
},
|
||||
"license": "MIT",
|
||||
"icon": "assets/anarchymod/icon.png",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
"net.blockhost.anarchymod.AnarchyMod"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"minecraft": "${minecraft_version}",
|
||||
"java": ">=21"
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,39 @@
|
||||
plugins {
|
||||
id("fabric-loom") version "1.15.4"
|
||||
id("net.fabricmc.fabric-loom") version "1.16.2"
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
val minecraftVersion = property("minecraft_version") as String
|
||||
val minecraftVersion = stonecutter.current.project
|
||||
val loaderVersion = property("loader_version") as String
|
||||
val fabricApiVersion = property("fabric_api_version") as String
|
||||
val javaVersion = (property("java_version") as String).toInt()
|
||||
|
||||
version = rootProject.version
|
||||
version = property("mod_version")!!
|
||||
group = property("maven_group")!!
|
||||
|
||||
base {
|
||||
archivesName.set("anarchymod-${project.name}")
|
||||
}
|
||||
|
||||
repositories {
|
||||
archivesName.set("anarchymod-mc-${minecraftVersion}")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
||||
implementation(project(":common"))
|
||||
implementation("net.fabricmc:fabric-loader:$loaderVersion")
|
||||
implementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
|
||||
implementation("com.google.code.gson:gson:2.14.0")
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
dependsOn(project(":common").tasks.named("classes"))
|
||||
from(project(":common").sourceSets["main"].output)
|
||||
loom {
|
||||
runConfigs.all {
|
||||
ideConfigGenerated(true)
|
||||
runDir = "../../run"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("minecraft_version", minecraftVersion)
|
||||
inputs.property("loader_version", loaderVersion)
|
||||
inputs.property("java_version", javaVersion)
|
||||
filteringCharset = "UTF-8"
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
@@ -41,18 +41,24 @@ tasks.processResources {
|
||||
"version" to project.version,
|
||||
"minecraft_version" to minecraftVersion,
|
||||
"loader_version" to loaderVersion,
|
||||
"fabric_api_version" to fabricApiVersion
|
||||
"java_version" to javaVersion
|
||||
)
|
||||
}
|
||||
|
||||
filesMatching("anarchymod.mixins.json") {
|
||||
expand(
|
||||
"java_version" to javaVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(21)
|
||||
options.release.set(javaVersion)
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
+8
-2
@@ -1,12 +1,18 @@
|
||||
{
|
||||
"extends": ["config:base", "group:allNonMajor", ":semanticCommits"],
|
||||
"extends": [
|
||||
"config:base",
|
||||
"group:allNonMajor",
|
||||
":semanticCommits"
|
||||
],
|
||||
"baseBranches": [
|
||||
"main"
|
||||
],
|
||||
"labels": [
|
||||
"enhancement"
|
||||
],
|
||||
"reviewers": ["xymb-endcrystalme"],
|
||||
"reviewers": [
|
||||
"xymb-endcrystalme"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": [
|
||||
|
||||
+20
-10
@@ -1,17 +1,27 @@
|
||||
rootProject.name = "AnarchyMod"
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://maven.fabricmc.net/")
|
||||
}
|
||||
maven("https://maven.fabricmc.net/")
|
||||
maven("https://maven.kikugie.dev/releases")
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.kikugie.stonecutter") version "0.9.4"
|
||||
}
|
||||
|
||||
include("common")
|
||||
include("mc-1.21.8")
|
||||
include("mc-1.21.9")
|
||||
include("mc-1.21.10")
|
||||
include("mc-1.21.11")
|
||||
stonecutter {
|
||||
create(rootProject) {
|
||||
val legacy = arrayOf(
|
||||
"1.19.4", "1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4",
|
||||
"1.20.5", "1.20.6",
|
||||
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4",
|
||||
"1.21.5", "1.21.6", "1.21.7",
|
||||
"1.21.8", "1.21.9", "1.21.10", "1.21.11"
|
||||
)
|
||||
val modern = arrayOf("26.1", "26.1.1", "26.1.2")
|
||||
|
||||
versions(*legacy).buildscript("build.gradle.kts")
|
||||
versions(*modern).buildscript("modern-build.gradle.kts")
|
||||
}
|
||||
}
|
||||
|
||||
+16
-6
@@ -1,21 +1,31 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
//? if <1.20.5 {
|
||||
/*import io.netty.buffer.Unpooled;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
*///?} else {
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
//?}
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
|
||||
public class AnarchyMod implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
PayloadTypeRegistry.playC2S().register(JoinPayload.TYPE, JoinPayload.CODEC);
|
||||
//? if >=26.1 {
|
||||
PayloadTypeRegistry.serverboundPlay().register(JoinPayload.TYPE, JoinPayload.CODEC);
|
||||
//?} else if >=1.20.5 {
|
||||
/*PayloadTypeRegistry.playC2S().register(JoinPayload.TYPE, JoinPayload.CODEC);
|
||||
*///?}
|
||||
ClientPlayConnectionEvents.JOIN.register((listener, sender, client) -> {
|
||||
if (client.getCurrentServer() != null && Domains.contains(client.getCurrentServer().ip))
|
||||
//? if <1.20.5 {
|
||||
/*ClientPlayNetworking.send(JoinPayload.ID, new FriendlyByteBuf(Unpooled.buffer()));
|
||||
*///?} else {
|
||||
sender.sendPacket(new JoinPayload());
|
||||
//?}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+17
-14
@@ -8,24 +8,28 @@ 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();
|
||||
}
|
||||
|
||||
@@ -33,29 +37,29 @@ public class Domains {
|
||||
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 +71,6 @@ public class Domains {
|
||||
}
|
||||
|
||||
for (String entry : domains) {
|
||||
|
||||
if (entry.startsWith("*.")) {
|
||||
String base = entry.substring(2);
|
||||
if (domain.equals(base) || domain.endsWith("." + base)) {
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.blockhost.anarchymod;
|
||||
|
||||
//? if <1.20.5 {
|
||||
/*import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class JoinPayload {
|
||||
|
||||
public static final ResourceLocation ID = new ResourceLocation("anarchymod", "join");
|
||||
}
|
||||
*///?} else {
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
//? if >=1.21.11 {
|
||||
import net.minecraft.resources.Identifier;
|
||||
//? } else {
|
||||
/*import net.minecraft.resources.ResourceLocation;
|
||||
*///?}
|
||||
|
||||
public class JoinPayload implements CustomPacketPayload {
|
||||
|
||||
//? if >=1.21.11 {
|
||||
public static final Identifier ID = Identifier.fromNamespaceAndPath("anarchymod", "join");
|
||||
//? } elif >=1.21.7 {
|
||||
/*public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath("anarchymod", "join");
|
||||
*///?} else {
|
||||
/*public static final ResourceLocation ID = ResourceLocation.tryBuild("anarchymod", "join");
|
||||
*///?}
|
||||
|
||||
public static final StreamCodec<FriendlyByteBuf, JoinPayload> CODEC =
|
||||
StreamCodec.of(
|
||||
(buf, payload) -> {},
|
||||
buf -> new JoinPayload()
|
||||
);
|
||||
|
||||
public static final Type<JoinPayload> TYPE =
|
||||
new Type<>(ID);
|
||||
|
||||
@Override
|
||||
public Type<? extends CustomPacketPayload> type() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
//?}
|
||||
+1
-2
@@ -10,12 +10,11 @@ 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) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+7
-2
@@ -19,11 +19,16 @@ 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))) {
|
||||
//? if <1.20.2 {
|
||||
/*serverList.add(0, new ServerData("6b6t", "6b6t.org", false));
|
||||
*///? } elif <1.20.5 {
|
||||
/*serverList.add(0, new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
*///?} else {
|
||||
serverList.addFirst(new ServerData("6b6t", "6b6t.org", ServerData.Type.OTHER));
|
||||
//?}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "net.blockhost.anarchymod.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"compatibilityLevel": "JAVA_${java_version}",
|
||||
"client": [
|
||||
"BlockedServersMixin",
|
||||
"ServerListMixin"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 292 B |
@@ -3,10 +3,12 @@
|
||||
"id": "anarchymod",
|
||||
"version": "${version}",
|
||||
"name": "AnarchyMod",
|
||||
"description": "Client-side mod for anarchy Minecraft servers",
|
||||
"authors": ["6b6t"],
|
||||
"description": "Bypass a potential Mojang blacklist of 6b6t - the biggest anarchy server in the world.",
|
||||
"authors": [
|
||||
"6b6t"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://6b6t.org",
|
||||
"homepage": "https://www.6b6t.org/?utm_source=anarchymod&utm_medium=mod_menu&utm_campaign=evergreen_website&utm_content=description_link",
|
||||
"issues": "https://github.com/6b6t/AnarchyMod/issues",
|
||||
"sources": "https://github.com/6b6t/AnarchyMod"
|
||||
},
|
||||
@@ -21,10 +23,17 @@
|
||||
"mixins": [
|
||||
"anarchymod.mixins.json"
|
||||
],
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"modmenu.discord": "https://6b6t.org/discord"
|
||||
}
|
||||
}
|
||||
},
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"fabric-api": "*",
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"minecraft": "${minecraft_version}",
|
||||
"java": ">=21"
|
||||
"java": ">=${java_version}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
plugins {
|
||||
id("dev.kikugie.stonecutter")
|
||||
}
|
||||
|
||||
stonecutter active "26.1.2"
|
||||
|
||||
tasks.register("chiseledBuild") {
|
||||
group = "project"
|
||||
dependsOn(stonecutter.tasks.named("build"))
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.19.4
|
||||
loader_version=0.14.21
|
||||
fabric_api_version=0.76.0+1.19.4
|
||||
java_version=17
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20.1
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.92.7+1.20.1
|
||||
java_version=17
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20.2
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.91.6+1.20.2
|
||||
java_version=17
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20.3
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.91.1+1.20.3
|
||||
java_version=17
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20.4
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.97.3+1.20.4
|
||||
java_version=17
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20.5
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.97.8+1.20.5
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20.6
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.100.8+1.20.6
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.20
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.83.0+1.20
|
||||
java_version=17
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.1
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.116.9+1.21.1
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.10
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.138.4+1.21.10
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.11
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.141.3+1.21.11
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.2
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.106.1+1.21.2
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.3
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.114.1+1.21.3
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.4
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.119.4+1.21.4
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.5
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.128.2+1.21.5
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.6
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.128.2+1.21.6
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.7
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.129.0+1.21.7
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.8
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.136.1+1.21.8
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21.9
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.134.1+1.21.9
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=1.21
|
||||
loader_version=0.18.4
|
||||
fabric_api_version=0.102.0+1.21
|
||||
java_version=21
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=26.1.1
|
||||
loader_version=0.19.2
|
||||
fabric_api_version=0.145.4+26.1.1
|
||||
java_version=25
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=26.1.2
|
||||
loader_version=0.19.2
|
||||
fabric_api_version=0.148.2+26.1.2
|
||||
java_version=25
|
||||
@@ -0,0 +1,4 @@
|
||||
minecraft_version=26.1
|
||||
loader_version=0.19.2
|
||||
fabric_api_version=0.145.1+26.1
|
||||
java_version=25
|
||||
Reference in New Issue
Block a user