mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-28 11:39:07 +00:00
Beautify updates keys
This commit is contained in:
@@ -1401,4 +1401,9 @@ public interface Hunk<T> {
|
||||
c[0] = x;
|
||||
c[1] = y;
|
||||
}
|
||||
|
||||
default boolean isEmpty()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,11 @@ public class MappedHunk<T> extends StorageHunk<T> implements Hunk<T> {
|
||||
return data.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return data.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRaw(int x, int y, int z, T t) {
|
||||
if (t == null) {
|
||||
|
||||
@@ -332,4 +332,16 @@ public interface Matter {
|
||||
|
||||
return matter;
|
||||
}
|
||||
|
||||
default int getTotalCount()
|
||||
{
|
||||
int m = 0;
|
||||
|
||||
for(MatterSlice<?> i : getSliceMap().values())
|
||||
{
|
||||
m+= i.getCount();
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.util.BlockVector;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@@ -145,4 +146,19 @@ public interface MatterSlice<T> extends Hunk<T> {
|
||||
default void rotateSliceInto(Matter n, double x, double y, double z) {
|
||||
rotate(x, y, z, (_x, _y, _z) -> n.slice(getType()));
|
||||
}
|
||||
|
||||
default boolean containsKey(BlockVector v)
|
||||
{
|
||||
return get(v.getBlockX(), v.getBlockY(), v.getBlockZ()) != null;
|
||||
}
|
||||
|
||||
default void put(BlockVector v, T d)
|
||||
{
|
||||
set(v.getBlockX(), v.getBlockY(), v.getBlockZ(), d);
|
||||
}
|
||||
|
||||
default T get(BlockVector v)
|
||||
{
|
||||
return get(v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user