update deps, legacy intermediary is broken

This commit is contained in:
creeper123123321 2021-12-18 11:19:57 -03:00
parent 43379d2369
commit 7c88d64676
8 changed files with 22 additions and 18 deletions

View File

@ -14,7 +14,7 @@ plugins {
def ENV = System.getenv()
def vvVer = "4.1.2-SNAPSHOT"
def yamlVer = "1.29"
def yamlVer = "1.30"
description = "Client-side and server-side ViaVersion implementation for Fabric"
version = "0.4.5+" + ENV.GITHUB_RUN_NUMBER + "-" + getBranch()

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -1,8 +1,10 @@
dependencies {
minecraft("com.mojang:minecraft:1.8.9")
mappings("net.fabricmc:yarn:1.8.9+build.202110221052:v2")
mappings("net.fabricmc:yarn:1.8.9+build.202112162000:v2") {
exclude(group = "net.fabricmc", module = "fabric-loader-1.8.9")
}
modImplementation("net.legacyfabric.legacy-fabric-api:legacy-fabric-api:1.1.0+1.8.9")
modImplementation("net.legacyfabric.legacy-fabric-api:legacy-fabric-api:1.2.0+1.8.9")
modImplementation("io.github.boogiemonster1o1:modmenu:0.1.0+1.8.9")
}

View File

@ -72,7 +72,8 @@ public class ViaFabric implements ModInitializer {
private void registerCommandsV0() {
try {
CommandRegistry.INSTANCE.register(new NMSCommandImpl(Via.getManager().getCommandHandler()));
// todo fix this
//CommandRegistry.INSTANCE.register(new NMSCommandImpl(Via.getManager().getCommandHandler()));
} catch (NoClassDefFoundError ignored2) {
JLOGGER.info("Couldn't register command as Fabric Commands isn't installed");
}

View File

@ -12,7 +12,8 @@ public class ModMenuConfig implements ModMenuApi {
}
@Override
public Function<Screen, ? extends Screen> getConfigScreenFactory() {
return ViaConfigScreen::new;
// todo fix this
public Function/*<Screen, ? extends Screen>*/ getConfigScreenFactory() {
return it -> new ViaConfigScreen(((Screen) it));
}
}

View File

@ -72,7 +72,7 @@ public class FabricPlatform extends AbstractFabricPlatform {
private FutureTaskId runServerSync(Runnable runnable) {
// Kick task needs to be on main thread, it does already have error logger
return new FutureTaskId(CompletableFuture.runAsync(runnable, it -> getServer().method_6444((Callable<Void>) () -> {
return new FutureTaskId(CompletableFuture.runAsync(runnable, it -> getServer().method_10815((Callable<Void>) () -> {
it.run();
return null;
})));

View File

@ -1,6 +1,10 @@
package com.viaversion.fabric.mc18.providers;
import com.viaversion.fabric.mc18.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
@ -8,19 +12,15 @@ import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import net.minecraft.server.MinecraftServer;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public class VRHandItemProvider extends HandItemProvider {
public Item clientItem = null;
public final Map<UUID, Item> serverPlayers = new ConcurrentHashMap<>();
public Item clientItem = null;
@Override
public Item getHandItem(UserConnection info) {
@ -51,7 +51,7 @@ public class VRHandItemProvider extends HandItemProvider {
public void registerServerTick() {
try {
ServerTickEvents.END_WORLD_TICK.register(this::tickServer);
ServerTickEvents.END_SERVER_TICK.register(this::tickServer);
} catch (NoClassDefFoundError ignored1) {
ViaFabric.JLOGGER.info("Fabric Lifecycle V1 isn't installed");
}
@ -64,9 +64,9 @@ public class VRHandItemProvider extends HandItemProvider {
}
}
private void tickServer(World world) {
private void tickServer(MinecraftServer server) {
serverPlayers.clear();
world.playerEntities.forEach(it -> serverPlayers
server.getPlayerManager().getPlayers().forEach(it -> serverPlayers
.put(it.getUuid(), fromNative(it.inventory.getMainHandStack())));
}

View File

@ -41,7 +41,7 @@ public class ProtocolAutoDetector {
final ClientConnection clientConnection = new ClientConnection(NetworkSide.CLIENTBOUND);
ChannelFuture ch = new Bootstrap()
.group(ClientConnection.field_5955.get())
.group(ClientConnection.field_11553.get())
.channel(NioSocketChannel.class)
.handler(new ChannelInitializer<Channel>() {
protected void initChannel(Channel channel) {