3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 15:00:11 +01:00

Update to new MCPL

Dieser Commit ist enthalten in:
AlexProgrammerDE 2024-07-26 13:12:48 +02:00
Ursprung 5ebb16a192
Commit d353df2b7a
2 geänderte Dateien mit 6 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -936,19 +936,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
// This isn't a great solution, but... we want to make sure the finish configuration packet cannot be sent
// before the KnownPacks packet.
this.downstream.getSession().addListener(new ClientListener(ProtocolState.LOGIN, loginEvent.transferring()) {
@Override
public void packetReceived(Session session, Packet packet) {
if (protocol.getState() == ProtocolState.CONFIGURATION) {
if (packet instanceof ClientboundFinishConfigurationPacket) {
// Prevent
GeyserSession.this.ensureInEventLoop(() -> GeyserSession.this.sendDownstreamPacket(new ServerboundFinishConfigurationPacket()));
return;
}
}
super.packetReceived(session, packet);
}
});
this.downstream.getSession().addListener(new ClientListener(ProtocolState.LOGIN, loginEvent.transferring()));
downstream.addListener(new SessionAdapter() {
@Override
@ -1694,8 +1682,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
return;
}
if (protocol.getState() != intendedState) {
geyser.getLogger().debug("Tried to send " + packet.getClass().getSimpleName() + " packet while not in " + intendedState.name() + " state");
if (protocol.getOutboundState() != intendedState) {
geyser.getLogger().debug("Tried to send " + packet.getClass().getSimpleName() + " packet while not in " + intendedState.name() + " outbound state");
return;
}
@ -1729,7 +1717,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
}
private void sendDownstreamPacket0(Packet packet) {
ProtocolState state = protocol.getState();
ProtocolState state = protocol.getOutboundState();
if (state == ProtocolState.GAME || state == ProtocolState.CONFIGURATION || packet.getClass() == ServerboundCustomQueryAnswerPacket.class) {
downstream.sendPacket(packet);
} else {

Datei anzeigen

@ -13,7 +13,7 @@ websocket = "1.5.1"
protocol = "3.0.0.Beta2-20240704.153116-14"
raknet = "1.0.0.CR3-20240416.144209-1"
minecraftauth = "4.1.0"
mcprotocollib = "1.21-20240725.013034-16"
mcprotocollib = "1341744"
adventure = "4.14.0"
adventure-platform = "4.3.0"
junit = "5.9.2"
@ -108,7 +108,7 @@ guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
junit = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
minecraftauth = { group = "net.raphimc", name = "MinecraftAuth", version.ref = "minecraftauth" }
mcprotocollib = { group = "org.geysermc.mcprotocollib", name = "protocol", version.ref = "mcprotocollib" }
mcprotocollib = { group = "com.github.AlexProgrammerDE", name = "MCProtocolLib", version.ref = "mcprotocollib" }
raknet = { group = "org.cloudburstmc.netty", name = "netty-transport-raknet", version.ref = "raknet" }
terminalconsoleappender = { group = "net.minecrell", name = "terminalconsoleappender", version.ref = "terminalconsoleappender" }
velocity-api = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }