Updated to 1.20.1

This commit is contained in:
FlorianMichael 2023-06-13 00:05:24 +02:00
parent 38f125e18d
commit a198359f06
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
6 changed files with 18 additions and 17 deletions

View File

@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx8G
org.gradle.parallel=true
# minecraft and fabric
minecraft_version=1.20
yarn_mappings=1.20+build.1
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.1
loader_version=0.14.21
fabric_api_version=0.83.0+1.20
fabric_api_version=0.83.0+1.20.1
# viafabricplus
mod_version=2.7.6-SNAPSHOT
@ -18,8 +18,8 @@ raknet_transport_version=1.0.0.CR1-SNAPSHOT
classic4j_version=1.2.0
# viaversion (and required) libs
viaversion_version=4.7.0
viabackwards_version=4.7.0
viaversion_version=4.7.1-SNAPSHOT
viabackwards_version=4.7.1-SNAPSHOT
snake_yml_version=2.0
# raphimc libs

View File

@ -24,6 +24,8 @@ import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
import de.florianmichael.viafabricplus.protocolhack.netty.ViaFabricPlusVLLegacyPipeline;
import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.RakNetClientConnection;
import io.netty.channel.*;
import io.netty.channel.epoll.EpollEventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.encryption.PacketDecryptor;
import net.minecraft.network.encryption.PacketEncryptor;
@ -81,14 +83,12 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler<
}
}
@Inject(method = "connect", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Lazy;get()Ljava/lang/Object;", shift = At.Shift.BEFORE), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
private static void captureAddress(InetSocketAddress address, boolean useEpoll, CallbackInfoReturnable<ClientConnection> cir, final ClientConnection clientConnection, Class class_, Lazy lazy) {
((IClientConnection) clientConnection).viafabricplus_captureAddress(address);
@Inject(method = "connect(Ljava/net/InetSocketAddress;ZLnet/minecraft/network/ClientConnection;)Lio/netty/channel/ChannelFuture;", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Lazy;get()Ljava/lang/Object;", shift = At.Shift.BEFORE), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
private static void captureAddress(InetSocketAddress address, boolean useEpoll, ClientConnection connection, CallbackInfoReturnable<ChannelFuture> cir, Class class_, Lazy lazy) {
((IClientConnection) connection).viafabricplus_captureAddress(address);
if (ProtocolHack.getForcedVersions().containsKey(address) ? (ProtocolHack.getForcedVersions().get(address).getVersion() == VersionEnum.bedrockLatest.getVersion()) :
ProtocolHack.getTargetVersion() == VersionEnum.bedrockLatest) {
RakNetClientConnection.connectRakNet(clientConnection, address, lazy, class_);
cir.setReturnValue(clientConnection);
if (ProtocolHack.getTargetVersion(address) == VersionEnum.bedrockLatest) {
cir.setReturnValue(RakNetClientConnection.connectRakNet(connection, address, lazy, class_));
}
}

View File

@ -46,6 +46,7 @@ public abstract class MixinProtocolVersion {
viafabricplus_remaps.put("1.16.4/5", new Pair<>("1.16.4-1.16.5", null));
viafabricplus_remaps.put("1.18/1.18.1", new Pair<>("1.18-1.18.1", null));
viafabricplus_remaps.put("1.19.1/2", new Pair<>("1.19.1-1.19.2", null));
viafabricplus_remaps.put("1.20/1.20.1", new Pair<>("1.20-1.20.1", null));
}
@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;register(ILjava/lang/String;)Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;"))

View File

@ -33,7 +33,7 @@ public class PackFormatsMappings {
private final static Map<Integer, GameVersion> protocolMap = new HashMap<>();
public static void load() {
registerVersion(VersionEnum.r1_20, 15, "1.20");
registerVersion(VersionEnum.r1_20, 15, "1.20.1"); // 1.20 and 1.20.1 are the same, why care...
registerVersion(VersionEnum.r1_19_4, 13, "1.19.4");
registerVersion(VersionEnum.r1_19_3, 12, "1.19.3");
registerVersion(VersionEnum.r1_19_1tor1_19_2, 9, "1.19.2");

View File

@ -39,7 +39,7 @@ import java.util.concurrent.ThreadLocalRandom;
public class RakNetClientConnection {
private final static List<InetSocketAddress> rakNetPingSessions = new ArrayList<>();
public static void connectRakNet(final ClientConnection clientConnection, final InetSocketAddress address, final Lazy lazy, final Class channelType) {
public static ChannelFuture connectRakNet(final ClientConnection clientConnection, final InetSocketAddress address, final Lazy lazy, final Class channelType) {
final Bootstrap nettyBoostrap = new Bootstrap().group((EventLoopGroup) lazy.get()).handler(new ChannelInitializer<>() {
@Override
protected void initChannel(@NotNull Channel channel) {
@ -60,9 +60,9 @@ public class RakNetClientConnection {
}).channelFactory(channelType == EpollSocketChannel.class ? RakChannelFactory.client(EpollDatagramChannel.class) : RakChannelFactory.client(NioDatagramChannel.class));
if (getRakNetPingSessions().contains(address)) {
nettyBoostrap.bind(new InetSocketAddress(0)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE).syncUninterruptibly();
return nettyBoostrap.bind(new InetSocketAddress(0)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
} else {
nettyBoostrap.connect(address.getAddress(), address.getPort()).syncUninterruptibly();
return nettyBoostrap.connect(address.getAddress(), address.getPort());
}
}

View File

@ -29,7 +29,7 @@
"depends": {
"fabricloader": ">=0.14.11",
"fabric-api": "*",
"minecraft": "~1.20",
"minecraft": "~1.20.1",
"java": ">=17"
},
"breaks": {