Dumb stuff

This commit is contained in:
cyberpwn
2022-04-17 04:11:50 -04:00
parent e9eeb8335d
commit 60a7f4bc35
8 changed files with 195 additions and 3 deletions

View File

@@ -18,6 +18,7 @@
package com.volmit.iris.util.hunk;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.object.IrisPosition;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.function.Consumer2;
@@ -1254,6 +1255,12 @@ public interface Hunk<T> {
* the value
*/
default void set(int x, int y, int z, T t) {
if(!contains(x, y, z))
{
Iris.warn("OUT OF BOUNDS " + x + " " + y + " "+ z + " in bounds " + getWidth() + " " + getHeight() + " " + getDepth() );
return;
}
setRaw(x, y, z, t);
}
@@ -1561,4 +1568,9 @@ public interface Hunk<T> {
default boolean contains(int x, int y, int z) {
return x < getWidth() && x >= 0 && y < getHeight() && y >= 0 && z < getDepth() && z >= 0;
}
default int volume()
{
return getWidth() * getDepth() * getHeight();
}
}