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