3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-28 09:00:09 +01:00

Deprecate cancelClientbound/Serverbound with new id parameter

Dieser Commit ist enthalten in:
Nassim Jahnke 2021-09-05 14:02:33 +02:00
Ursprung f4f7215a6a
Commit 68e4146f3b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 20 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -176,6 +176,11 @@ public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 exte
}); });
} }
@Override
public void cancelServerbound(State state, int newPacketID) {
cancelServerbound(state, -1, newPacketID);
}
@Override @Override
public void cancelClientbound(State state, int oldPacketID, int newPacketID) { public void cancelClientbound(State state, int oldPacketID, int newPacketID) {
registerClientbound(state, oldPacketID, newPacketID, new PacketRemapper() { registerClientbound(state, oldPacketID, newPacketID, new PacketRemapper() {
@ -186,6 +191,11 @@ public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 exte
}); });
} }
@Override
public void cancelClientbound(State state, int oldPacketID) {
cancelClientbound(state, oldPacketID, -1);
}
@Override @Override
public void registerClientbound(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override) { public void registerClientbound(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override) {
ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper); ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper);

Datei anzeigen

@ -67,11 +67,13 @@ public interface Protocol<C1 extends ClientboundPacketType, C2 extends Clientbou
*/ */
void registerServerbound(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override); void registerServerbound(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override);
/**
* @deprecated use {@link #cancelServerbound(State, int)}
*/
@Deprecated/*(forRemoval = true)*/
void cancelServerbound(State state, int oldPacketID, int newPacketID); void cancelServerbound(State state, int oldPacketID, int newPacketID);
default void cancelServerbound(State state, int newPacketID) { void cancelServerbound(State state, int newPacketID);
cancelServerbound(state, -1, newPacketID);
}
default void registerClientbound(State state, int oldPacketID, int newPacketID) { default void registerClientbound(State state, int oldPacketID, int newPacketID) {
registerClientbound(state, oldPacketID, newPacketID, null); registerClientbound(state, oldPacketID, newPacketID, null);
@ -81,11 +83,13 @@ public interface Protocol<C1 extends ClientboundPacketType, C2 extends Clientbou
registerClientbound(state, oldPacketID, newPacketID, packetRemapper, false); registerClientbound(state, oldPacketID, newPacketID, packetRemapper, false);
} }
/**
* @deprecated use {@link #cancelClientbound(State, int)}
*/
@Deprecated/*(forRemoval = true)*/
void cancelClientbound(State state, int oldPacketID, int newPacketID); void cancelClientbound(State state, int oldPacketID, int newPacketID);
default void cancelClientbound(State state, int oldPacketID) { void cancelClientbound(State state, int oldPacketID);
cancelClientbound(state, oldPacketID, -1);
}
/** /**
* Registers a clientbound packet, with id transformation and remapper. * Registers a clientbound packet, with id transformation and remapper.