mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Matter inject
This commit is contained in:
parent
acf4fa106f
commit
ef22a58631
@ -23,6 +23,7 @@ import com.volmit.iris.engine.object.IrisPosition;
|
|||||||
import com.volmit.iris.util.collection.KSet;
|
import com.volmit.iris.util.collection.KSet;
|
||||||
import com.volmit.iris.util.data.B;
|
import com.volmit.iris.util.data.B;
|
||||||
import com.volmit.iris.util.data.Varint;
|
import com.volmit.iris.util.data.Varint;
|
||||||
|
import com.volmit.iris.util.decree.annotations.Param;
|
||||||
import com.volmit.iris.util.hunk.Hunk;
|
import com.volmit.iris.util.hunk.Hunk;
|
||||||
import com.volmit.iris.util.math.BlockPosition;
|
import com.volmit.iris.util.math.BlockPosition;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -88,6 +89,13 @@ public interface Matter {
|
|||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default Matter copy()
|
||||||
|
{
|
||||||
|
Matter m = new IrisMatter(getWidth(), getHeight(), getDepth());
|
||||||
|
getSliceMap().forEach((k,v) -> m.slice(k).forceInject(v));
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
static Matter read(InputStream in) throws IOException, ClassNotFoundException {
|
static Matter read(InputStream in) throws IOException, ClassNotFoundException {
|
||||||
return read(in, (b) -> new IrisMatter(b.getX(), b.getY(), b.getZ()));
|
return read(in, (b) -> new IrisMatter(b.getX(), b.getY(), b.getZ()));
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,16 @@ public interface MatterSlice<T> extends Hunk<T> {
|
|||||||
updateSync(filter::update);
|
updateSync(filter::update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default void inject(MatterSlice<T> slice)
|
||||||
|
{
|
||||||
|
iterateSync(slice::set);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void forceInject(MatterSlice<?> slice)
|
||||||
|
{
|
||||||
|
inject((MatterSlice<T>) slice);
|
||||||
|
}
|
||||||
|
|
||||||
void writeNode(T b, DataOutputStream dos) throws IOException;
|
void writeNode(T b, DataOutputStream dos) throws IOException;
|
||||||
|
|
||||||
T readNode(DataInputStream din) throws IOException;
|
T readNode(DataInputStream din) throws IOException;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user