mirror of
https://github.com/jpenilla/MiniMOTD.git
synced 2026-11-07 01:42:36 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4396a20bb | ||
|
|
2ef09d0669 | ||
|
|
f7c7afd7e5 | ||
|
|
d05dc770a5 | ||
|
|
f8ade792bf | ||
|
|
7dba88c9d2 | ||
|
|
b24955e113 | ||
|
|
89b8cbb26e | ||
|
|
25902d132b | ||
|
|
b1308e92ef | ||
|
|
410272d025 | ||
|
|
e065283ae9 | ||
|
|
c7a27a212f | ||
|
|
ff99a0c231 | ||
|
|
f8e8e81ace | ||
|
|
01a1091c5e | ||
|
|
77a200203c | ||
|
|
cd88a2b73d | ||
|
|
6a9bb08a1b | ||
|
|
eab3617449 | ||
|
|
73de0a0cff | ||
|
|
ae1ea24c97 | ||
|
|
77e64e78bc | ||
|
|
a1bacb1747 | ||
|
|
8e6f9ea77d | ||
|
|
03a95129f7 | ||
|
|
6fc1f06fd9 | ||
|
|
cf918948c8 | ||
|
|
96254e790f | ||
|
|
ba6613e622 | ||
|
|
1a1a4359c8 | ||
|
|
3e01f4a40c | ||
|
|
31c24fc0f7 | ||
|
|
87b74f6343 | ||
|
|
558e0a1b2c | ||
|
|
3fd8465433 | ||
|
|
689563a56e | ||
|
|
180002e0e1 | ||
|
|
b39cfdeb56 | ||
|
|
9a74c14f00 | ||
|
|
ad8233a4d2 | ||
|
|
0df4bc3c59 | ||
|
|
9f216d90e6 | ||
|
|
4c3f049e06 | ||
|
|
095841448d | ||
|
|
9378ea4d5d | ||
|
|
88a45eff62 | ||
|
|
a5a8d10940 | ||
|
|
79637815f6 | ||
|
|
7f5a43f89f | ||
|
|
c7a8656d3f | ||
|
|
a8a046d3ba | ||
|
|
cb8ffffe6f | ||
|
|
3b15660097 | ||
|
|
80d16d2b13 | ||
|
|
16e8253fa0 | ||
|
|
a7042a8263 | ||
|
|
9a77ed8b88 | ||
|
|
9a2bba7fc3 | ||
|
|
a8c8848420 | ||
|
|
1ae536586e | ||
|
|
b8a865a16f | ||
|
|
7de803fda2 | ||
|
|
8d27f17184 | ||
|
|
949ba5f21c | ||
|
|
10c0e521c3 | ||
|
|
831894876c | ||
|
|
d0618af8ea | ||
|
|
d79ead8b13 | ||
|
|
9c17676b74 | ||
|
|
230ed8142a | ||
|
|
f155500f49 | ||
|
|
5afd801850 | ||
|
|
2681390aad | ||
|
|
3a56d24107 | ||
|
|
13260762d4 | ||
|
|
42a2c56770 | ||
|
|
921055f2b0 | ||
|
|
a6af02ae63 | ||
|
|
22ff761ee0 | ||
|
|
9a274d1550 | ||
|
|
af6610cdb2 | ||
|
|
d9a6d9eb74 | ||
|
|
656f153bec | ||
|
|
266d3ff7dc | ||
|
|
7d682d8121 | ||
|
|
11886270a8 | ||
|
|
60e2e9ceee | ||
|
|
f9482769b8 | ||
|
|
98d12c4e39 | ||
|
|
4658d70e45 | ||
|
|
f9355a6fb1 | ||
|
|
c8a94b738a | ||
|
|
596c07e11f | ||
|
|
f60d66673f | ||
|
|
40bf7d13d6 | ||
|
|
25ef13dc69 | ||
|
|
1d53ffedd1 | ||
|
|
e3e99577d1 | ||
|
|
59a8b3d82a | ||
|
|
a30d1bf7fb | ||
|
|
6be04f7700 | ||
|
|
91c33014ba | ||
|
|
19917d4eaa | ||
|
|
77283d0c84 | ||
|
|
376682eac8 | ||
|
|
f5c576e839 | ||
|
|
6bc70cf054 | ||
|
|
12993bb866 | ||
|
|
5a742f62e5 | ||
|
|
000dfda192 | ||
|
|
8c66bcd408 | ||
|
|
2d47e73d3b | ||
|
|
f500c9fb8f | ||
|
|
922079cc7d | ||
|
|
798946390b | ||
|
|
743a149f3b | ||
|
|
316945b30f | ||
|
|
c8bf42463c | ||
|
|
a9bf505028 | ||
|
|
60bfb21444 | ||
|
|
fb13022642 | ||
|
|
1bbf3abd9a | ||
|
|
1967d9802f | ||
|
|
6b3d7aeab6 | ||
|
|
267c0426fe | ||
|
|
c3d5afa680 | ||
|
|
2009684fb5 | ||
|
|
56202f3f26 | ||
|
|
f2be2062e5 | ||
|
|
4cbe7d4bf9 | ||
|
|
fd20b5e583 | ||
|
|
e495e76a2d |
No files matched your search
@@ -17,3 +17,4 @@ jobs:
|
||||
modrinth-publish: true
|
||||
hangar-publish: true
|
||||
loom: true
|
||||
jdk-version: 21
|
||||
@@ -117,3 +117,5 @@ run/
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build/
|
||||
|
||||
.kotlin/
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
[](https://github.com/jpenilla/MiniMOTD/actions) [](https://github.com/jpenilla/MiniMOTD/releases)
|
||||
|
||||
@@ -14,17 +14,24 @@
|
||||
- MiniMOTD is compatible with Spigot, however many features will not work. It is recommended to use Paper for full compatibility.
|
||||
- [Sponge API 8](https://www.spongepowered.org/)
|
||||
- [Sponge API 7](https://www.spongepowered.org/)
|
||||
- [Fabric](https://fabricmc.net/) (requires [Fabric API](https://www.curseforge.com/minecraft/mc-mods/fabric-api))
|
||||
- [Fabric](https://fabricmc.net/) (requires [Fabric API](https://modrinth.com/mod/fabric-api))
|
||||
- [NeoForge](https://neoforged.net/)
|
||||
|
||||
#### Proxy Platforms
|
||||
- [Velocity](https://velocitypowered.com/)
|
||||
- [Waterfall](https://papermc.io/downloads#Waterfall) / Bungeecord
|
||||
|
||||
#### Downloads
|
||||
Downloads can be obtained from [GitHub releases](https://github.com/jpenilla/MiniMOTD/releases). There is a separate jar for each platform, as well as a universal jar for all platforms. Paper and Spigot share the same jar, as do Waterfall and Bungeecord.
|
||||
Downloads can be obtained from any of:
|
||||
- [Modrinth](https://modrinth.com/plugin/minimotd)
|
||||
- [Hangar](https://hangar.papermc.io/jmp/MiniMOTD)
|
||||
- [GitHub releases](https://github.com/jpenilla/MiniMOTD/releases)
|
||||
|
||||
There is a separate jar for each platform. Paper and Spigot share the same jar, as do Waterfall and Bungeecord.
|
||||
The `bukkit-bungeecord` jar is merged from the Paper/Spigot and Waterfall/Bungeecord jars for distribution on Spigot's site.
|
||||
|
||||
#### Configuration
|
||||
See the [wiki](https://github.com/jpenilla/MiniMOTD/wiki) for configuration details
|
||||
|
||||
#### Screenshots
|
||||

|
||||

|
||||
@@ -29,7 +29,6 @@ import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
import xyz.jpenilla.minimotd.common.util.Components;
|
||||
|
||||
import static net.kyori.adventure.text.Component.space;
|
||||
import static net.kyori.adventure.text.Component.text;
|
||||
@@ -77,7 +76,7 @@ public final class CommandHandler {
|
||||
this.miniMOTD.reload();
|
||||
} catch (final Exception ex) {
|
||||
this.miniMOTD.logger().warn("Failed to reload MiniMOTD. Ensure there are no errors in your config files.", ex);
|
||||
audience.sendMessage(Components.ofChildren(
|
||||
audience.sendMessage(Component.textOfChildren(
|
||||
Constants.COMMAND_PREFIX,
|
||||
space(),
|
||||
text("Failed to reload MiniMOTD. Ensure there are no errors in your config files. See console for more details.", RED)
|
||||
@@ -85,7 +84,7 @@ public final class CommandHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
audience.sendMessage(Components.ofChildren(
|
||||
audience.sendMessage(Component.textOfChildren(
|
||||
Constants.COMMAND_PREFIX,
|
||||
space(),
|
||||
text("Done reloading configuration.", GREEN)
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
import org.slf4j.Logger;
|
||||
import xyz.jpenilla.minimotd.common.config.ConfigManager;
|
||||
import xyz.jpenilla.minimotd.common.config.MOTDConfig;
|
||||
import xyz.jpenilla.minimotd.common.util.Components;
|
||||
|
||||
import static net.kyori.adventure.text.Component.newline;
|
||||
|
||||
@@ -91,7 +90,7 @@ public final class MiniMOTD<I> {
|
||||
}
|
||||
final int index = config.motds().size() == 1 ? 0 : ThreadLocalRandom.current().nextInt(config.motds().size());
|
||||
final MOTDConfig.MOTD motdConfig = config.motds().get(index);
|
||||
final Component motd = Components.ofChildren(
|
||||
final Component motd = Component.textOfChildren(
|
||||
parse(motdConfig.line1(), count),
|
||||
newline(),
|
||||
parse(motdConfig.line2(), count)
|
||||
|
||||
+2
-2
@@ -41,14 +41,14 @@ class ComponentColorDownsamplerTest {
|
||||
|
||||
@Test
|
||||
void testColorDownsampling() {
|
||||
final Component fullColor = Components.ofChildren(
|
||||
final Component fullColor = Component.textOfChildren(
|
||||
text("Green ", GREEN),
|
||||
text("Orange Yellow ", ORANGE_YELLOW),
|
||||
text("Pink ", PINK),
|
||||
text("Blue ", BLUE),
|
||||
text("Lime Green", LIME_GREEN)
|
||||
);
|
||||
final Component expectedDownsample = Components.ofChildren(
|
||||
final Component expectedDownsample = Component.textOfChildren(
|
||||
text("Green ", nearestTo(GREEN)),
|
||||
text("Orange Yellow ", nearestTo(ORANGE_YELLOW)),
|
||||
text("Pink ", nearestTo(PINK)),
|
||||
|
||||
+14
-5
@@ -9,17 +9,26 @@ tasks.jar {
|
||||
val platforms = setOf(
|
||||
projects.minimotdBukkit,
|
||||
projects.minimotdBungeecord,
|
||||
).map { it.dependencyProject }
|
||||
)
|
||||
|
||||
val platformsConfig = configurations.register("platforms") {
|
||||
attributes.attribute(productionJarAttribute, "true")
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
for (platform in platforms) {
|
||||
platformsConfig.name(platform)
|
||||
}
|
||||
}
|
||||
|
||||
val dist = tasks.register<Jar>("bukkitAndBungeeJar") {
|
||||
artifacts.add("archives", this)
|
||||
archiveClassifier.set(null as String?)
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
for (platform in platforms) {
|
||||
val jarTask = platform.miniMOTDPlatform.jarTask
|
||||
from(zipTree(jarTask.flatMap { it.archiveFile }))
|
||||
}
|
||||
from(platformsConfig.flatMap { it.elements }.map { it.map { e -> zipTree(e) } })
|
||||
}
|
||||
|
||||
miniMOTDPlatform {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
group=xyz.jpenilla
|
||||
version=2.1.0
|
||||
version=2.1.7
|
||||
description=Use MiniMessage text formatting in the server list MOTD.
|
||||
|
||||
org.gradle.caching=true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import net.kyori.indra.git.IndraGitExtension
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.attributes.Attribute
|
||||
import org.gradle.api.provider.Provider
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
|
||||
@@ -30,5 +31,8 @@ val bukkitVersions = listOf(
|
||||
"1.17.1",
|
||||
"1.18.2",
|
||||
"1.19.4",
|
||||
"1.20.4"
|
||||
"1.20.6",
|
||||
"1.21.8",
|
||||
)
|
||||
|
||||
val productionJarAttribute = Attribute.of("minimotd.productionJar", String::class.java)
|
||||
@@ -18,9 +18,30 @@ indra {
|
||||
mitLicense()
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral {
|
||||
mavenContent { releasesOnly() }
|
||||
}
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") {
|
||||
mavenContent {
|
||||
snapshotsOnly()
|
||||
includeGroup("xyz.jpenilla")
|
||||
includeGroup("net.kyori") // TODO adventure-platform and adventure-platform-mod snapshots
|
||||
}
|
||||
}
|
||||
maven("https://central.sonatype.com/repository/maven-snapshots/") {
|
||||
mavenContent { snapshotsOnly() }
|
||||
}
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://repo.spongepowered.org/repository/maven-public/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(libs.jupiterEngine)
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
// TODO: work around archloom issue?
|
||||
if (project.name != "minimotd-neoforge" && project.name != "minimotd-fabric") {
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -23,11 +23,11 @@ hangarPublish.publications.register("plugin") {
|
||||
}
|
||||
velocity {
|
||||
jar.set(jar("velocity"))
|
||||
platformVersions.addAll("3.2")
|
||||
platformVersions.addAll("3.4")
|
||||
}
|
||||
waterfall {
|
||||
jar.set(jar("bungeecord"))
|
||||
platformVersions.addAll("1.20")
|
||||
platformVersions.addAll("1.21")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,3 +32,10 @@ if (name != "minimotd-bukkit-bungeecord") {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations.consumable("productionJar") {
|
||||
outgoing {
|
||||
artifact(platformExtension.jarTask)
|
||||
}
|
||||
attributes.attribute(productionJarAttribute, "true")
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id("minimotd.platform-conventions")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("com.gradleup.shadow")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
+24
-19
@@ -1,33 +1,34 @@
|
||||
[plugins]
|
||||
blossom = { id = "net.kyori.blossom", version = "2.1.0" }
|
||||
sponge-gradle-plugin = { id = "org.spongepowered.gradle.plugin", version = "2.2.0" }
|
||||
sponge-gradle-plugin = { id = "org.spongepowered.gradle.plugin", version = "2.3.0" }
|
||||
run-paper = { id = "xyz.jpenilla.run-paper", version.ref = "run-task" }
|
||||
run-velocity = { id = "xyz.jpenilla.run-velocity", version.ref = "run-task" }
|
||||
run-waterfall = { id = "xyz.jpenilla.run-waterfall", version.ref = "run-task" }
|
||||
|
||||
[versions]
|
||||
run-task = "2.2.2"
|
||||
mod-publish-plugin = "0.4.5"
|
||||
hangarPublishPlugin = "0.1.1"
|
||||
run-task = "2.3.1"
|
||||
mod-publish-plugin = "0.8.4"
|
||||
hangarPublishPlugin = "0.1.3"
|
||||
indra = "3.1.3"
|
||||
shadow = "8.1.1"
|
||||
adventure = "4.15.0"
|
||||
adventurePlatform = "4.3.2"
|
||||
adventurePlatformFabric = "5.11.0-SNAPSHOT"
|
||||
configurate = "4.1.2"
|
||||
checkerQual = "3.42.0"
|
||||
shadow = "8.3.8"
|
||||
adventure = "4.23.0"
|
||||
adventurePlatform = "4.4.1-SNAPSHOT"
|
||||
adventurePlatformMod = "6.5.0-SNAPSHOT"
|
||||
configurate = "4.2.0"
|
||||
checkerQual = "3.49.5"
|
||||
slf4j = "1.7.32"
|
||||
gson = "2.8.0"
|
||||
bstats = "3.0.2"
|
||||
bstats = "3.1.0"
|
||||
paperApi = "1.16.5-R0.1-SNAPSHOT"
|
||||
paperlib = "1.0.8"
|
||||
waterfallApi = "1.16-R0.4-SNAPSHOT"
|
||||
fabricApi = "0.93.1+1.20.4"
|
||||
fabricLoader = "0.15.3"
|
||||
minecraft = "1.20.4"
|
||||
waterfallApi = "1.16-R0.5-SNAPSHOT"
|
||||
fabricApi = "0.129.0+1.21.8"
|
||||
fabricLoader = "0.16.14"
|
||||
minecraft = "1.21.8"
|
||||
spongeApi7 = "7.2.0"
|
||||
velocityApi = "3.2.0-SNAPSHOT"
|
||||
jupiterEngine = "5.10.1"
|
||||
velocityApi = "3.4.0-SNAPSHOT"
|
||||
jupiterEngine = "5.13.3"
|
||||
neoforge = "21.8.1-beta"
|
||||
|
||||
[libraries]
|
||||
adventureBom = { group = "net.kyori", name = "adventure-bom", version.ref = "adventure" }
|
||||
@@ -36,7 +37,8 @@ adventureTextSerializerPlain = { group = "net.kyori", name = "adventure-text-ser
|
||||
adventureTextSerializerGson = { group = "net.kyori", name = "adventure-text-serializer-gson" }
|
||||
adventurePlatformBungeecord = { group = "net.kyori", name = "adventure-platform-bungeecord", version.ref = "adventurePlatform" }
|
||||
adventurePlatformBukkit = { group = "net.kyori", name = "adventure-platform-bukkit", version.ref = "adventurePlatform" }
|
||||
adventurePlatformFabric = { group = "net.kyori", name = "adventure-platform-fabric", version.ref = "adventurePlatformFabric" }
|
||||
adventurePlatformFabric = { group = "net.kyori", name = "adventure-platform-fabric", version.ref = "adventurePlatformMod" }
|
||||
adventurePlatformNeoforge = { group = "net.kyori", name = "adventure-platform-neoforge", version.ref = "adventurePlatformMod" }
|
||||
adventurePlatformSpongeApi = { group = "net.kyori", name = "adventure-platform-spongeapi", version.ref = "adventurePlatform" }
|
||||
minimessage = { group = "net.kyori", name = "adventure-text-minimessage" }
|
||||
|
||||
@@ -63,6 +65,9 @@ fabricApi = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.re
|
||||
fabricLoader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabricLoader" }
|
||||
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
|
||||
|
||||
# for renovate
|
||||
zNeoforge = { module = "net.neoforged:neoforge", version.ref = "neoforge" }
|
||||
|
||||
spongeApi7 = { group = "org.spongepowered", name = "spongeapi", version.ref = "spongeApi7" }
|
||||
|
||||
velocityApi = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocityApi" }
|
||||
@@ -72,7 +77,7 @@ jupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", ve
|
||||
# build-logic
|
||||
indraCommon = { group = "net.kyori", name = "indra-common", version.ref = "indra" }
|
||||
indraLicenser = { group = "net.kyori", name = "indra-licenser-spotless", version.ref = "indra" }
|
||||
shadow = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadow" }
|
||||
shadow = { group = "com.gradleup.shadow", name = "shadow-gradle-plugin", version.ref = "shadow" }
|
||||
mod-publish-plugin = { module = "me.modmuss50:mod-publish-plugin", version.ref = "mod-publish-plugin" }
|
||||
hangarPublishPlugin = { group = "io.papermc", name = "hangar-publish-plugin", version.ref = "hangarPublishPlugin" }
|
||||
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/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/.
|
||||
@@ -84,7 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -112,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -203,7 +205,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
@@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+14
-12
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
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
|
||||
|
||||
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
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
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -23,6 +23,9 @@ tasks {
|
||||
commonRelocation("net.kyori")
|
||||
commonRelocation("org.bstats")
|
||||
commonRelocation("io.papermc.lib")
|
||||
manifest {
|
||||
attributes("paperweight-mappings-namespace" to "mojang")
|
||||
}
|
||||
}
|
||||
processResources {
|
||||
val props = mapOf(
|
||||
|
||||
@@ -25,6 +25,9 @@ package xyz.jpenilla.minimotd.bukkit;
|
||||
|
||||
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@@ -36,6 +39,18 @@ import xyz.jpenilla.minimotd.common.PingResponse;
|
||||
import xyz.jpenilla.minimotd.common.config.MOTDConfig;
|
||||
|
||||
public final class PaperPingListener implements Listener {
|
||||
private static final Method WORK_AROUND_PAPER_BUG;
|
||||
|
||||
static {
|
||||
Method paperWorkaround;
|
||||
try {
|
||||
paperWorkaround = PaperServerListPingEvent.class.getMethod("getListedPlayers");
|
||||
} catch (final NoSuchMethodException e) {
|
||||
paperWorkaround = null;
|
||||
}
|
||||
WORK_AROUND_PAPER_BUG = paperWorkaround;
|
||||
}
|
||||
|
||||
private final LegacyComponentSerializer unusualHexSerializer = LegacyComponentSerializer.builder().hexColors().useUnusualXRepeatedCharacterHexFormat().build();
|
||||
private final MiniMOTD<CachedServerIcon> miniMOTD;
|
||||
|
||||
@@ -60,7 +75,17 @@ public final class PaperPingListener implements Listener {
|
||||
response.icon(event::setServerIcon);
|
||||
|
||||
if (response.disablePlayerListHover()) {
|
||||
event.getPlayerSample().clear();
|
||||
if (WORK_AROUND_PAPER_BUG != null) {
|
||||
// Newer Paper replaces getPlayerSample with getListedPlayers,
|
||||
// the old method is supposed to still work, but it just silently does nothing on 1.20.6 (fixed in 1.21.1)
|
||||
try {
|
||||
((List) WORK_AROUND_PAPER_BUG.invoke(event)).clear();
|
||||
} catch (final IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException("Failed to invoke " + WORK_AROUND_PAPER_BUG.getName(), e);
|
||||
}
|
||||
} else {
|
||||
event.getPlayerSample().clear();
|
||||
}
|
||||
}
|
||||
if (response.hidePlayerCount()) {
|
||||
event.setHidePlayers(true);
|
||||
|
||||
@@ -18,7 +18,7 @@ tasks {
|
||||
commonRelocation("org.bstats")
|
||||
}
|
||||
runWaterfall {
|
||||
waterfallVersion("1.20")
|
||||
waterfallVersion("1.21")
|
||||
}
|
||||
processResources {
|
||||
val props = mapOf(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id("quiet-fabric-loom")
|
||||
id("minimotd.platform-conventions")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("com.gradleup.shadow")
|
||||
}
|
||||
|
||||
val shade: Configuration by configurations.creating
|
||||
@@ -14,6 +14,7 @@ dependencies {
|
||||
|
||||
shade(implementation(projects.minimotdCommon) {
|
||||
exclude("net.kyori")
|
||||
exclude("com.google.errorprone")
|
||||
})
|
||||
|
||||
modImplementation(libs.adventurePlatformFabric)
|
||||
@@ -26,7 +27,7 @@ miniMOTDPlatform {
|
||||
|
||||
indra {
|
||||
javaVersions {
|
||||
target(17)
|
||||
target(21)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -57,7 +57,7 @@ public final class MiniMOTDFabric implements ModInitializer, MiniMOTDPlatform<Se
|
||||
private final MiniMOTD<ServerStatus.Favicon> miniMOTD = new MiniMOTD<>(this);
|
||||
|
||||
private MinecraftServer server;
|
||||
private FabricServerAudiences audiences;
|
||||
private MinecraftServerAudiences audiences;
|
||||
|
||||
public MiniMOTDFabric() {
|
||||
if (instance != null) {
|
||||
@@ -75,7 +75,7 @@ public final class MiniMOTDFabric implements ModInitializer, MiniMOTDPlatform<Se
|
||||
this.registerCommand();
|
||||
ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer -> {
|
||||
this.server = minecraftServer;
|
||||
this.audiences = FabricServerAudiences.of(minecraftServer);
|
||||
this.audiences = MinecraftServerAudiences.of(minecraftServer);
|
||||
});
|
||||
ServerLifecycleEvents.SERVER_STARTED.register(minecraftServer -> {
|
||||
if (this.miniMOTD.configManager().pluginSettings().updateChecker()) {
|
||||
@@ -114,7 +114,7 @@ public final class MiniMOTDFabric implements ModInitializer, MiniMOTDPlatform<Se
|
||||
));
|
||||
}
|
||||
|
||||
public @NonNull FabricServerAudiences audiences() {
|
||||
public @NonNull MinecraftServerAudiences audiences() {
|
||||
return this.audiences;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -69,9 +69,9 @@ abstract class ServerStatusPacketListenerImplMixin {
|
||||
final MutableServerStatus modifiedStatus = new MutableServerStatus(vanillaStatus);
|
||||
response.motd(motd -> {
|
||||
if (((ConnectionAccess) this.connection).protocolVersion() >= Constants.MINECRAFT_1_16_PROTOCOL_VERSION) {
|
||||
modifiedStatus.description(miniMOTDFabric.audiences().toNative(motd));
|
||||
modifiedStatus.description(miniMOTDFabric.audiences().asNative(motd));
|
||||
} else {
|
||||
modifiedStatus.description(miniMOTDFabric.audiences().toNative(ComponentColorDownsampler.downsampler().downsample(motd)));
|
||||
modifiedStatus.description(miniMOTDFabric.audiences().asNative(ComponentColorDownsampler.downsampler().downsample(motd)));
|
||||
}
|
||||
});
|
||||
response.icon(favicon -> modifiedStatus.favicon(Optional.of(favicon)));
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
"minimotd-fabric.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.3",
|
||||
"fabric": "*",
|
||||
"minecraft": "~1.20.4"
|
||||
"fabricloader": ">=0.16.14",
|
||||
"fabric-api": "*",
|
||||
"minecraft": "1.21.8",
|
||||
"adventure-platform-fabric": "*"
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"required": true,
|
||||
"minVersion": "0.8.4",
|
||||
"package": "xyz.jpenilla.minimotd.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"ConnectionMixin",
|
||||
"ServerHandshakePacketListenerImplMixin",
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
plugins {
|
||||
id("net.neoforged.moddev")
|
||||
id("minimotd.platform-conventions")
|
||||
id("com.gradleup.shadow")
|
||||
}
|
||||
|
||||
neoForge {
|
||||
enable {
|
||||
version = libs.versions.neoforge.get()
|
||||
}
|
||||
}
|
||||
|
||||
val shade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
shade(implementation(projects.minimotdCommon) {
|
||||
exclude("net.kyori")
|
||||
exclude("com.google.errorprone")
|
||||
})
|
||||
|
||||
implementation(libs.adventurePlatformNeoforge)
|
||||
jarJar(libs.adventurePlatformNeoforge)
|
||||
}
|
||||
|
||||
indra {
|
||||
javaVersions {
|
||||
target(21)
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
configurations = listOf(shade)
|
||||
commonConfiguration()
|
||||
commonRelocation("io.leangen.geantyref")
|
||||
}
|
||||
processResources {
|
||||
val replacements = mapOf(
|
||||
"version" to project.version.toString(),
|
||||
"description" to project.description.toString(),
|
||||
"github_url" to Constants.GITHUB_URL
|
||||
)
|
||||
inputs.properties(replacements)
|
||||
filesMatching("META-INF/neoforge.mods.toml") {
|
||||
expand(replacements)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val productionJar = tasks.register<Zip>("productionJar") {
|
||||
archiveFileName = "${project.name}-mc$minecraftVersion-${project.version}.jar"
|
||||
destinationDirectory = layout.buildDirectory.dir("libs")
|
||||
from(zipTree(tasks.shadowJar.flatMap { it.archiveFile }))
|
||||
from(tasks.jarJar.flatMap { it.outputDirectory })
|
||||
}
|
||||
|
||||
miniMOTDPlatform {
|
||||
jarTask.set(productionJar)
|
||||
}
|
||||
|
||||
publishMods.modrinth {
|
||||
modLoaders.add("neoforge")
|
||||
minecraftVersions.addAll(minecraftVersion)
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge;
|
||||
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import javax.imageio.ImageIO;
|
||||
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.RegisterCommandsEvent;
|
||||
import net.neoforged.neoforge.event.server.ServerStartedEvent;
|
||||
import net.neoforged.neoforge.event.server.ServerStartingEvent;
|
||||
import net.neoforged.neoforge.event.server.ServerStoppedEvent;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import xyz.jpenilla.minimotd.common.CommandHandler;
|
||||
import xyz.jpenilla.minimotd.common.MiniMOTD;
|
||||
import xyz.jpenilla.minimotd.common.MiniMOTDPlatform;
|
||||
import xyz.jpenilla.minimotd.common.util.UpdateChecker;
|
||||
import xyz.jpenilla.minimotd.neoforge.access.ServerStatusFaviconAccess;
|
||||
|
||||
import static net.minecraft.commands.Commands.literal;
|
||||
|
||||
@Mod("minimotd")
|
||||
public final class MiniMOTDNeoForge implements MiniMOTDPlatform<ServerStatus.Favicon> {
|
||||
private static MiniMOTDNeoForge instance = null;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(MiniMOTD.class);
|
||||
private final Path dataDirectory = Path.of("config", "MiniMOTD");
|
||||
private final MiniMOTD<ServerStatus.Favicon> miniMOTD = new MiniMOTD<>(this);
|
||||
|
||||
private MinecraftServer server;
|
||||
private MinecraftServerAudiences audiences;
|
||||
|
||||
public MiniMOTDNeoForge() {
|
||||
if (instance != null) {
|
||||
throw new IllegalStateException("Cannot create a second instance of " + this.getClass().getName());
|
||||
}
|
||||
instance = this;
|
||||
|
||||
this.registerCommand();
|
||||
NeoForge.EVENT_BUS.addListener((ServerStartingEvent event) -> {
|
||||
this.server = event.getServer();
|
||||
this.audiences = MinecraftServerAudiences.of(event.getServer());
|
||||
});
|
||||
NeoForge.EVENT_BUS.addListener((ServerStartedEvent event) -> {
|
||||
if (this.miniMOTD.configManager().pluginSettings().updateChecker()) {
|
||||
CompletableFuture.runAsync(() -> new UpdateChecker().checkVersion().forEach(this.logger()::info));
|
||||
}
|
||||
});
|
||||
NeoForge.EVENT_BUS.addListener((ServerStoppedEvent event) -> {
|
||||
this.server = null;
|
||||
this.audiences = null;
|
||||
});
|
||||
this.miniMOTD.logger().info("Done initializing MiniMOTD");
|
||||
}
|
||||
|
||||
public @NonNull MiniMOTD<ServerStatus.Favicon> miniMOTD() {
|
||||
return this.miniMOTD;
|
||||
}
|
||||
|
||||
private void registerCommand() {
|
||||
final class WrappingExecutor implements Command<CommandSourceStack> {
|
||||
private final CommandHandler.Executor handler;
|
||||
|
||||
WrappingExecutor(final CommandHandler.@NonNull Executor handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int run(final @NonNull CommandContext<CommandSourceStack> context) {
|
||||
this.handler.execute(MiniMOTDNeoForge.this.audiences().audience(context.getSource()));
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
final CommandHandler handler = new CommandHandler(this.miniMOTD);
|
||||
NeoForge.EVENT_BUS.addListener((RegisterCommandsEvent event) -> {
|
||||
event.getDispatcher().register(
|
||||
literal("minimotd")
|
||||
.requires(source -> source.hasPermission(4))
|
||||
.then(literal("reload").executes(new WrappingExecutor(handler::reload)))
|
||||
.then(literal("about").executes(new WrappingExecutor(handler::about)))
|
||||
.then(literal("help").executes(new WrappingExecutor(handler::help)))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public @NonNull MinecraftServerAudiences audiences() {
|
||||
return this.audiences;
|
||||
}
|
||||
|
||||
public static @NonNull MiniMOTDNeoForge get() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public @NonNull MinecraftServer requireServer() {
|
||||
if (this.server == null) {
|
||||
throw new IllegalStateException("Server requested before started");
|
||||
}
|
||||
return this.server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Path dataDirectory() {
|
||||
return this.dataDirectory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Logger logger() {
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerStatus.@NonNull Favicon loadIcon(final @NonNull BufferedImage bufferedImage) throws Exception {
|
||||
final ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ImageIO.write(bufferedImage, "PNG", out);
|
||||
final ServerStatus.Favicon favicon = new ServerStatus.Favicon(out.toByteArray());
|
||||
((ServerStatusFaviconAccess) (Object) favicon).cacheEncodedIcon();
|
||||
return favicon;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge.access;
|
||||
|
||||
public interface ConnectionAccess {
|
||||
void protocolVersion(int protocolVersion);
|
||||
|
||||
int protocolVersion();
|
||||
}
|
||||
+5
-20
@@ -21,27 +21,12 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.common.util;
|
||||
package xyz.jpenilla.minimotd.neoforge.access;
|
||||
|
||||
import net.kyori.adventure.text.ComponentLike;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import static net.kyori.adventure.text.Component.empty;
|
||||
import static net.kyori.adventure.text.Component.text;
|
||||
public interface ServerStatusFaviconAccess {
|
||||
@Nullable String cachedEncodedIcon();
|
||||
|
||||
@DefaultQualifier(NonNull.class)
|
||||
public final class Components {
|
||||
private Components() {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
public static TextComponent ofChildren(final ComponentLike... children) {
|
||||
if (children.length == 0) {
|
||||
return empty();
|
||||
}
|
||||
|
||||
return text().append(children).build();
|
||||
}
|
||||
void cacheEncodedIcon();
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge.mixin;
|
||||
|
||||
import net.minecraft.network.Connection;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import xyz.jpenilla.minimotd.neoforge.access.ConnectionAccess;
|
||||
|
||||
@Unique
|
||||
@Mixin(Connection.class)
|
||||
@Implements({@Interface(iface = ConnectionAccess.class, prefix = "miniMOTD$")})
|
||||
abstract class ConnectionMixin {
|
||||
private int miniMOTD$protocolVersion = -1;
|
||||
|
||||
public void miniMOTD$protocolVersion(final int protocolVersion) {
|
||||
this.miniMOTD$protocolVersion = protocolVersion;
|
||||
}
|
||||
|
||||
public int miniMOTD$protocolVersion() {
|
||||
return this.miniMOTD$protocolVersion;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge.mixin;
|
||||
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.handshake.ClientIntentionPacket;
|
||||
import net.minecraft.server.network.ServerHandshakePacketListenerImpl;
|
||||
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 xyz.jpenilla.minimotd.neoforge.access.ConnectionAccess;
|
||||
|
||||
@Mixin(ServerHandshakePacketListenerImpl.class)
|
||||
abstract class ServerHandshakePacketListenerImplMixin {
|
||||
@Shadow @Final private Connection connection;
|
||||
|
||||
@Inject(method = "handleIntention", at = @At("HEAD"))
|
||||
public void injectHandleIntention(final ClientIntentionPacket packet, final CallbackInfo ci) {
|
||||
((ConnectionAccess) this.connection).protocolVersion(packet.protocolVersion());
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge.mixin;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.DataResult;
|
||||
import com.mojang.serialization.codecs.PrimitiveCodec;
|
||||
import java.util.function.Function;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import xyz.jpenilla.minimotd.neoforge.access.ServerStatusFaviconAccess;
|
||||
|
||||
@Mixin(ServerStatus.Favicon.class)
|
||||
abstract class ServerStatusFaviconMixin implements ServerStatusFaviconAccess {
|
||||
@Unique
|
||||
private static Function<ServerStatus.Favicon, String> VANILLA_ENCODE_TO_STRING;
|
||||
|
||||
@Redirect(
|
||||
method = "<clinit>",
|
||||
at = @At(
|
||||
target = "Lcom/mojang/serialization/codecs/PrimitiveCodec;comapFlatMap(Ljava/util/function/Function;Ljava/util/function/Function;)Lcom/mojang/serialization/Codec;",
|
||||
value = "INVOKE"
|
||||
),
|
||||
remap = false
|
||||
)
|
||||
private static Codec<ServerStatus.Favicon> makeCodec(
|
||||
final PrimitiveCodec<String> stringCodec,
|
||||
final Function<String, DataResult<ServerStatus.Favicon>> decode,
|
||||
final Function<ServerStatus.Favicon, String> encode
|
||||
) {
|
||||
VANILLA_ENCODE_TO_STRING = encode;
|
||||
return stringCodec.comapFlatMap(decode, favicon -> {
|
||||
final @Nullable String encodedIcon = ((ServerStatusFaviconAccess) (Object) favicon).cachedEncodedIcon();
|
||||
if (encodedIcon != null) {
|
||||
return encodedIcon;
|
||||
}
|
||||
return encode.apply(favicon);
|
||||
});
|
||||
}
|
||||
|
||||
@Unique
|
||||
private String encodedIcon;
|
||||
|
||||
@Override
|
||||
public @Nullable String cachedEncodedIcon() {
|
||||
return this.encodedIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheEncodedIcon() {
|
||||
this.encodedIcon = VANILLA_ENCODE_TO_STRING.apply((ServerStatus.Favicon) (Object) this);
|
||||
}
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge.mixin;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.network.ServerStatusPacketListenerImpl;
|
||||
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.Redirect;
|
||||
import xyz.jpenilla.minimotd.common.Constants;
|
||||
import xyz.jpenilla.minimotd.common.MiniMOTD;
|
||||
import xyz.jpenilla.minimotd.common.PingResponse;
|
||||
import xyz.jpenilla.minimotd.common.config.MOTDConfig;
|
||||
import xyz.jpenilla.minimotd.common.util.ComponentColorDownsampler;
|
||||
import xyz.jpenilla.minimotd.neoforge.MiniMOTDNeoForge;
|
||||
import xyz.jpenilla.minimotd.neoforge.access.ConnectionAccess;
|
||||
import xyz.jpenilla.minimotd.neoforge.util.MutableServerStatus;
|
||||
|
||||
@Mixin(ServerStatusPacketListenerImpl.class)
|
||||
abstract class ServerStatusPacketListenerImplMixin {
|
||||
@Shadow @Final private Connection connection;
|
||||
|
||||
@Redirect(
|
||||
method = "handleStatusRequest",
|
||||
at = @At(value = "FIELD", target = "Lnet/minecraft/server/network/ServerStatusPacketListenerImpl;status:Lnet/minecraft/network/protocol/status/ServerStatus;")
|
||||
)
|
||||
public ServerStatus injectHandleStatusRequest(final ServerStatusPacketListenerImpl instance) {
|
||||
final MiniMOTDNeoForge miniMOTDNeoForge = MiniMOTDNeoForge.get();
|
||||
final MinecraftServer minecraftServer = miniMOTDNeoForge.requireServer();
|
||||
final ServerStatus vanillaStatus = Objects.requireNonNull(minecraftServer.getStatus(), "vanillaStatus");
|
||||
|
||||
final MiniMOTD<ServerStatus.Favicon> miniMOTD = miniMOTDNeoForge.miniMOTD();
|
||||
final MOTDConfig config = miniMOTD.configManager().mainConfig();
|
||||
|
||||
final PingResponse<ServerStatus.Favicon> response = miniMOTD.createMOTD(
|
||||
config,
|
||||
minecraftServer.getPlayerCount(),
|
||||
vanillaStatus.players().map(ServerStatus.Players::max).orElseGet(minecraftServer::getMaxPlayers)
|
||||
);
|
||||
|
||||
final MutableServerStatus modifiedStatus = new MutableServerStatus(vanillaStatus);
|
||||
response.motd(motd -> {
|
||||
if (((ConnectionAccess) this.connection).protocolVersion() >= Constants.MINECRAFT_1_16_PROTOCOL_VERSION) {
|
||||
modifiedStatus.description(miniMOTDNeoForge.audiences().asNative(motd));
|
||||
} else {
|
||||
modifiedStatus.description(miniMOTDNeoForge.audiences().asNative(ComponentColorDownsampler.downsampler().downsample(motd)));
|
||||
}
|
||||
});
|
||||
response.icon(favicon -> modifiedStatus.favicon(Optional.of(favicon)));
|
||||
|
||||
if (response.hidePlayerCount()) {
|
||||
modifiedStatus.players(Optional.empty());
|
||||
} else {
|
||||
final ServerStatus.Players newPlayers = new ServerStatus.Players(
|
||||
response.playerCount().maxPlayers(),
|
||||
response.playerCount().onlinePlayers(),
|
||||
response.disablePlayerListHover()
|
||||
? Collections.emptyList()
|
||||
: vanillaStatus.players().map(ServerStatus.Players::sample).orElse(Collections.emptyList())
|
||||
);
|
||||
modifiedStatus.players(Optional.of(newPlayers));
|
||||
}
|
||||
|
||||
return modifiedStatus.toServerStatus();
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* This file is part of MiniMOTD, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) 2020-2024 Jason Penilla
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package xyz.jpenilla.minimotd.neoforge.util;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
|
||||
@SuppressWarnings({"OptionalUsedAsFieldOrParameterType", "unused"})
|
||||
@DefaultQualifier(NonNull.class)
|
||||
public final class MutableServerStatus {
|
||||
private Component description;
|
||||
private Optional<ServerStatus.Players> players;
|
||||
private Optional<ServerStatus.Version> version;
|
||||
private Optional<ServerStatus.Favicon> favicon;
|
||||
private boolean enforcesSecureChat;
|
||||
private boolean isModded; // NeoForge addition
|
||||
|
||||
public MutableServerStatus(final ServerStatus status) {
|
||||
this.description = status.description();
|
||||
this.players = status.players();
|
||||
this.version = status.version();
|
||||
this.favicon = status.favicon();
|
||||
this.enforcesSecureChat = status.enforcesSecureChat();
|
||||
this.isModded = status.isModded(); // NeoForge addition
|
||||
}
|
||||
|
||||
public ServerStatus toServerStatus() {
|
||||
return new ServerStatus(this.description, this.players, this.version, this.favicon, this.enforcesSecureChat, this.isModded);
|
||||
}
|
||||
|
||||
public Component description() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public void description(final Component description) {
|
||||
Objects.requireNonNull(description, "description");
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Optional<ServerStatus.Players> players() {
|
||||
return this.players;
|
||||
}
|
||||
|
||||
public void players(final Optional<ServerStatus.Players> players) {
|
||||
Objects.requireNonNull(players, "players");
|
||||
this.players = players;
|
||||
}
|
||||
|
||||
public Optional<ServerStatus.Version> version() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public void version(final Optional<ServerStatus.Version> version) {
|
||||
Objects.requireNonNull(version, "version");
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Optional<ServerStatus.Favicon> favicon() {
|
||||
return this.favicon;
|
||||
}
|
||||
|
||||
public void favicon(final Optional<ServerStatus.Favicon> favicon) {
|
||||
Objects.requireNonNull(favicon, "favicon");
|
||||
this.favicon = favicon;
|
||||
}
|
||||
|
||||
public boolean enforcesSecureChat() {
|
||||
return this.enforcesSecureChat;
|
||||
}
|
||||
|
||||
public void enforcesSecureChat(final boolean enforcesSecureChat) {
|
||||
this.enforcesSecureChat = enforcesSecureChat;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[1,)"
|
||||
license = "MIT"
|
||||
issueTrackerURL = "${github_url}/issues/"
|
||||
showAsResourcePack = false
|
||||
|
||||
[[mods]]
|
||||
modId = "minimotd"
|
||||
version = "${version}"
|
||||
displayName = "MiniMOTD"
|
||||
displayURL = "${github_url}"
|
||||
authors = "jmp"
|
||||
description = "${description}"
|
||||
displayTest = "IGNORE_ALL_VERSION"
|
||||
|
||||
[[dependencies.minimotd]]
|
||||
modId = "neoforge"
|
||||
type = "required"
|
||||
versionRange = "[21.0,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.minimotd]]
|
||||
modId = "minecraft"
|
||||
type = "required"
|
||||
versionRange = "[1.21.8,1.22)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.minimotd]]
|
||||
modId = "adventure_platform_neoforge"
|
||||
type = "required"
|
||||
versionRange = "*"
|
||||
ordering = "AFTER"
|
||||
side = "BOTH"
|
||||
|
||||
[[mixins]]
|
||||
config = "minimotd-neoforge.mixins.json"
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8.4",
|
||||
"package": "xyz.jpenilla.minimotd.neoforge.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"ConnectionMixin",
|
||||
"ServerHandshakePacketListenerImplMixin",
|
||||
"ServerStatusFaviconMixin",
|
||||
"ServerStatusPacketListenerImplMixin"
|
||||
],
|
||||
"client": [
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,7 @@ publishMods.modrinth {
|
||||
"1.17.1",
|
||||
"1.18.2",
|
||||
"1.19.4",
|
||||
"1.20.4"
|
||||
"1.20.6",
|
||||
"1.21.8",
|
||||
)
|
||||
}
|
||||
+23
-5
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base"
|
||||
"config:recommended"
|
||||
],
|
||||
"ignoreDeps": [
|
||||
"quiet-fabric-loom",
|
||||
@@ -14,19 +14,37 @@
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "Correct Fabric API version handling",
|
||||
"matchPackageNames": ["net.fabricmc.fabric-api:fabric-api", "net.fabricmc.fabric-api:fabric-api-deprecated"],
|
||||
"matchPackageNames": [
|
||||
"net.fabricmc.fabric-api:fabric-api",
|
||||
"net.fabricmc.fabric-api:fabric-api-deprecated"
|
||||
],
|
||||
"versioning": "regex:^(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(?:\\+(?<compatibility>.*))?$"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["github-actions", "gradle-wrapper"],
|
||||
"description": "Correct NeoForge version handling",
|
||||
"matchPackageNames": [
|
||||
"net.neoforged:neoforge"
|
||||
],
|
||||
"versioning": "regex:^(?<compatibility>(\\d+\\.){2})(?<minor>\\d+)(-beta)?$"
|
||||
},
|
||||
{
|
||||
"matchManagers": [
|
||||
"github-actions",
|
||||
"gradle-wrapper"
|
||||
],
|
||||
"groupName": "gradle and github actions"
|
||||
},
|
||||
{
|
||||
"matchDepTypes": ["plugin"],
|
||||
"matchDepTypes": [
|
||||
"plugin"
|
||||
],
|
||||
"groupName": "gradle and github actions"
|
||||
},
|
||||
{
|
||||
"matchPaths": ["build-logic/*", "buildSrc/*"],
|
||||
"matchFileNames": [
|
||||
"build-logic/*",
|
||||
"buildSrc/*"
|
||||
],
|
||||
"groupName": "gradle and github actions"
|
||||
}
|
||||
],
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
+10
-18
@@ -1,32 +1,23 @@
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
|
||||
mavenContent { snapshotsOnly() }
|
||||
}
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://repo.spongepowered.org/repository/maven-public/")
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") {
|
||||
mavenContent { snapshotsOnly() }
|
||||
}
|
||||
}
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
}
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven("https://maven.fabricmc.net/")
|
||||
maven("https://repo.jpenilla.xyz/snapshots/")
|
||||
maven("https://maven.neoforged.net/releases/") {
|
||||
mavenContent { releasesOnly() }
|
||||
}
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") {
|
||||
mavenContent { snapshotsOnly() }
|
||||
}
|
||||
}
|
||||
includeBuild("gradle/build-logic")
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("quiet-fabric-loom") version "1.5-SNAPSHOT"
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
id("net.neoforged.moddev.repositories") version "2.0.103" apply false
|
||||
id("quiet-fabric-loom") version "1.11-SNAPSHOT" apply false
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
}
|
||||
|
||||
rootProject.name = "MiniMOTD"
|
||||
@@ -48,6 +39,7 @@ sequenceOf(
|
||||
"bungeecord",
|
||||
"velocity",
|
||||
"fabric",
|
||||
"neoforge",
|
||||
).forEach(::platform)
|
||||
|
||||
dist("bukkit-bungeecord")
|
||||
Reference in new issue
Block a user