mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Drop 255 hardcode checks
This commit is contained in:
parent
7f5b0559aa
commit
30ae065cb4
@ -148,7 +148,7 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
|
|||||||
int buf = v.get(0) - 1;
|
int buf = v.get(0) - 1;
|
||||||
|
|
||||||
for(Integer i : v) {
|
for(Integer i : v) {
|
||||||
if(i < 0 || i > 255) {
|
if(i < 0 || i > getEngine().getHeight()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return floor < ceiling && ceiling - floor >= 1 && floor >= 0 && ceiling <= 255 && airThickness() > 0;
|
return floor < ceiling && ceiling - floor >= 1 && floor >= 0 && ceiling <= engine.getHeight() && airThickness() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -118,7 +118,7 @@ public class IrisDepositModifier extends EngineAssignedModifier<BlockData> {
|
|||||||
int ny = j.getBlockY() + h;
|
int ny = j.getBlockY() + h;
|
||||||
int nz = j.getBlockZ() + z;
|
int nz = j.getBlockZ() + z;
|
||||||
|
|
||||||
if(ny > height || nx > 15 || nx < 0 || ny > 255 || ny < 0 || nz < 0 || nz > 15) {
|
if(ny > height || nx > 15 || nx < 0 || ny > engine.getHeight() || ny < 0 || nz < 0 || nz > 15) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
height += i.getHeight(xg, x, z, seed);
|
height += i.getHeight(xg, x, z, seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Math.max(0, Math.min(height, 255));
|
return Math.max(0, Math.min(height, xg.getHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public CNG getBiomeGenerator(RNG random) {
|
public CNG getBiomeGenerator(RNG random) {
|
||||||
@ -448,7 +448,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < maxDepth; i++) {
|
for(int i = 0; i < maxDepth; i++) {
|
||||||
int offset = (255 - height) - i;
|
int offset = (512 - height) - i;
|
||||||
int index = offset % data.size();
|
int index = offset % data.size();
|
||||||
real.add(data.get(Math.max(index, 0)));
|
real.add(data.get(Math.max(index, 0)));
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ public class IrisDimension extends IrisRegistrant {
|
|||||||
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
|
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
|
||||||
@Required
|
@Required
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(255)
|
@MaxNumber(1024)
|
||||||
@Desc("The fluid height for this dimension")
|
@Desc("The fluid height for this dimension")
|
||||||
private int fluidHeight = 63;
|
private int fluidHeight = 63;
|
||||||
@Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.")
|
@Desc("Define the min and max Y bounds of this dimension. Please keep in mind that Iris internally generates from 0 to (max - min). \n\nFor example at -64 to 320, Iris is internally generating to 0 to 384, then on outputting chunks, it shifts it down by the min height (64 blocks). The default is -64 to 320. \n\nThe fluid height is placed at (fluid height + min height). So a fluid height of 63 would actually show up in the world at 1.")
|
||||||
|
@ -35,14 +35,14 @@ import lombok.experimental.Accessors;
|
|||||||
@Data
|
@Data
|
||||||
public class IrisObjectLimit {
|
public class IrisObjectLimit {
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(255)
|
@MaxNumber(1024)
|
||||||
@Desc("The minimum height for placement (bottom of object)")
|
@Desc("The minimum height for placement (bottom of object)")
|
||||||
private int minimumHeight = 0;
|
private int minimumHeight = 0;
|
||||||
|
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(255)
|
@MaxNumber(1024)
|
||||||
@Desc("The maximum height for placement (top of object)")
|
@Desc("The maximum height for placement (top of object)")
|
||||||
private int maximumHeight = 255;
|
private int maximumHeight = 512;
|
||||||
|
|
||||||
public boolean canPlace(int h, int l) {
|
public boolean canPlace(int h, int l) {
|
||||||
return h <= maximumHeight && l >= minimumHeight;
|
return h <= maximumHeight && l >= minimumHeight;
|
||||||
|
@ -35,12 +35,12 @@ import lombok.experimental.Accessors;
|
|||||||
@Data
|
@Data
|
||||||
public class IrisSlopeClip {
|
public class IrisSlopeClip {
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(255)
|
@MaxNumber(1024)
|
||||||
@Desc("The minimum slope for placement")
|
@Desc("The minimum slope for placement")
|
||||||
private double minimumSlope = 0;
|
private double minimumSlope = 0;
|
||||||
|
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(255)
|
@MaxNumber(1024)
|
||||||
@Desc("The maximum slope for placement")
|
@Desc("The maximum slope for placement")
|
||||||
private double maximumSlope = 10;
|
private double maximumSlope = 10;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user