diff --git a/gradle.properties b/gradle.properties index 254c144..da69630 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.21+build.2 loader_version=0.15.11 # Mod Properties -mod_version=0.5.3 +mod_version=0.5.4 maven_group=net.modfest archives_base_name=fireblanket diff --git a/src/main/java/net/modfest/fireblanket/Fireblanket.java b/src/main/java/net/modfest/fireblanket/Fireblanket.java index 18cf8e2..9ccc6e8 100644 --- a/src/main/java/net/modfest/fireblanket/Fireblanket.java +++ b/src/main/java/net/modfest/fireblanket/Fireblanket.java @@ -1,5 +1,6 @@ package net.modfest.fireblanket; +import net.fabricmc.api.EnvType; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback; @@ -191,21 +192,23 @@ public void onInitialize() { fullRegionSync(player.getServerWorld(), player.networkHandler::sendPacket); }); - Runnable desperateMeasures = () -> { - while (true) { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { + if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER) { + Runnable desperateMeasures = () -> { + while (true) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { - } + } - System.gc(); - } - }; + System.gc(); + } + }; - Thread desperateTimes = new Thread(desperateMeasures); + Thread desperateTimes = new Thread(desperateMeasures); - desperateTimes.start(); + desperateTimes.start(); + } } public static void fullRegionSync(ServerWorld world, Consumer> sender) {