[ci-skip] update loom, use viabackwards-all, limit async_executor to 8 threads

This commit is contained in:
creeper123123321 2019-05-12 11:49:42 -03:00
parent f909398f38
commit a85c66f5f0
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
2 changed files with 10 additions and 17 deletions

View File

@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id("java")
id("net.minecrell.licenser") version "0.4.1"
id("fabric-loom") version "0.2.2-SNAPSHOT"
id("fabric-loom") version "0.2.3-SNAPSHOT"
id("com.palantir.git-version") version "0.12.0-rc2"
}
@ -45,13 +45,13 @@ tasks.named<ProcessResources>("processResources") {
}
dependencies {
// transitive = false, viabackwards-core because Guava is conflicting on runClient
// transitive = false because Guava is conflicting on runClient
compile("us.myles:viaversion:2.1.0-1.14.1-pre2") { isTransitive = false }
include("us.myles:viaversion:2.1.0-1.14.1-pre2")
compile("de.gerrygames:viarewind-core:1.4.0") { isTransitive = false }
include("de.gerrygames:viarewind-core:1.4.0")
compile("nl.matsv:viabackwards-core:3.0.0-19w11b") { isTransitive = false } // todo update
include("nl.matsv:viabackwards-core:3.0.0-19w11b")
compile("de.gerrygames:viarewind-all:1.4.0") { isTransitive = false }
include("de.gerrygames:viarewind-all:1.4.0")
compile("nl.matsv:viabackwards-all:3.0.0-SNAPSHOT") { isTransitive = false } // todo wait viabackwards stop shading guava
include("nl.matsv:viabackwards-all:3.0.0-SNAPSHOT")
compileOnly("com.google.code.findbugs:jsr305:3.0.2")

View File

@ -25,21 +25,16 @@
package com.github.creeper123123321.viafabric;
import com.github.creeper123123321.viafabric.commands.VRCommandHandler;
import com.github.creeper123123321.viafabric.platform.VRInjector;
import com.github.creeper123123321.viafabric.platform.VRLoader;
import com.github.creeper123123321.viafabric.platform.VRPlatform;
import com.github.creeper123123321.viafabric.platform.VRRewindPlatform;
import com.github.creeper123123321.viafabric.platform.*;
import com.github.creeper123123321.viafabric.protocol.protocol1_7_6_10to1_7_1_5.Protocol1_7_6_10To1_7_1_5;
import com.github.creeper123123321.viafabric.protocol.protocol1_8to1_7_6_10.Protocol1_8To1_7_6_10;
import com.github.creeper123123321.viafabric.util.JLoggerToLog4j;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.fabricmc.loader.api.FabricLoader;
@ -50,12 +45,10 @@ import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.function.Consumer;
import java.util.logging.Logger;
public class ViaFabric implements ModInitializer {
@ -64,8 +57,8 @@ public class ViaFabric implements ModInitializer {
public static final EventLoop EVENT_LOOP;
static {
ThreadFactory factory = new ThreadFactoryBuilder().setNameFormat("ViaFabric").build();
ASYNC_EXECUTOR = Executors.newCachedThreadPool(factory);
ThreadFactory factory = new ThreadFactoryBuilder().setNameFormat("ViaFabric-%d").build();
ASYNC_EXECUTOR = Executors.newFixedThreadPool(8, factory);
EVENT_LOOP = new DefaultEventLoop(factory);
}
@ -96,7 +89,7 @@ public class ViaFabric implements ModInitializer {
ProtocolRegistry.registerProtocol(new Protocol1_7_6_10To1_7_1_5(), Collections.singletonList(ProtocolVersion.v1_7_6.getId()), ProtocolVersion.v1_7_1.getId());
ProtocolRegistry.registerProtocol(new Protocol1_8To1_7_6_10(), Collections.singletonList(ProtocolVersion.v1_8.getId()), ProtocolVersion.v1_7_6.getId());
new VRRewindPlatform().init();
// new VRBackwardsPlatform().init(); todo reenable when viabackwards is updated
new VRBackwardsPlatform().init();
CommandRegistry.INSTANCE.register(false, c -> c.register(command("viaversion")));
CommandRegistry.INSTANCE.register(false, c -> c.register(command("viaver")));