3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-05 15:34:27 -04:00
Ursprung db83ade45e
Commit 32e90a1969
2 geänderte Dateien mit 17 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -37,7 +37,7 @@ public enum ProtocolVersion {
MINECRAFT_1_15_2(578, "1.15.2"),
MINECRAFT_1_16(735, "1.16"),
MINECRAFT_1_16_1(736, "1.16.1"),
MINECRAFT_1_16_2(744, "1.16.2");
MINECRAFT_1_16_2(746, "1.16.2");
private final int protocol;
private final String name;

Datei anzeigen

@ -22,6 +22,7 @@ public final class DimensionData {
private final String burningBehaviourIdentifier;
private final @Nullable Long fixedTime;
private final @Nullable Boolean createDragonFight;
private final @Nullable Double coordinateScale;
/**
* Initializes a new {@link DimensionData} instance.
@ -41,6 +42,7 @@ public final class DimensionData {
* @param burningBehaviourIdentifier the identifier for how burning blocks work in the dimension
* @param fixedTime optional. If set to any game daytime value will deactivate time cycle
* @param createDragonFight optional. Internal flag used in the end dimension
* @param coordinateScale optional, unknown purpose
*/
public DimensionData(String registryIdentifier,
@Nullable Integer dimensionId,
@ -50,7 +52,8 @@ public final class DimensionData {
boolean isPiglinSafe, boolean doBedsWork,
boolean doRespawnAnchorsWork, boolean hasRaids,
int logicalHeight, String burningBehaviourIdentifier,
@Nullable Long fixedTime, @Nullable Boolean createDragonFight) {
@Nullable Long fixedTime, @Nullable Boolean createDragonFight,
@Nullable Double coordinateScale) {
Preconditions.checkNotNull(
registryIdentifier, "registryIdentifier cannot be null");
Preconditions.checkArgument(registryIdentifier.length() > 0,
@ -76,6 +79,7 @@ public final class DimensionData {
this.burningBehaviourIdentifier = burningBehaviourIdentifier;
this.fixedTime = fixedTime;
this.createDragonFight = createDragonFight;
this.coordinateScale = coordinateScale;
}
public String getRegistryIdentifier() {
@ -142,6 +146,10 @@ public final class DimensionData {
return createDragonFight;
}
public @Nullable Double getCoordinateScale() {
return coordinateScale;
}
/**
* Parses a given CompoundTag to a DimensionData instance.
* @param dimTag the compound from the registry to read
@ -175,10 +183,13 @@ public final class DimensionData {
? details.getLong("fixed_time") : null;
Boolean hasEnderdragonFight = details.contains("has_enderdragon_fight")
? details.getBoolean("has_enderdragon_fight") : null;
Double coordinateScale = details.contains("coordinate_scale")
? details.getDouble("coordinate_scale") : null;
return new DimensionData(
registryIdentifier, dimensionId, isNatural, ambientLight, isShrunk,
isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork,
hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, hasEnderdragonFight);
hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, hasEnderdragonFight,
coordinateScale);
}
/**
@ -224,6 +235,9 @@ public final class DimensionData {
if (createDragonFight != null) {
ret.putBoolean("has_enderdragon_fight", createDragonFight);
}
if (coordinateScale != null) {
ret.putDouble("coordinate_scale", coordinateScale);
}
return ret;
}
}