Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
Handle new client intent
Dieser Commit ist enthalten in:
Ursprung
27af372f79
Commit
52b9db5029
@ -35,6 +35,10 @@ import java.util.List;
|
||||
|
||||
public class BaseProtocol extends AbstractProtocol {
|
||||
|
||||
private static final int STATUS_INTENT = 1;
|
||||
private static final int LOGIN_INTENT = 2;
|
||||
private static final int TRANSFER_INTENT = 3;
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
// Handshake Packet
|
||||
@ -89,10 +93,9 @@ public class BaseProtocol extends AbstractProtocol {
|
||||
Via.getPlatform().getLogger().info("Protocol pipeline: " + pipeline.pipes());
|
||||
}
|
||||
|
||||
// Change state
|
||||
if (state == 1) {
|
||||
if (state == STATUS_INTENT) {
|
||||
info.setState(State.STATUS);
|
||||
} else if (state == 2) {
|
||||
} else if (state == LOGIN_INTENT || state == TRANSFER_INTENT) {
|
||||
info.setState(State.LOGIN);
|
||||
}
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
|
||||
wrapper.passthrough(Type.POSITION1_14); // Position
|
||||
wrapper.passthrough(Type.VAR_INT); // Block entity type
|
||||
|
||||
// No longern nullable
|
||||
// No longer nullable
|
||||
final CompoundTag tag = wrapper.read(Type.COMPOUND_TAG);
|
||||
wrapper.write(Type.COMPOUND_TAG, tag != null ? tag : new CompoundTag());
|
||||
});
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren