3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Snapshot 20w49a

Dieser Commit ist enthalten in:
Five (Xer) 2020-12-02 20:39:34 +01:00 committet von FivePB
Ursprung b588bfe448
Commit 040cc29c34
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 37DED8CFF428E1A4
3 geänderte Dateien mit 60 neuen und 17 gelöschten Zeilen

Datei anzeigen

@ -54,7 +54,7 @@ public enum ProtocolVersion {
MINECRAFT_1_16_2(751, "1.16.2"), MINECRAFT_1_16_2(751, "1.16.2"),
MINECRAFT_1_16_3(753, "1.16.3"), MINECRAFT_1_16_3(753, "1.16.3"),
MINECRAFT_1_16_4(754, "1.16.4", "1.16.5"), MINECRAFT_1_16_4(754, "1.16.4", "1.16.5"),
MINECRAFT_1_17(-1, 7, "1.17"); // Note: Indev as of 20w45a (754, borked by Mojang) MINECRAFT_1_17(-1, 8, "1.17"); // Note: Indev as of 20w45a (754, borked by Mojang)
private static final int SNAPSHOT_BIT = 30; private static final int SNAPSHOT_BIT = 30;

Datei anzeigen

@ -43,6 +43,8 @@ public final class DimensionData {
private final @Nullable Boolean createDragonFight; private final @Nullable Boolean createDragonFight;
private final @Nullable Double coordinateScale; private final @Nullable Double coordinateScale;
private final @Nullable String effects; private final @Nullable String effects;
private final @Nullable Integer minY; // Required and added by 1.17
private final @Nullable Integer height; // Required and added by 1.17
/** /**
* Initializes a new {@link DimensionData} instance. * Initializes a new {@link DimensionData} instance.
@ -64,6 +66,8 @@ public final class DimensionData {
* @param createDragonFight optional. Internal flag used in the end dimension * @param createDragonFight optional. Internal flag used in the end dimension
* @param coordinateScale optional, unknown purpose * @param coordinateScale optional, unknown purpose
* @param effects optional, unknown purpose * @param effects optional, unknown purpose
* @param minY the world effective lowest build-level
* @param height the world height above zero
*/ */
public DimensionData(String registryIdentifier, public DimensionData(String registryIdentifier,
@Nullable Integer dimensionId, @Nullable Integer dimensionId,
@ -75,7 +79,8 @@ public final class DimensionData {
int logicalHeight, String burningBehaviourIdentifier, int logicalHeight, String burningBehaviourIdentifier,
@Nullable Long fixedTime, @Nullable Boolean createDragonFight, @Nullable Long fixedTime, @Nullable Boolean createDragonFight,
@Nullable Double coordinateScale, @Nullable Double coordinateScale,
@Nullable String effects) { @Nullable String effects,
@Nullable Integer minY, @Nullable Integer height) {
Preconditions.checkNotNull( Preconditions.checkNotNull(
registryIdentifier, "registryIdentifier cannot be null"); registryIdentifier, "registryIdentifier cannot be null");
Preconditions.checkArgument(registryIdentifier.length() > 0, Preconditions.checkArgument(registryIdentifier.length() > 0,
@ -103,6 +108,8 @@ public final class DimensionData {
this.createDragonFight = createDragonFight; this.createDragonFight = createDragonFight;
this.coordinateScale = coordinateScale; this.coordinateScale = coordinateScale;
this.effects = effects; this.effects = effects;
this.minY = minY;
this.height = height;
} }
public String getRegistryIdentifier() { public String getRegistryIdentifier() {
@ -173,6 +180,14 @@ public final class DimensionData {
return coordinateScale; return coordinateScale;
} }
public @Nullable Integer getMinY() {
return minY;
}
public @Nullable Integer getHeight() {
return height;
}
/** /**
* Returns a fresh {@link DimensionData} with the specified {@code registryIdentifier} * Returns a fresh {@link DimensionData} with the specified {@code registryIdentifier}
* and {@code dimensionId}. * and {@code dimensionId}.
@ -186,7 +201,7 @@ public final class DimensionData {
return new DimensionData(registryIdentifier, dimensionId, isNatural, ambientLight, isShrunk, return new DimensionData(registryIdentifier, dimensionId, isNatural, ambientLight, isShrunk,
isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork, isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork,
hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, createDragonFight, hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, createDragonFight,
coordinateScale, effects); coordinateScale, effects, minY, height);
} }
public boolean isUnannotated() { public boolean isUnannotated() {
@ -223,11 +238,19 @@ public final class DimensionData {
? details.getDouble("coordinate_scale") : null; ? details.getDouble("coordinate_scale") : null;
String effects = details.keySet().contains("effects") ? details.getString("effects") String effects = details.keySet().contains("effects") ? details.getString("effects")
: null; : null;
Integer minY = details.keySet().contains("min_y") ? details.getInt("min_y") : null;
Integer height = details.keySet().contains("height") ? details.getInt("height") : null;
if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) {
Preconditions.checkNotNull(height,
"DimensionData requires 'minY' to be present for this version");
Preconditions.checkNotNull(minY,
"DimensionData requires 'height' to be present for this version");
}
return new DimensionData( return new DimensionData(
UNKNOWN_DIMENSION_ID, null, isNatural, ambientLight, isShrunk, UNKNOWN_DIMENSION_ID, null, isNatural, ambientLight, isShrunk,
isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork, isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork,
hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, hasEnderdragonFight, hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, hasEnderdragonFight,
coordinateScale, effects); coordinateScale, effects, minY, height);
} }
/** /**
@ -306,6 +329,12 @@ public final class DimensionData {
if (effects != null) { if (effects != null) {
ret.putString("effects", effects); ret.putString("effects", effects);
} }
if (minY != null) {
ret.putInt("min_y", minY);
}
if (height != null) {
ret.putInt("height", height);
}
return ret.build(); return ret.build();
} }
} }

Datei anzeigen

@ -25,6 +25,7 @@ import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_14;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_15; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_15;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16_2; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16_2;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_17;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_7_2; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_7_2;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_8; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_8;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_9; import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_9;
@ -145,25 +146,29 @@ public enum StateRegistry {
clientbound.register(BossBar.class, BossBar::new, clientbound.register(BossBar.class, BossBar::new,
map(0x0C, MINECRAFT_1_9, false), map(0x0C, MINECRAFT_1_9, false),
map(0x0D, MINECRAFT_1_15, false), map(0x0D, MINECRAFT_1_15, false),
map(0x0C, MINECRAFT_1_16, false)); map(0x0C, MINECRAFT_1_16, false),
map(0x0D, MINECRAFT_1_17, false));
clientbound.register(Chat.class, Chat::new, clientbound.register(Chat.class, Chat::new,
map(0x02, MINECRAFT_1_7_2, true), map(0x02, MINECRAFT_1_7_2, true),
map(0x0F, MINECRAFT_1_9, true), map(0x0F, MINECRAFT_1_9, true),
map(0x0E, MINECRAFT_1_13, true), map(0x0E, MINECRAFT_1_13, true),
map(0x0F, MINECRAFT_1_15, true), map(0x0F, MINECRAFT_1_15, true),
map(0x0E, MINECRAFT_1_16, true)); map(0x0E, MINECRAFT_1_16, true),
map(0x0F, MINECRAFT_1_17, true));
clientbound.register(TabCompleteResponse.class, TabCompleteResponse::new, clientbound.register(TabCompleteResponse.class, TabCompleteResponse::new,
map(0x3A, MINECRAFT_1_7_2, false), map(0x3A, MINECRAFT_1_7_2, false),
map(0x0E, MINECRAFT_1_9, false), map(0x0E, MINECRAFT_1_9, false),
map(0x10, MINECRAFT_1_13, false), map(0x10, MINECRAFT_1_13, false),
map(0x11, MINECRAFT_1_15, false), map(0x11, MINECRAFT_1_15, false),
map(0x10, MINECRAFT_1_16, false), map(0x10, MINECRAFT_1_16, false),
map(0x0F, MINECRAFT_1_16_2, false)); map(0x0F, MINECRAFT_1_16_2, false),
map(0x10, MINECRAFT_1_17, false));
clientbound.register(AvailableCommands.class, AvailableCommands::new, clientbound.register(AvailableCommands.class, AvailableCommands::new,
map(0x11, MINECRAFT_1_13, false), map(0x11, MINECRAFT_1_13, false),
map(0x12, MINECRAFT_1_15, false), map(0x12, MINECRAFT_1_15, false),
map(0x11, MINECRAFT_1_16, false), map(0x11, MINECRAFT_1_16, false),
map(0x10, MINECRAFT_1_16_2, false)); map(0x10, MINECRAFT_1_16_2, false),
map(0x11, MINECRAFT_1_17, false));
clientbound.register(PluginMessage.class, PluginMessage::new, clientbound.register(PluginMessage.class, PluginMessage::new,
map(0x3F, MINECRAFT_1_7_2, false), map(0x3F, MINECRAFT_1_7_2, false),
map(0x18, MINECRAFT_1_9, false), map(0x18, MINECRAFT_1_9, false),
@ -171,7 +176,8 @@ public enum StateRegistry {
map(0x18, MINECRAFT_1_14, false), map(0x18, MINECRAFT_1_14, false),
map(0x19, MINECRAFT_1_15, false), map(0x19, MINECRAFT_1_15, false),
map(0x18, MINECRAFT_1_16, false), map(0x18, MINECRAFT_1_16, false),
map(0x17, MINECRAFT_1_16_2, false)); map(0x17, MINECRAFT_1_16_2, false),
map(0x18, MINECRAFT_1_17, false));
clientbound.register(Disconnect.class, Disconnect::new, clientbound.register(Disconnect.class, Disconnect::new,
map(0x40, MINECRAFT_1_7_2, false), map(0x40, MINECRAFT_1_7_2, false),
map(0x1A, MINECRAFT_1_9, false), map(0x1A, MINECRAFT_1_9, false),
@ -179,7 +185,8 @@ public enum StateRegistry {
map(0x1A, MINECRAFT_1_14, false), map(0x1A, MINECRAFT_1_14, false),
map(0x1B, MINECRAFT_1_15, false), map(0x1B, MINECRAFT_1_15, false),
map(0x1A, MINECRAFT_1_16, false), map(0x1A, MINECRAFT_1_16, false),
map(0x19, MINECRAFT_1_16_2, false)); map(0x19, MINECRAFT_1_16_2, false),
map(0x1A, MINECRAFT_1_17, false));
clientbound.register(KeepAlive.class, KeepAlive::new, clientbound.register(KeepAlive.class, KeepAlive::new,
map(0x00, MINECRAFT_1_7_2, false), map(0x00, MINECRAFT_1_7_2, false),
map(0x1F, MINECRAFT_1_9, false), map(0x1F, MINECRAFT_1_9, false),
@ -187,7 +194,8 @@ public enum StateRegistry {
map(0x20, MINECRAFT_1_14, false), map(0x20, MINECRAFT_1_14, false),
map(0x21, MINECRAFT_1_15, false), map(0x21, MINECRAFT_1_15, false),
map(0x20, MINECRAFT_1_16, false), map(0x20, MINECRAFT_1_16, false),
map(0x1F, MINECRAFT_1_16_2, false)); map(0x1F, MINECRAFT_1_16_2, false),
map(0x20, MINECRAFT_1_17, false));
clientbound.register(JoinGame.class, JoinGame::new, clientbound.register(JoinGame.class, JoinGame::new,
map(0x01, MINECRAFT_1_7_2, false), map(0x01, MINECRAFT_1_7_2, false),
map(0x23, MINECRAFT_1_9, false), map(0x23, MINECRAFT_1_9, false),
@ -195,7 +203,8 @@ public enum StateRegistry {
map(0x25, MINECRAFT_1_14, false), map(0x25, MINECRAFT_1_14, false),
map(0x26, MINECRAFT_1_15, false), map(0x26, MINECRAFT_1_15, false),
map(0x25, MINECRAFT_1_16, false), map(0x25, MINECRAFT_1_16, false),
map(0x24, MINECRAFT_1_16_2, false)); map(0x24, MINECRAFT_1_16_2, false),
map(0x25, MINECRAFT_1_17, false));
clientbound.register(Respawn.class, Respawn::new, clientbound.register(Respawn.class, Respawn::new,
map(0x07, MINECRAFT_1_7_2, true), map(0x07, MINECRAFT_1_7_2, true),
map(0x33, MINECRAFT_1_9, true), map(0x33, MINECRAFT_1_9, true),
@ -205,7 +214,8 @@ public enum StateRegistry {
map(0x3A, MINECRAFT_1_14, true), map(0x3A, MINECRAFT_1_14, true),
map(0x3B, MINECRAFT_1_15, true), map(0x3B, MINECRAFT_1_15, true),
map(0x3A, MINECRAFT_1_16, true), map(0x3A, MINECRAFT_1_16, true),
map(0x39, MINECRAFT_1_16_2, true)); map(0x39, MINECRAFT_1_16_2, true),
map(0x3A, MINECRAFT_1_17, true));
clientbound.register(ResourcePackRequest.class, ResourcePackRequest::new, clientbound.register(ResourcePackRequest.class, ResourcePackRequest::new,
map(0x48, MINECRAFT_1_8, true), map(0x48, MINECRAFT_1_8, true),
map(0x32, MINECRAFT_1_9, true), map(0x32, MINECRAFT_1_9, true),
@ -215,7 +225,8 @@ public enum StateRegistry {
map(0x39, MINECRAFT_1_14, true), map(0x39, MINECRAFT_1_14, true),
map(0x3A, MINECRAFT_1_15, true), map(0x3A, MINECRAFT_1_15, true),
map(0x39, MINECRAFT_1_16, true), map(0x39, MINECRAFT_1_16, true),
map(0x38, MINECRAFT_1_16_2, true)); map(0x38, MINECRAFT_1_16_2, true),
map(0x39, MINECRAFT_1_17, true));
clientbound.register(HeaderAndFooter.class, HeaderAndFooter::new, clientbound.register(HeaderAndFooter.class, HeaderAndFooter::new,
map(0x47, MINECRAFT_1_8, true), map(0x47, MINECRAFT_1_8, true),
map(0x48, MINECRAFT_1_9, true), map(0x48, MINECRAFT_1_9, true),
@ -225,7 +236,8 @@ public enum StateRegistry {
map(0x4E, MINECRAFT_1_13, true), map(0x4E, MINECRAFT_1_13, true),
map(0x53, MINECRAFT_1_14, true), map(0x53, MINECRAFT_1_14, true),
map(0x54, MINECRAFT_1_15, true), map(0x54, MINECRAFT_1_15, true),
map(0x53, MINECRAFT_1_16, true)); map(0x53, MINECRAFT_1_16, true),
map(0x54, MINECRAFT_1_17, true));
clientbound.register(TitlePacket.class, TitlePacket::new, clientbound.register(TitlePacket.class, TitlePacket::new,
map(0x45, MINECRAFT_1_8, true), map(0x45, MINECRAFT_1_8, true),
map(0x45, MINECRAFT_1_9, true), map(0x45, MINECRAFT_1_9, true),
@ -234,7 +246,8 @@ public enum StateRegistry {
map(0x4B, MINECRAFT_1_13, true), map(0x4B, MINECRAFT_1_13, true),
map(0x4F, MINECRAFT_1_14, true), map(0x4F, MINECRAFT_1_14, true),
map(0x50, MINECRAFT_1_15, true), map(0x50, MINECRAFT_1_15, true),
map(0x4F, MINECRAFT_1_16, true)); map(0x4F, MINECRAFT_1_16, true),
map(0x50, MINECRAFT_1_17, true));
clientbound.register(PlayerListItem.class, PlayerListItem::new, clientbound.register(PlayerListItem.class, PlayerListItem::new,
map(0x38, MINECRAFT_1_7_2, false), map(0x38, MINECRAFT_1_7_2, false),
map(0x2D, MINECRAFT_1_9, false), map(0x2D, MINECRAFT_1_9, false),
@ -243,7 +256,8 @@ public enum StateRegistry {
map(0x33, MINECRAFT_1_14, false), map(0x33, MINECRAFT_1_14, false),
map(0x34, MINECRAFT_1_15, false), map(0x34, MINECRAFT_1_15, false),
map(0x33, MINECRAFT_1_16, false), map(0x33, MINECRAFT_1_16, false),
map(0x32, MINECRAFT_1_16_2, false)); map(0x32, MINECRAFT_1_16_2, false),
map(0x33, MINECRAFT_1_17, false));
} }
}, },
LOGIN { LOGIN {