This commit is contained in:
Daniel Mills
2020-01-23 08:20:45 -05:00
parent ea71474b62
commit 64674026a6
38 changed files with 291 additions and 291 deletions

View File

@@ -33,7 +33,7 @@ import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SChunkVector;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.CNG;
import ninja.bytecode.shuriken.math.M;
@@ -42,7 +42,7 @@ import ninja.bytecode.shuriken.math.RNG;
public class IrisGenerator extends ParallaxWorldGenerator
{
//@builder
public static final GList<MB> ROCK = new GList<MB>().add(new MB[] {
public static final KList<MB> ROCK = new KList<MB>().add(new MB[] {
MB.of(Material.STONE),
MB.of(Material.STONE),
MB.of(Material.STONE),
@@ -246,7 +246,7 @@ public class IrisGenerator extends ParallaxWorldGenerator
@Override
public List<BlockPopulator> getDefaultPopulators(World world)
{
GList<BlockPopulator> p = new GList<>();
KList<BlockPopulator> p = new KList<>();
if(Iris.settings.performance.objectMode.equals(ObjectMode.QUICK_N_DIRTY) || Iris.settings.performance.objectMode.equals(ObjectMode.LIGHTING))
{

View File

@@ -15,12 +15,12 @@ import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.util.ChronoQueue;
import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.KMap;
public class WorldReactor
{
private static GList<ChronoQueue> q = new GList<>();
private static KList<ChronoQueue> q = new KList<>();
private final World world;
public WorldReactor(World world)
@@ -41,7 +41,7 @@ public class WorldReactor
WorldReactor.q.add(q);
FinalDouble of = new FinalDouble(0D);
FinalDouble max = new FinalDouble(0D);
GMap<SMCAVector, Double> d = new GMap<>();
KMap<SMCAVector, Double> d = new KMap<>();
int mx = p.getLocation().getChunk().getX();
int mz = p.getLocation().getChunk().getZ();
for(int xx = p.getLocation().getChunk().getX() - 32; xx < p.getLocation().getChunk().getX() + 32; xx++)
@@ -59,7 +59,7 @@ public class WorldReactor
}
}
GList<SMCAVector> v = d.k();
KList<SMCAVector> v = d.k();
Collections.sort(v, (a, b) -> (int) (10000 * (d.get(a) - d.get(b))));
for(SMCAVector i : v)

View File

@@ -13,23 +13,23 @@ import org.jnbt.NBTInputStream;
import org.jnbt.NBTOutputStream;
import org.jnbt.Tag;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.KMap;
public class AtomicRegionData
{
private final World world;
private GMap<String, Tag> tag;
private KMap<String, Tag> tag;
public AtomicRegionData(World world)
{
this.world = world;
tag = new GMap<>();
tag = new KMap<>();
}
public void read(InputStream in) throws IOException
{
NBTInputStream nin = new NBTInputStream(in);
tag = new GMap<>();
tag = new KMap<>();
tag.putAll(((CompoundTag) nin.readTag()).getValue());
nin.close();
}

View File

@@ -8,22 +8,22 @@ import java.io.IOException;
import org.bukkit.World;
import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.KMap;
public class AtomicWorldData
{
private World world;
private GMap<SMCAVector, AtomicRegionData> loadedSections;
private KMap<SMCAVector, AtomicRegionData> loadedSections;
public AtomicWorldData(World world)
{
this.world = world;
loadedSections = new GMap<>();
loadedSections = new KMap<>();
getSubregionFolder().mkdirs();
}
public GList<SMCAVector> getLoadedRegions()
public KList<SMCAVector> getLoadedRegions()
{
return loadedSections.k();
}

View File

@@ -32,8 +32,8 @@ import ninja.bytecode.iris.util.IPlacer;
import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.SBlockVector;
import ninja.bytecode.iris.util.VectorMath;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.io.CustomOutputStream;
import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.RNG;
@@ -47,7 +47,7 @@ public class GenObject
private int failures;
private int successes;
private String name = "?";
private GMap<SBlockVector, MB> s;
private KMap<SBlockVector, MB> s;
private BlockVector mount;
private int mountHeight;
private BlockVector shift;
@@ -58,7 +58,7 @@ public class GenObject
this.h = h;
this.d = d;
shift = new BlockVector();
s = new GMap<>();
s = new KMap<>();
centeredHeight = false;
}
@@ -74,7 +74,7 @@ public class GenObject
}
}
GList<SBlockVector> fmount = new GList<>();
KList<SBlockVector> fmount = new KList<>();
for(SBlockVector i : s.keySet())
{
@@ -133,7 +133,7 @@ public class GenObject
return d;
}
public GMap<SBlockVector, MB> getSchematic()
public KMap<SBlockVector, MB> getSchematic()
{
return s;
}
@@ -227,7 +227,7 @@ public class GenObject
s.clear();
}
public void fill(GMap<SBlockVector, MB> b)
public void fill(KMap<SBlockVector, MB> b)
{
clear();
s.putAll(b);
@@ -272,7 +272,7 @@ public class GenObject
}
start.add(shift);
GMap<Location, MB> undo = new GMap<>();
KMap<Location, MB> undo = new KMap<>();
for(SBlockVector i : s.keySet())
{
@@ -349,7 +349,7 @@ public class GenObject
public void rotate(Direction from, Direction to)
{
GMap<SBlockVector, MB> g = new GMap<>();
KMap<SBlockVector, MB> g = new KMap<>();
g.putAll(s);
s.clear();

View File

@@ -24,9 +24,9 @@ import ninja.bytecode.iris.util.IPlacer;
import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.GSet;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.collections.KSet;
import ninja.bytecode.shuriken.execution.ChronoLatch;
import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.logging.L;
@@ -35,9 +35,9 @@ import ninja.bytecode.shuriken.math.RNG;
public class GenObjectDecorator extends BlockPopulator
{
private GList<PlacedObject> placeHistory;
private GMap<IrisBiome, GList<GenObjectGroup>> orderCache;
private GMap<IrisBiome, GMap<GenObjectGroup, Double>> populationCache;
private KList<PlacedObject> placeHistory;
private KMap<IrisBiome, KList<GenObjectGroup>> orderCache;
private KMap<IrisBiome, KMap<GenObjectGroup, Double>> populationCache;
private IPlacer placer;
private IrisGenerator g;
private ChronoLatch cl = new ChronoLatch(250);
@@ -45,14 +45,14 @@ public class GenObjectDecorator extends BlockPopulator
public GenObjectDecorator(IrisGenerator generator)
{
this.g = generator;
placeHistory = new GList<>();
populationCache = new GMap<>();
orderCache = new GMap<>();
placeHistory = new KList<>();
populationCache = new KMap<>();
orderCache = new KMap<>();
for(IrisBiome i : generator.getDimension().getBiomes())
{
GMap<GenObjectGroup, Double> gc = new GMap<>();
GMap<Integer, GList<GenObjectGroup>> or = new GMap<>();
KMap<GenObjectGroup, Double> gc = new KMap<>();
KMap<Integer, KList<GenObjectGroup>> or = new KMap<>();
int ff = 0;
for(String j : i.getSchematicGroups().k())
{
@@ -66,7 +66,7 @@ public class GenObjectDecorator extends BlockPopulator
if(!or.containsKey(g.getPiority()))
{
or.put(g.getPiority(), new GList<>());
or.put(g.getPiority(), new KList<>());
}
or.get(g.getPiority()).add(g);
@@ -81,8 +81,8 @@ public class GenObjectDecorator extends BlockPopulator
if(!gc.isEmpty())
{
GList<GenObjectGroup> g = new GList<>();
for(GList<GenObjectGroup> j : or.v())
KList<GenObjectGroup> g = new KList<>();
for(KList<GenObjectGroup> j : or.v())
{
g.addAll(j);
}
@@ -114,7 +114,7 @@ public class GenObjectDecorator extends BlockPopulator
return;
}
GSet<IrisBiome> hits = new GSet<>();
KSet<IrisBiome> hits = new KSet<>();
int cx = source.getX();
int cz = source.getZ();
@@ -129,7 +129,7 @@ public class GenObjectDecorator extends BlockPopulator
continue;
}
GMap<GenObjectGroup, Double> objects = populationCache.get(biome);
KMap<GenObjectGroup, Double> objects = populationCache.get(biome);
if(objects == null)
{
@@ -289,7 +289,7 @@ public class GenObjectDecorator extends BlockPopulator
}
ParallaxCache cache = new ParallaxCache(g);
GSet<IrisBiome> hits = new GSet<>();
KSet<IrisBiome> hits = new KSet<>();
for(int i = 0; i < Iris.settings.performance.decorationAccuracy; i++)
{
@@ -302,7 +302,7 @@ public class GenObjectDecorator extends BlockPopulator
continue;
}
GMap<GenObjectGroup, Double> objects = populationCache.get(biome);
KMap<GenObjectGroup, Double> objects = populationCache.get(biome);
if(objects == null)
{
@@ -426,7 +426,7 @@ public class GenObjectDecorator extends BlockPopulator
return floor;
}
public GList<PlacedObject> getHistory()
public KList<PlacedObject> getHistory()
{
return placeHistory;
}
@@ -438,7 +438,7 @@ public class GenObjectDecorator extends BlockPopulator
public PlacedObject randomObject(String string)
{
GList<PlacedObject> v = new GList<>();
KList<PlacedObject> v = new KList<>();
for(PlacedObject i : placeHistory)
{

View File

@@ -10,15 +10,15 @@ import net.md_5.bungee.api.ChatColor;
import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.controller.PackController;
import ninja.bytecode.iris.util.Direction;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.format.F;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.format.Form;
import ninja.bytecode.shuriken.io.IO;
import ninja.bytecode.shuriken.logging.L;
public class GenObjectGroup
{
private GList<GenObject> schematics;
private GList<String> flags;
private KList<GenObject> schematics;
private KList<String> flags;
private String name;
private int priority;
private double worldChance;
@@ -26,8 +26,8 @@ public class GenObjectGroup
public GenObjectGroup(String name)
{
this.schematics = new GList<>();
this.flags = new GList<>();
this.schematics = new KList<>();
this.flags = new KList<>();
this.name = name;
priority = Integer.MIN_VALUE;
worldChance = Integer.MIN_VALUE;
@@ -104,7 +104,7 @@ public class GenObjectGroup
public GenObjectGroup copy(String suffix)
{
GenObjectGroup gog = new GenObjectGroup(name + suffix);
gog.schematics = new GList<>();
gog.schematics = new KList<>();
gog.flags = flags.copy();
for(GenObject i : schematics)
@@ -127,22 +127,22 @@ public class GenObjectGroup
this.name = name;
}
public GList<GenObject> getSchematics()
public KList<GenObject> getSchematics()
{
return schematics;
}
public void setSchematics(GList<GenObject> schematics)
public void setSchematics(KList<GenObject> schematics)
{
this.schematics = schematics;
}
public GList<String> getFlags()
public KList<String> getFlags()
{
return flags;
}
public void setFlags(GList<String> flags)
public void setFlags(KList<String> flags)
{
this.flags = flags;
}
@@ -228,7 +228,7 @@ public class GenObjectGroup
if(!flags.contains("no rotation"))
{
GList<GenObject> inject = new GList<>();
KList<GenObject> inject = new KList<>();
for(GenObject i : getSchematics())
{
for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W})
@@ -244,7 +244,7 @@ public class GenObjectGroup
getSchematics().add(inject);
}
L.i(ChatColor.LIGHT_PURPLE + "Processed " + ChatColor.WHITE + F.f(schematics.size()) + ChatColor.LIGHT_PURPLE + " Schematics in " + ChatColor.WHITE + name);
L.i(ChatColor.LIGHT_PURPLE + "Processed " + ChatColor.WHITE + Form.f(schematics.size()) + ChatColor.LIGHT_PURPLE + " Schematics in " + ChatColor.WHITE + name);
}
public void dispose()

View File

@@ -13,15 +13,15 @@ import ninja.bytecode.iris.pack.IrisRegion;
import ninja.bytecode.iris.util.BiomeLayer;
import ninja.bytecode.iris.util.GenLayer;
import ninja.bytecode.iris.util.PolygonGenerator;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.CNG;
import ninja.bytecode.shuriken.math.RNG;
public class GenLayerBiome extends GenLayer
{
private GMap<String, IrisRegion> regions;
private KMap<String, IrisRegion> regions;
private Function<CNG, CNG> factory;
private CNG fracture;
private CNG fuzz;
@@ -29,7 +29,7 @@ public class GenLayerBiome extends GenLayer
private PolygonGenerator ocean;
private BiomeLayer master;
public GenLayerBiome(IrisGenerator iris, World world, Random random, RNG rng, GList<IrisBiome> biomes)
public GenLayerBiome(IrisGenerator iris, World world, Random random, RNG rng, KList<IrisBiome> biomes)
{
super(iris, world, random, rng);
//@builder
@@ -47,7 +47,7 @@ public class GenLayerBiome extends GenLayer
.scale(0.04)
.fractureWith(new CNG(rng.nextParallelRNG(1216), 1D, 3).scale(0.0004), 266), 66);
//@done
regions = new GMap<>();
regions = new KMap<>();
for(IrisBiome i : biomes)
{

View File

@@ -6,22 +6,22 @@ import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.iris.util.ChunkPlan;
import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GMap;
import ninja.bytecode.shuriken.collections.GSet;
import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.collections.KSet;
public class ParallaxCache
{
private GMap<SMCAVector, ChunkPlan> cachePlan;
private GMap<SMCAVector, AtomicChunkData> cacheData;
private GSet<SMCAVector> contains;
private KMap<SMCAVector, ChunkPlan> cachePlan;
private KMap<SMCAVector, AtomicChunkData> cacheData;
private KSet<SMCAVector> contains;
private IrisGenerator gen;
public ParallaxCache(IrisGenerator gen)
{
this.gen = gen;
cacheData = new GMap<>();
cachePlan = new GMap<>();
contains = new GSet<>();
cacheData = new KMap<>();
cachePlan = new KMap<>();
contains = new KSet<>();
}
public MB get(int x, int y, int z)

View File

@@ -22,7 +22,7 @@ import ninja.bytecode.iris.util.IrisWorldData;
import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SChunkVector;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
import ninja.bytecode.shuriken.collections.GSet;
import ninja.bytecode.shuriken.collections.KSet;
import ninja.bytecode.shuriken.execution.ChronoLatch;
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
import ninja.bytecode.shuriken.math.RNG;
@@ -33,7 +33,7 @@ public abstract class ParallaxWorldGenerator extends ParallelChunkGenerator impl
private IrisWorldData data;
private RNG rMaster;
private AtomicChunkData buffer;
private GSet<Chunk> fix;
private KSet<Chunk> fix;
private ChronoLatch cl;
protected boolean saving;
@@ -43,7 +43,7 @@ public abstract class ParallaxWorldGenerator extends ParallelChunkGenerator impl
this.world = world;
saving = true;
cl = new ChronoLatch(3000);
fix = new GSet<>();
fix = new KSet<>();
buffer = new AtomicChunkData(world);
this.data = new IrisWorldData(world);
this.rMaster = new RNG(world.getSeed() + 1);

View File

@@ -11,17 +11,17 @@ import mortar.api.nms.NMP;
import mortar.api.world.MaterialBlock;
import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.Placer;
import ninja.bytecode.shuriken.collections.GSet;
import ninja.bytecode.shuriken.collections.KSet;
import ninja.bytecode.shuriken.execution.J;
public class NMSPlacer extends Placer
{
private GSet<Chunk> c;
private KSet<Chunk> c;
public NMSPlacer(World world)
{
super(world);
c = new GSet<>();
c = new KSet<>();
}
@SuppressWarnings("deprecation")