mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Parallax storage
This commit is contained in:
parent
d29b4e486d
commit
e92fa789e9
@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import org.bouncycastle.util.Arrays;
|
||||
|
||||
import lombok.Data;
|
||||
@ -12,7 +13,7 @@ public class ArrayHunk<T> extends StorageHunk<T> implements Hunk<T>
|
||||
private final T[] data;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected ArrayHunk(int w, int h, int d)
|
||||
public ArrayHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = (T[]) new Object[w * h * d];
|
@ -1,7 +1,8 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDoubleArray;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -11,7 +12,7 @@ public class AtomicDoubleHunk extends StorageHunk<Double> implements Hunk<Double
|
||||
{
|
||||
private final AtomicDoubleArray data;
|
||||
|
||||
protected AtomicDoubleHunk(int w, int h, int d)
|
||||
public AtomicDoubleHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = new AtomicDoubleArray(w * h * d);
|
@ -1,7 +1,8 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceArray;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -11,7 +12,7 @@ public class AtomicHunk<T> extends StorageHunk<T> implements Hunk<T>
|
||||
{
|
||||
private final AtomicReferenceArray<T> data;
|
||||
|
||||
protected AtomicHunk(int w, int h, int d)
|
||||
public AtomicHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = new AtomicReferenceArray<T>(w * h * d);
|
@ -1,7 +1,8 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicIntegerArray;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -11,7 +12,7 @@ public class AtomicIntegerHunk extends StorageHunk<Integer> implements Hunk<Inte
|
||||
{
|
||||
private final AtomicIntegerArray data;
|
||||
|
||||
protected AtomicIntegerHunk(int w, int h, int d)
|
||||
public AtomicIntegerHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = new AtomicIntegerArray(w * h * d);
|
@ -1,7 +1,8 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicLongArray;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -11,7 +12,7 @@ public class AtomicLongHunk extends StorageHunk<Long> implements Hunk<Long>
|
||||
{
|
||||
private final AtomicLongArray data;
|
||||
|
||||
protected AtomicLongHunk(int w, int h, int d)
|
||||
public AtomicLongHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = new AtomicLongArray(w * h * d);
|
@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.util.BlockPosition;
|
||||
import com.volmit.iris.util.KMap;
|
||||
|
||||
@ -12,7 +13,7 @@ public class MappedHunk<T> extends StorageHunk<T> implements Hunk<T>
|
||||
{
|
||||
private final KMap<BlockPosition, T> data;
|
||||
|
||||
protected MappedHunk(int w, int h, int d)
|
||||
public MappedHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = new KMap<>();
|
@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ -9,7 +10,7 @@ public abstract class StorageHunk<T> implements Hunk<T>
|
||||
private final int height;
|
||||
private final int depth;
|
||||
|
||||
protected StorageHunk(int width, int height, int depth)
|
||||
public StorageHunk(int width, int height, int depth)
|
||||
{
|
||||
if(width <= 0 || height <= 0 || depth <= 0)
|
||||
{
|
@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk;
|
||||
package com.volmit.iris.gen.v2.scaffold.hunk.storage;
|
||||
|
||||
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||
import org.bouncycastle.util.Arrays;
|
||||
|
||||
import lombok.Data;
|
||||
@ -12,7 +13,7 @@ public class SynchronizedArrayHunk<T> extends StorageHunk<T> implements Hunk<T>
|
||||
private final T[] data;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected SynchronizedArrayHunk(int w, int h, int d)
|
||||
public SynchronizedArrayHunk(int w, int h, int d)
|
||||
{
|
||||
super(w, h, d);
|
||||
data = (T[]) new Object[w * h * d];
|
Loading…
x
Reference in New Issue
Block a user