mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Use a synced list
This commit is contained in:
parent
302f54971d
commit
cc95042a94
@ -22,6 +22,7 @@ import com.google.gson.Gson;
|
||||
import com.volmit.iris.engine.hunk.io.HunkIOAdapter;
|
||||
import com.volmit.iris.engine.hunk.io.PaletteHunkIOAdapter;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.oldnbt.CompoundTag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -29,6 +30,8 @@ import lombok.Data;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.function.Function;
|
||||
|
||||
@ -67,7 +70,7 @@ public class ParallaxChunkMeta {
|
||||
pcm.setMaxObject(din.readInt());
|
||||
pcm.setMinObject(din.readInt());
|
||||
pcm.setCount(din.readInt());
|
||||
pcm.setFeatures(new CopyOnWriteArrayList<>());
|
||||
pcm.setFeatures(newList());
|
||||
int c = din.readInt();
|
||||
|
||||
for (int i = 0; i < c; i++) {
|
||||
@ -87,9 +90,14 @@ public class ParallaxChunkMeta {
|
||||
private int maxObject = -1;
|
||||
private int minObject = -1;
|
||||
private int count;
|
||||
private CopyOnWriteArrayList<IrisFeaturePositional> features;
|
||||
private List<IrisFeaturePositional> features;
|
||||
|
||||
private static List<IrisFeaturePositional> newList()
|
||||
{
|
||||
return Collections.synchronizedList(new KList<>());
|
||||
}
|
||||
|
||||
public ParallaxChunkMeta() {
|
||||
this(false, false, false, false, false, false, -1, -1, 0, new CopyOnWriteArrayList<>());
|
||||
this(false, false, false, false, false, false, -1, -1, 0, newList());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user