13
0
geforkt von Mirrors/Velocity

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