3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +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_15_2(578, "1.15.2"),
MINECRAFT_1_16(735, "1.16"), MINECRAFT_1_16(735, "1.16"),
MINECRAFT_1_16_1(736, "1.16.1"), 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 int protocol;
private final String name; private final String name;

Datei anzeigen

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