Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
Update to 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Dec 11, 2022
1 parent 6c708e1 commit e994ede
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## lightfall-client

Support Minecraft 1.15.X - 1.16.X
Support Minecraft 1.16.X - 1.19.X

Use this with https://github.com/ArclightPowered/lightfall
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'

group = 'io.izzel.lightfall'
version = '1.1.0'
version = '1.1.1'
archivesBaseName = 'lightfallclient'

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

minecraft {
mappings channel: 'official', version: "1.19.2"
mappings channel: 'official', version: "1.19.3"
runs {
client {
workingDirectory project.file('run')
Expand All @@ -45,7 +45,7 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.19.2-43.1.1'
minecraft 'net.minecraftforge:forge:1.19.3-44.0.5'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}

Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/izzel/lightfall/client/LightfallClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.izzel.lightfall.client.bridge.ClientLoginNetHandlerBridge;
import io.izzel.lightfall.client.gui.LightfallHandshakeScreen;
import io.izzel.lightfall.client.mixin.ClientPacketListenerAccessor;
import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
Expand Down Expand Up @@ -63,8 +64,11 @@ private static void handleReset(NetworkEvent.ServerCustomPayloadEvent event) {
netManager.setProtocol(ConnectionProtocol.LOGIN);
var buffer = new FriendlyByteBuf(Unpooled.wrappedBuffer(RESET_ACK));
netManager.send(new ServerboundCustomQueryPacket(0x11FFA1, buffer));
var netHandler = new ClientHandshakePacketListenerImpl(netManager, client, new JoinMultiplayerScreen(new TitleScreen()), screen::setComponent);
((ClientLoginNetHandlerBridge) netHandler).bridge$reusePlayHandler((ClientPacketListener) netManager.getPacketListener());
var packetListener = (ClientPacketListener) netManager.getPacketListener();
var netHandler = new ClientHandshakePacketListenerImpl(netManager, client,
((ClientPacketListenerAccessor) packetListener).accessor$getServerData(),
new JoinMultiplayerScreen(new TitleScreen()), false, null, screen::setComponent);
((ClientLoginNetHandlerBridge) netHandler).bridge$reusePlayHandler(packetListener);
netManager.setListener(netHandler);
}).join();
context.setPacketHandled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ public void tick() {
@Override
protected void init() {
this.addRenderableWidget(
new Button(this.width / 2 - 100, this.height / 4 + 120 + 12, 200, 20, CommonComponents.GUI_CANCEL,
Button.builder(CommonComponents.GUI_CANCEL,
button -> {
if (this.networkManager.isConnected()) {
this.networkManager.disconnect(Component.translatable("connect.aborted"));
}
this.minecraft.setScreen(new JoinMultiplayerScreen(new TitleScreen()));
}
)
}).bounds(this.width / 2 - 100, this.height / 4 + 120 + 12, 200, 20).build()
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.izzel.lightfall.client.mixin;

import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.client.multiplayer.ServerData;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(ClientPacketListener.class)
public interface ClientPacketListenerAccessor {

@Accessor("serverData")
ServerData accessor$getServerData();
}
3 changes: 2 additions & 1 deletion src/main/resources/mixins.lightfall.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"defaultRequire": 1
},
"client": [
"ClientLoginNetHandlerMixin"
"ClientLoginNetHandlerMixin",
"ClientPacketListenerAccessor"
]
}

0 comments on commit e994ede

Please sign in to comment.