Skip to content

Commit

Permalink
Add name change easter egg when running on snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Jun 4, 2023
1 parent 941331f commit 41c2bb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions common/src/main/java/org/embeddedt/modernfix/ModernFix.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.embeddedt.modernfix;

import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ChunkMap;
Expand All @@ -24,6 +25,8 @@ public class ModernFix {

public static final String MODID = "modernfix";

public static String NAME = "ModernFix";

public static ModernFix INSTANCE;

// Used to skip computing the blockstate caches twice
Expand All @@ -46,6 +49,8 @@ public static Executor resourceReloadExecutor() {

public ModernFix() {
INSTANCE = this;
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.snapshot_easter_egg.NameChange") && !SharedConstants.getCurrentVersion().isStable())
NAME = "PreemptiveFix";
ModernFixPlatformHooks.onServerCommandRegister(ModernFixCommands::register);
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.spam_thread_dump.ThreadDumper")) {
Thread t = new Thread() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ModernFixClient() {
// clear reserve as it's not needed
Minecraft.reserve = new byte[0];
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.branding.F3Screen")) {
brandingString = "ModernFix " + ModernFixPlatformHooks.getVersionString();
brandingString = ModernFix.NAME + " " + ModernFixPlatformHooks.getVersionString();
}
for(String className : ModernFixPlatformHooks.getCustomModOptions().get(IntegrationConstants.CLIENT_INTEGRATION_CLASS)) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ else if(isClientOnly && !ModernFixPlatformHooks.isClient())
.put("mixin.feature.integrated_server_watchdog", true)
.put("mixin.perf.faster_item_rendering", false)
.put("mixin.feature.spam_thread_dump", false)
.put("mixin.feature.snapshot_easter_egg", true)
.put("mixin.perf.blast_search_trees", shouldReplaceSearchTrees)
.put("mixin.devenv", isDevEnv)
.put("mixin.perf.remove_spawn_chunks", isDevEnv)
Expand Down

0 comments on commit 41c2bb7

Please sign in to comment.