mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-05 23:36:12 +00:00
Auto stash before revert of "Cleanup"
This commit is contained in:
@@ -380,12 +380,13 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
* @return a new Cuboid outset by the given direction and amount
|
||||
*/
|
||||
public Cuboid outset(CuboidDirection dir, int amount) {
|
||||
return switch (dir) {
|
||||
Cuboid c = switch (dir) {
|
||||
case Horizontal -> expand(CuboidDirection.North, amount).expand(CuboidDirection.South, amount).expand(CuboidDirection.East, amount).expand(CuboidDirection.West, amount);
|
||||
case Vertical -> expand(CuboidDirection.Down, amount).expand(CuboidDirection.Up, amount);
|
||||
case Both -> outset(CuboidDirection.Horizontal, amount).outset(CuboidDirection.Vertical, amount);
|
||||
default -> throw new IllegalArgumentException("invalid direction " + dir);
|
||||
};
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,7 +68,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
||||
data = new NibbleArray(CAPACITY, i);
|
||||
}
|
||||
|
||||
private void expand() {
|
||||
private final void expand() {
|
||||
if (bpb < 8) {
|
||||
changeBitsPerBlock(bpb + 1);
|
||||
} else {
|
||||
@@ -90,7 +90,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
||||
changeBitsPerBlock(targetBits);
|
||||
}
|
||||
|
||||
private void changeBitsPerBlock(int bits) {
|
||||
private final void changeBitsPerBlock(int bits) {
|
||||
bpb = bits;
|
||||
data = new NibbleArray(bpb, CAPACITY, data);
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
||||
return palette.get(data.get(getCoordinateIndex(x, y, z)));
|
||||
}
|
||||
|
||||
private int getPaletteId(T d) {
|
||||
private final int getPaletteId(T d) {
|
||||
int index = palette.indexOf(d);
|
||||
|
||||
if (index == -1) {
|
||||
@@ -118,7 +118,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
||||
return index + Byte.MIN_VALUE;
|
||||
}
|
||||
|
||||
private int getCoordinateIndex(int x, int y, int z) {
|
||||
private final int getCoordinateIndex(int x, int y, int z) {
|
||||
return y << 8 | z << 4 | x;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user