Compare commits

..
9 Commits
Author SHA1 Message Date
Jason Penilla fe41b21d9b release: Version 2.0.4 2021-08-10 15:40:03 -07:00
Jason Penilla cbbe201710 Minor clean up 2021-08-10 15:14:12 -07:00
Jason Penilla 30d58fc0f9 2.0.4-SNAPSHOT 2021-07-30 14:45:43 -07:00
Jason Penilla 067ec4ea65 Build and test against 1.17.1 2021-07-23 23:51:06 -07:00
Jason Penilla 22f805f4ab build: Update Gradle & Indra 2021-07-23 23:50:36 -07:00
Jason Penilla ed21f45573 fabric: Use quiet-fabric-loom 2021-07-23 23:50:36 -07:00
Jason Penilla 41b1fdffe3 sponge 8: Update for Sponge API changes 2021-07-23 23:50:36 -07:00
Jason Penilla 142f7a34f7 Remove final from virtualHostTestMode field
This was not meant to be final in the first place, however this also was causing the config to silently fail to deserialize.
2021-07-13 22:53:59 -07:00
Jason Penilla ed7fe3591b Update Velocity API dependency to 3.0.0 2021-07-06 02:34:09 -07:00
16 changed files with 35 additions and 39 deletions

No files matched your search

+1 -1
View File
@@ -3,5 +3,5 @@ plugins {
}
group = "xyz.jpenilla"
version = "2.0.3"
version = "2.0.4"
description = "Use MiniMessage text formatting in the server list MOTD."
+1 -1
View File
@@ -14,7 +14,7 @@ dependencies {
tasks {
runServer {
minecraftVersion("1.17")
minecraftVersion("1.17.1")
}
generateBukkitPluginDescription {
mustRunAfter(clean)
@@ -34,7 +34,7 @@ import xyz.jpenilla.minimotd.common.MiniMOTD;
import xyz.jpenilla.minimotd.common.PingResponse;
import xyz.jpenilla.minimotd.common.config.MiniMOTDConfig;
final class PaperPingListener implements Listener {
public final class PaperPingListener implements Listener {
private final MiniMOTDPlugin plugin;
private final LegacyComponentSerializer unusualHexSerializer = LegacyComponentSerializer.builder().hexColors().useUnusualXRepeatedCharacterHexFormat().build();
private final MiniMOTD<CachedServerIcon> miniMOTD;
@@ -33,7 +33,7 @@ import xyz.jpenilla.minimotd.common.MiniMOTD;
import xyz.jpenilla.minimotd.common.PingResponse;
import xyz.jpenilla.minimotd.common.config.MiniMOTDConfig;
final class PingListener implements Listener {
public final class PingListener implements Listener {
private final MiniMOTD<CachedServerIcon> miniMOTD;
private final LegacyComponentSerializer unusualHexSerializer = LegacyComponentSerializer.builder().hexColors().useUnusualXRepeatedCharacterHexFormat().build();
private final MiniMOTDPlugin plugin;
@@ -44,5 +44,5 @@ public final class Constants {
public static final int MINECRAFT_1_16_PROTOCOL_VERSION = 735;
public static final Component COMMAND_PREFIX = MiniMessage.get().parse("<white>[</white><gradient:#0047AB:#ADD8E6>" + PluginMetadata.NAME + "<white>]</white>");
public static final Component COMMAND_PREFIX = MiniMessage.get().parse("<white>[</white><gradient:#0047AB:#ADD8E6>" + PluginMetadata.NAME + "</gradient><white>]</white>");
}
@@ -54,23 +54,23 @@ public final class MiniMOTD<I> {
return this.platform;
}
public final Path dataDirectory() {
public Path dataDirectory() {
return this.platform.dataDirectory();
}
public final IconManager<I> iconManager() {
public IconManager<I> iconManager() {
return this.iconManager;
}
public final Logger logger() {
public Logger logger() {
return this.platform.logger();
}
public final ConfigManager configManager() {
public ConfigManager configManager() {
return this.configManager;
}
public final PingResponse<I> createMOTD(final MiniMOTDConfig config, final int onlinePlayers, final int maxPlayers) {
public PingResponse<I> createMOTD(final MiniMOTDConfig config, final int onlinePlayers, final int maxPlayers) {
final PingResponse.PlayerCount count = config.modifyPlayerCount(onlinePlayers, maxPlayers);
final PingResponse.Builder<I> response = PingResponse.<I>builder()
.playerCount(count)
@@ -60,7 +60,7 @@ public final class PingResponse<I> {
/**
* If {@link #icon()} is non-null, the provided {@link Consumer} will be called using
* it's return value. If {@link #icon()} is {@code null}, do nothing.
* its return value. If {@link #icon()} is {@code null}, do nothing.
*
* @param iconConsumer icon consumer
*/
@@ -76,7 +76,7 @@ public final class PingResponse<I> {
/**
* If {@link #motd()} is non-null, the provided {@link Consumer} will be called using
* it's return value. If {@link #motd()} is {@code null}, do nothing.
* its return value. If {@link #motd()} is {@code null}, do nothing.
*
* @param motdConsumer motd consumer
*/
@@ -38,8 +38,7 @@ public final class ConfigLoader<C> {
private static final TypeSerializerCollection SERIALIZERS;
static {
SERIALIZERS = TypeSerializerCollection.defaults()
.childBuilder()
SERIALIZERS = TypeSerializerCollection.builder()
.register(PlayerCountModifier.serializer())
.build();
}
@@ -50,11 +49,13 @@ public final class ConfigLoader<C> {
public ConfigLoader(
final @NonNull Class<C> configClass,
final @NonNull Path configPath,
final @NonNull ConfigurationOptions options
final @NonNull UnaryOperator<ConfigurationOptions> optionsModifier
) {
this.loader = HoconConfigurationLoader.builder()
.path(configPath)
.defaultOptions(options.serializers(SERIALIZERS))
.defaultOptions(options ->
optionsModifier.apply(options)
.serializers(builder -> builder.registerAll(SERIALIZERS)))
.build();
try {
this.mapper = ObjectMapper.factory().get(configClass);
@@ -66,19 +67,11 @@ public final class ConfigLoader<C> {
}
}
public ConfigLoader(
final @NonNull Class<C> configClass,
final @NonNull Path configPath,
final @NonNull UnaryOperator<ConfigurationOptions> options
) {
this(configClass, configPath, options.apply(ConfigurationOptions.defaults()));
}
public ConfigLoader(
final @NonNull Class<C> configClass,
final @NonNull Path configPath
) {
this(configClass, configPath, ConfigurationOptions.defaults());
this(configClass, configPath, options -> options);
}
public @NonNull C load() throws ConfigurateException {
@@ -57,7 +57,7 @@ public final class PluginSettings {
@Comment("Set whether to enable virtual host testing mode.\n"
+ "When enabled, MiniMOTD will print virtual host debug info to the console on each server ping.")
private final boolean virtualHostTestMode = false;
private boolean virtualHostTestMode = false;
public boolean virtualHostTestMode() {
return this.virtualHostTestMode;
+1 -1
View File
@@ -1,7 +1,7 @@
plugins {
id("minimotd.platform-conventions")
id("com.github.johnrengelman.shadow")
id("fabric-loom")
id("quiet-fabric-loom")
}
val shade: Configuration by configurations.creating
+5 -5
View File
@@ -11,7 +11,7 @@ plugins:
xyz.jpenilla.run-paper: 1.0.3
versions:
indra: 2.0.5
indra: 2.0.6
shadow: 7.0.0
testLoggerPlugin: 3.0.0
adventure: 4.8.1
@@ -27,11 +27,11 @@ versions:
bstats: 2.2.1
paperApi: 1.16.5-R0.1-SNAPSHOT
waterfallApi: 1.16-R0.4-SNAPSHOT
fabricApi: 0.34.9+1.17
fabricLoader: 0.11.3
fabricMinecraft: 1.17
fabricApi: 0.37.0+1.17
fabricLoader: 0.11.6
fabricMinecraft: 1.17.1
spongeApi7: 7.2.0
velocityApi: 1.1.7
velocityApi: 3.0.0
jupiterEngine: 5.7.0
dependencies:
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+1 -1
View File
@@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
+3 -2
View File
@@ -3,7 +3,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
repositories {
//mavenLocal()
// mavenLocal()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://papermc.io/repo/repository/maven-public/")
@@ -18,13 +18,14 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.fabricmc.net/")
maven("https://repo.jpenilla.xyz/snapshots/")
}
includeBuild("build-logic")
}
plugins {
id("ca.stellardrift.polyglot-version-catalogs") version "5.0.0"
id("fabric-loom") version "0.8-SNAPSHOT"
id("quiet-fabric-loom") version "0.8-SNAPSHOT"
}
rootProject.name = "MiniMOTD"
@@ -38,6 +38,7 @@ import org.spongepowered.api.command.CommandExecutor;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.parameter.CommandContext;
import org.spongepowered.api.config.ConfigDir;
import org.spongepowered.api.event.EventListenerRegistration;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.lifecycle.LoadedGameEvent;
import org.spongepowered.api.event.lifecycle.RefreshGameEvent;
@@ -81,9 +82,10 @@ public final class MiniMOTDPlugin implements MiniMOTDPlatform<Favicon> {
}
});
Sponge.eventManager().registerListener(
pluginContainer,
ClientPingServerEvent.class,
this.injector.getInstance(ClientPingServerEventListener.class)
EventListenerRegistration.builder(ClientPingServerEvent.class)
.plugin(pluginContainer)
.listener(this.injector.getInstance(ClientPingServerEventListener.class))
.build()
);
}