Add apiVersion to ViaAPI, some jd

This commit is contained in:
KennyTV 2021-05-22 19:39:26 +02:00
parent 9484526d39
commit 8bcd8fd995
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
3 changed files with 19 additions and 3 deletions

View File

@ -45,6 +45,16 @@ import java.util.UUID;
*/
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.
*

View File

@ -181,7 +181,7 @@ public interface ChunkSection {
/**
* 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
*/
@ -189,6 +189,12 @@ public interface ChunkSection {
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();
void setLight(@Nullable ChunkSectionLight light);

View File

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