diff --git a/gradle.properties b/gradle.properties index 983fca1..91a2b67 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication loader_version=0.14.14 -viaver_version=4.6.0-23w07a-SNAPSHOT +viaver_version=4.6.0-1.19.4-rc2-SNAPSHOT yaml_version=1.33 # example: 1.19.1-rc2 -modrinth_mc_snapshot=23w07a +modrinth_mc_snapshot=1.19.4-rc2 # example: 1.19-Snapshot curseforge_mc_snapshot=1.19-Snapshot diff --git a/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java b/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java index 1ccff20..f10f30d 100644 --- a/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java +++ b/src/main/java/com/viaversion/fabric/common/provider/AbstractFabricPlatform.java @@ -76,6 +76,14 @@ public abstract class AbstractFabricPlatform implements ViaPlatform { })); } + @Override + public FutureTaskId runRepeatingAsync(Runnable runnable, long ticks) { + return new FutureTaskId(eventLoop() + .scheduleAtFixedRate(() -> runAsync(runnable), 0, ticks * 50, TimeUnit.MILLISECONDS) + .addListener(errorLogger()) + ); + } + @Override public FutureTaskId runSync(Runnable runnable, long ticks) { // ViaVersion seems to not need to run delayed tasks on main thread diff --git a/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/ViaFabric.java b/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/ViaFabric.java index 5cbeeab..f1c914d 100644 --- a/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/ViaFabric.java +++ b/viafabric-mc114/src/main/java/com/viaversion/fabric/mc114/ViaFabric.java @@ -14,7 +14,6 @@ import com.viaversion.fabric.mc114.platform.FabricPlatform; import com.viaversion.fabric.mc114.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; @@ -67,9 +66,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -81,6 +79,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); } diff --git a/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/ViaFabric.java b/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/ViaFabric.java index 4afc839..55ab8dd 100644 --- a/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/ViaFabric.java +++ b/viafabric-mc115/src/main/java/com/viaversion/fabric/mc115/ViaFabric.java @@ -14,7 +14,6 @@ import com.viaversion.fabric.mc115.platform.FabricPlatform; import com.viaversion.fabric.mc115.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; @@ -67,9 +66,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -81,6 +79,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); } diff --git a/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/ViaFabric.java b/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/ViaFabric.java index 7089ee7..cc95474 100644 --- a/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/ViaFabric.java +++ b/viafabric-mc116/src/main/java/com/viaversion/fabric/mc116/ViaFabric.java @@ -14,7 +14,6 @@ import com.viaversion.fabric.mc116.platform.FabricPlatform; import com.viaversion.fabric.mc116.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; @@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); } diff --git a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/ViaFabric.java b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/ViaFabric.java index 61de231..8d43147 100644 --- a/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/ViaFabric.java +++ b/viafabric-mc117/src/main/java/com/viaversion/fabric/mc117/ViaFabric.java @@ -14,7 +14,6 @@ import com.viaversion.fabric.mc117.platform.FabricPlatform; import com.viaversion.fabric.mc117.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; @@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); } diff --git a/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/ViaFabric.java b/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/ViaFabric.java index 4a76912..6c2f0fb 100644 --- a/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/ViaFabric.java +++ b/viafabric-mc118/src/main/java/com/viaversion/fabric/mc118/ViaFabric.java @@ -14,7 +14,6 @@ import com.viaversion.fabric.mc118.platform.FabricPlatform; import com.viaversion.fabric.mc118.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; @@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); } diff --git a/viafabric-mc119/build.gradle.kts b/viafabric-mc119/build.gradle.kts index e23fa54..d661762 100644 --- a/viafabric-mc119/build.gradle.kts +++ b/viafabric-mc119/build.gradle.kts @@ -1,8 +1,8 @@ dependencies { - minecraft("com.mojang:minecraft:23w07a") - mappings("net.fabricmc:yarn:23w07a+build.10:v2") + minecraft("com.mojang:minecraft:1.19.4-rc2") + mappings("net.fabricmc:yarn:1.19.4-rc2+build.1:v2") - modImplementation("net.fabricmc.fabric-api:fabric-api:0.74.1+1.19.4") + modImplementation("net.fabricmc.fabric-api:fabric-api:0.75.3+1.19.4") modImplementation("com.terraformersmc:modmenu:5.0.0-alpha.4") } diff --git a/viafabric-mc119/src/main/java/com/viaversion/fabric/mc119/ViaFabric.java b/viafabric-mc119/src/main/java/com/viaversion/fabric/mc119/ViaFabric.java index 605f665..e7a1d2f 100644 --- a/viafabric-mc119/src/main/java/com/viaversion/fabric/mc119/ViaFabric.java +++ b/viafabric-mc119/src/main/java/com/viaversion/fabric/mc119/ViaFabric.java @@ -14,7 +14,6 @@ import com.viaversion.fabric.mc119.platform.FabricPlatform; import com.viaversion.fabric.mc119.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.DefaultEventLoop; import io.netty.channel.EventLoop; @@ -69,9 +68,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -83,6 +81,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); } diff --git a/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/ViaFabric.java b/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/ViaFabric.java index b5b445b..8b48d20 100644 --- a/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/ViaFabric.java +++ b/viafabric-mc18/src/main/java/com/viaversion/fabric/mc18/ViaFabric.java @@ -12,7 +12,6 @@ import com.viaversion.fabric.mc18.platform.FabricPlatform; import com.viaversion.fabric.mc18.platform.VFLoader; import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.EventLoop; import io.netty.channel.local.LocalEventLoopGroup; @@ -53,9 +52,8 @@ public class ViaFabric implements ModInitializer { platform.init(); - FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache()); - - ((ViaManagerImpl) Via.getManager()).init(); + ViaManagerImpl manager = (ViaManagerImpl) Via.getManager(); + manager.init(); Via.getManager().getProtocolManager().registerBaseProtocol(HostnameParserProtocol.INSTANCE, Range.lessThan(Integer.MIN_VALUE)); ProtocolVersion.register(-2, "AUTO"); @@ -67,6 +65,8 @@ public class ViaFabric implements ModInitializer { config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric") .resolve("viafabric.yml").toFile()); + manager.onServerLoaded(); + INIT_FUTURE.complete(null); }