Skip to content

Commit

Permalink
Add some info messages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed May 6, 2024
1 parent b4737f1 commit 1cd33a9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
30 changes: 25 additions & 5 deletions patches/server/0012-Optimize-default-configurations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357
}

diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 20d215e53b4a02d7f52197decf05fd1e6ee44669..f832834e02594eb35e08108054f395be3b2bed51 100644
index 252e5f67f39c1fb5db2cba3a6cbc5490d472a29b..846b5b672c93e876b3d0ade4fed37d78b97bd5e7 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -178,7 +178,7 @@ public class Main {
Expand All @@ -292,7 +292,7 @@ index 20d215e53b4a02d7f52197decf05fd1e6ee44669..f832834e02594eb35e08108054f395be

File commandFile = (File) optionset.valueOf("commands-settings");
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 5b7ed096999dbb7e95fb7d615e737f19604f58ff..9684e7079c9586e764931e5b6c40961ac9eda853 100644
index d43ebcf4448240f86eca1a4127b534851e7b9618..7d4872beca68f081d8f9f32cf8b2ab40957870ca 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -131,14 +131,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
Expand Down Expand Up @@ -324,7 +324,7 @@ index 5b7ed096999dbb7e95fb7d615e737f19604f58ff..9684e7079c9586e764931e5b6c40961a
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d06473349dff50a33b7843ae6dcde28f50fcd708..c1e5bc9cab10c51712dad1da8ad50e5d821b85b0 100644
index 76d61c1f0a8e2fd0bed6be3052828a04aedb443d..257b050f552f2edab861df9c5f00b05cafa385b1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -426,7 +426,7 @@ public final class CraftServer implements Server {
Expand All @@ -337,16 +337,36 @@ index d06473349dff50a33b7843ae6dcde28f50fcd708..c1e5bc9cab10c51712dad1da8ad50e5d
if (!this.configuration.isString("aliases")) {
legacyAlias = this.configuration.getConfigurationSection("aliases");
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index b02a0dddd99df1691c125660828a61cc4a5a4d02..739bcbb7388b948982202b35a708753103fa38e8 100644
index b02a0dddd99df1691c125660828a61cc4a5a4d02..d6ead6b1bc73df85a8e8938acd2e8465dd82df97 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -6,5 +6,6 @@ public interface Options {

boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean AGGRESSIVE = Boolean.getBoolean("Plazma.aggressiveOptimize");
+ boolean AGGRESSIVE = Boolean.getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;

}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
index af27a8199c46c2995424a60893439c0dbc162791..65cdf3336f11350351fb2da792cfc5f9fbcc0a72 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -33,6 +33,15 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Wo
static final String WORLD_CONFIG_FILE_NAME = "plazma-world.yml";
static final boolean OPTIMIZE = !Options.NO_OPTIMIZE;

+ static {
+ if (Options.AGGRESSIVE) {
+ LOGGER.warn("Aggressive configuration optimization is enabled. It can greatly affect gameplay.");
+ } else if (OPTIMIZE) {
+ LOGGER.warn("Default configuration optimization is enabled. It may have some impact on gameplay.");
+ LOGGER.warn("To disable default configuration optimization, type \"-DPlazma.disableConfigOptimization\" before the -jar in the server startup command.");
+ }
+ }
+
private static final String HEADER_START = """
#### ENGLISH ####
This is the %s configuration file for Plazma.
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 9311fcb675d20ee77d225e3cffe1d6ce56601963..f9779f8cf0399e434ebe9e49e7bae5386ce01410 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Use Plazma logo instead if server favicon doesn't exist


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b2a5d324d0f364193c7aee8ef55c50c57f17e250..fa3019feb8b1ad7c2603f87f8b4b568013ec89b1 100644
index 30a8b5d434efa47380e635a7b1010df510f09891..3d2c4e7dcf8a17c68002086e87e78e6c059a427b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1547,29 +1547,34 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1547,29 +1547,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}

private Optional<ServerStatus.Favicon> loadStatusIcon() {
Expand Down Expand Up @@ -49,6 +49,8 @@ index b2a5d324d0f364193c7aee8ef55c50c57f17e250..fa3019feb8b1ad7c2603f87f8b4b5680
+ )
+ ) {
+ if (stream == null) return Optional.empty();
+ if (file == null && !org.plazmamc.plazma.Options.VANILLA_ICO)
+ LOGGER.info("No server icon found, using the logo instead.");
+
+ BufferedImage bufferedimage = ImageIO.read(stream);
+
Expand All @@ -67,13 +69,13 @@ index b2a5d324d0f364193c7aee8ef55c50c57f17e250..fa3019feb8b1ad7c2603f87f8b4b5680

public Optional<Path> getWorldScreenshotFile() {
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index 739bcbb7388b948982202b35a708753103fa38e8..e04a9c86210b62a95f6e72800ac2a3ba83ddf01f 100644
index d6ead6b1bc73df85a8e8938acd2e8465dd82df97..c5c16ce481445cd9bf4184e47fe0c37ddc97a009 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -7,5 +7,6 @@ public interface Options {
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
boolean AGGRESSIVE = Boolean.getBoolean("Plazma.aggressiveOptimize");
boolean AGGRESSIVE = Boolean.getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;
+ boolean VANILLA_ICO = Boolean.getBoolean("Plazma.useVanillaServerFavicon");

}

0 comments on commit 1cd33a9

Please sign in to comment.