3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Add apiVersion to ViaAPI, some jd

Dieser Commit ist enthalten in:
KennyTV 2021-05-22 19:39:26 +02:00
Ursprung 9484526d39
Commit 8bcd8fd995
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 19 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -45,6 +45,16 @@ import java.util.UUID;
*/ */
public interface ViaAPI<T> { public interface ViaAPI<T> {
/**
* Returns the API version incremented with meaningful API changes.
* This includes breaking changes to existing API and larger additions.
*
* @return API version incremented with meaningful API changes
*/
default int apiVersion() {
return 1;
}
/** /**
* Returns the server's protocol version info. * Returns the server's protocol version info.
* *

Datei anzeigen

@ -181,7 +181,7 @@ public interface ChunkSection {
/** /**
* Returns whether this section holds light data. * Returns whether this section holds light data.
* Only true for &lt 1.14 clients. * Only true for &lt; 1.14 chunks.
* *
* @return whether this section holds light data * @return whether this section holds light data
*/ */
@ -189,6 +189,12 @@ public interface ChunkSection {
return getLight() != null; return getLight() != null;
} }
/**
* Returns the light of the chunk section.
* Only present for &lt; 1.14 chunks, otherwise sent separately.
*
* @return chunk section light if present
*/
@Nullable ChunkSectionLight getLight(); @Nullable ChunkSectionLight getLight();
void setLight(@Nullable ChunkSectionLight light); void setLight(@Nullable ChunkSectionLight light);

Datei anzeigen

@ -336,7 +336,7 @@ public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 exte
return "Protocol:" + getClass().getSimpleName(); return "Protocol:" + getClass().getSimpleName();
} }
public static class Packet { public static final class Packet {
private final State state; private final State state;
private final int packetId; private final int packetId;
@ -374,7 +374,7 @@ public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 exte
} }
} }
public static class ProtocolPacket { public static final class ProtocolPacket {
private final State state; private final State state;
private final int oldID; private final int oldID;
private final int newID; private final int newID;