Add minY & height dimension NBT

This commit is contained in:
TheMode 2021-05-31 19:11:24 +02:00
parent 6858690cc1
commit 8820123f15

View File

@ -49,6 +49,8 @@ public class DimensionType {
private final boolean bedSafe;
private final String effects;
private final boolean piglinSafe;
private final int minY;
private final int height;
private final int logicalHeight;
private final int coordinateScale;
private final NamespaceID infiniburn;
@ -56,7 +58,7 @@ public class DimensionType {
DimensionType(NamespaceID name, boolean natural, float ambientLight, boolean ceilingEnabled,
boolean skylightEnabled, @Nullable Long fixedTime, boolean raidCapable,
boolean respawnAnchorSafe, boolean ultrawarm, boolean bedSafe, String effects, boolean piglinSafe,
int logicalHeight, int coordinateScale, NamespaceID infiniburn) {
int minY, int height, int logicalHeight, int coordinateScale, NamespaceID infiniburn) {
this.name = name;
this.natural = natural;
this.ambientLight = ambientLight;
@ -69,6 +71,8 @@ public class DimensionType {
this.bedSafe = bedSafe;
this.effects = effects;
this.piglinSafe = piglinSafe;
this.minY = minY;
this.height = height;
this.logicalHeight = logicalHeight;
this.coordinateScale = coordinateScale;
this.infiniburn = infiniburn;
@ -124,6 +128,8 @@ public class DimensionType {
.setByte("bed_works", (byte) (bedSafe ? 0x01 : 0x00))
.setString("effects", effects)
.setByte("piglin_safe", (byte) (piglinSafe ? 0x01 : 0x00))
.setInt("min_y", minY)
.setInt("height", height)
.setInt("logical_height", logicalHeight)
.setInt("coordinate_scale", coordinateScale)
.setString("name", name.toString());
@ -234,7 +240,9 @@ public class DimensionType {
private boolean bedSafe = true;
private String effects = "minecraft:overworld";
private boolean piglinSafe = false;
private int minY = 0;
private int logicalHeight = 256;
private int height = 256;
private int coordinateScale = 1;
private NamespaceID infiniburn = NamespaceID.from("minecraft:infiniburn_overworld");
@ -301,6 +309,16 @@ public class DimensionType {
return this;
}
public DimensionType.DimensionTypeBuilder minY(int minY) {
this.minY = minY;
return this;
}
public DimensionType.DimensionTypeBuilder height(int height) {
this.height = height;
return this;
}
public DimensionType.DimensionTypeBuilder logicalHeight(int logicalHeight) {
this.logicalHeight = logicalHeight;
return this;
@ -319,7 +337,7 @@ public class DimensionType {
public DimensionType build() {
return new DimensionType(name, natural, ambientLight, ceilingEnabled, skylightEnabled,
fixedTime, raidCapable, respawnAnchorSafe, ultrawarm, bedSafe, effects,
piglinSafe, logicalHeight, coordinateScale, infiniburn);
piglinSafe, minY, height, logicalHeight, coordinateScale, infiniburn);
}
}
}