3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Add missing DimensionData field

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-07 14:30:33 -04:00
Ursprung ba66d15b1d
Commit 24ca6156ac

Datei anzeigen

@ -25,6 +25,7 @@ public final class DimensionData {
private final @Nullable Long fixedTime;
private final @Nullable Boolean createDragonFight;
private final @Nullable Double coordinateScale;
private final @Nullable String effects;
/**
* Initializes a new {@link DimensionData} instance.
@ -45,6 +46,7 @@ public final class DimensionData {
* @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
* @param effects optional, unknown purpose
*/
public DimensionData(String registryIdentifier,
@Nullable Integer dimensionId,
@ -55,7 +57,8 @@ public final class DimensionData {
boolean doRespawnAnchorsWork, boolean hasRaids,
int logicalHeight, String burningBehaviourIdentifier,
@Nullable Long fixedTime, @Nullable Boolean createDragonFight,
@Nullable Double coordinateScale) {
@Nullable Double coordinateScale,
@Nullable String effects) {
Preconditions.checkNotNull(
registryIdentifier, "registryIdentifier cannot be null");
Preconditions.checkArgument(registryIdentifier.length() > 0,
@ -82,6 +85,7 @@ public final class DimensionData {
this.fixedTime = fixedTime;
this.createDragonFight = createDragonFight;
this.coordinateScale = coordinateScale;
this.effects = effects;
}
public String getRegistryIdentifier() {
@ -165,7 +169,7 @@ public final class DimensionData {
return new DimensionData(registryIdentifier, dimensionId, isNatural, ambientLight, isShrunk,
isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork,
hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, createDragonFight,
coordinateScale);
coordinateScale, effects);
}
public boolean isUnannotated() {
@ -200,11 +204,13 @@ public final class DimensionData {
? details.getByte("has_enderdragon_fight") >= 1 : null;
Double coordinateScale = details.keySet().contains("coordinate_scale")
? details.getDouble("coordinate_scale") : null;
String effects = details.keySet().contains("effects") ? details.getString("effects")
: null;
return new DimensionData(
UNKNOWN_DIMENSION_ID, null, isNatural, ambientLight, isShrunk,
isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork,
hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, hasEnderdragonFight,
coordinateScale);
coordinateScale, effects);
}
/**
@ -280,6 +286,9 @@ public final class DimensionData {
if (coordinateScale != null) {
ret.putDouble("coordinate_scale", coordinateScale);
}
if (effects != null) {
ret.putString("effects", effects);
}
return ret.build();
}
}