21w41a + fix #157

This commit is contained in:
creeper123123321 2021-10-17 10:31:04 -03:00
parent a2693aafce
commit 2a5ba15209
8 changed files with 163 additions and 136 deletions

View File

@ -22,7 +22,7 @@ plugins {
}
def ENV = System.getenv()
def vvVer = "4.1.0-21w40a-SNAPSHOT"
def vvVer = "4.1.0-21w41a-SNAPSHOT"
def yamlVer = "1.29"
description = "Client-side and server-side ViaVersion implementation for Fabric"

View File

@ -32,17 +32,20 @@ import java.util.logging.Logger;
public abstract class AbstractFabricPlatform implements ViaPlatform<UUID> {
private final Logger logger = new JLoggerToLog4j(LogManager.getLogger("ViaVersion"));
private final FabricViaConfig config;
private final File dataFolder;
private FabricViaConfig config;
private File dataFolder;
private final ViaAPI<UUID> api;
{
Path configDir = FabricLoader.getInstance().getConfigDir().resolve("ViaFabric");
config = new FabricViaConfig(configDir.resolve("viaversion.yml").toFile());
dataFolder = configDir.toFile();
api = new FabricViaAPI();
}
public void init() {
Path configDir = FabricLoader.getInstance().getConfigDir().resolve("ViaFabric");
dataFolder = configDir.toFile();
config = new FabricViaConfig(configDir.resolve("viaversion.yml").toFile());
}
protected abstract ExecutorService asyncService();
protected abstract EventLoop eventLoop();

View File

@ -57,11 +57,15 @@ public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder()
.injector(new FabricInjector())
.loader(new VFLoader())
.commandHandler(new VRCommandHandler())
.platform(new FabricPlatform()).build());
.platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());

View File

@ -57,11 +57,15 @@ public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder()
.injector(new FabricInjector())
.loader(new VFLoader())
.commandHandler(new VRCommandHandler())
.platform(new FabricPlatform()).build());
.platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());

View File

@ -59,11 +59,15 @@ public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder()
.injector(new FabricInjector())
.loader(new VFLoader())
.commandHandler(new VRCommandHandler())
.platform(new FabricPlatform()).build());
.platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());

View File

@ -59,11 +59,15 @@ public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder()
.injector(new FabricInjector())
.loader(new VFLoader())
.commandHandler(new VRCommandHandler())
.platform(new FabricPlatform()).build());
.platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());

View File

@ -59,11 +59,15 @@ public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder()
.injector(new FabricInjector())
.loader(new VFLoader())
.commandHandler(new VRCommandHandler())
.platform(new FabricPlatform()).build());
.platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());

View File

@ -43,11 +43,15 @@ public class ViaFabric implements ModInitializer {
@Override
public void onInitialize() {
FabricPlatform platform = new FabricPlatform();
Via.init(ViaManagerImpl.builder()
.injector(new FabricInjector())
.loader(new VFLoader())
.commandHandler(new VRCommandHandler())
.platform(new FabricPlatform()).build());
.platform(platform).build());
platform.init();
FabricLoader.getInstance().getModContainer("viabackwards").ifPresent(mod -> MappingDataLoader.enableMappingsCache());