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

@ -151,7 +151,7 @@
<dependency> <dependency>
<groupId>ninja.bytecode</groupId> <groupId>ninja.bytecode</groupId>
<artifactId>Shuriken</artifactId> <artifactId>Shuriken</artifactId>
<version>1.0.3</version> <version>1.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>

View File

@ -22,10 +22,10 @@ import ninja.bytecode.iris.generator.genobject.PlacedObject;
import ninja.bytecode.iris.pack.CompiledDimension; import ninja.bytecode.iris.pack.CompiledDimension;
import ninja.bytecode.iris.pack.IrisBiome; import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.iris.util.BiomeLayer; import ninja.bytecode.iris.util.BiomeLayer;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.execution.ChronoLatch; import ninja.bytecode.shuriken.execution.ChronoLatch;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
public class CommandIris implements CommandExecutor public class CommandIris implements CommandExecutor
@ -92,15 +92,15 @@ public class CommandIris implements CommandExecutor
if(percent > 1D) if(percent > 1D)
{ {
f = (int) percent + " + " + F.pc(percent - (int) percent, percent - (int) percent >= 0.01 ? 0 : 3); f = (int) percent + " + " + Form.pc(percent - (int) percent, percent - (int) percent >= 0.01 ? 0 : 3);
} }
else else
{ {
f = F.pc(percent, percent >= 0.01 ? 0 : 3); f = Form.pc(percent, percent >= 0.01 ? 0 : 3);
} }
msg(p, "* " + C.DARK_GREEN + i + ": " + C.BOLD + C.WHITE + f + C.RESET + C.GRAY + " (" + F.f(g.getDimension().getObjectGroup(i).size()) + " variants)"); msg(p, "* " + C.DARK_GREEN + i + ": " + C.BOLD + C.WHITE + f + C.RESET + C.GRAY + " (" + Form.f(g.getDimension().getObjectGroup(i).size()) + " variants)");
} }
} }
@ -231,7 +231,7 @@ public class CommandIris implements CommandExecutor
{ {
msg(sender, "=== Hotloading Pack ==="); msg(sender, "=== Hotloading Pack ===");
PackController c = Iris.getController(PackController.class); PackController c = Iris.getController(PackController.class);
GMap<String, String> f = new GMap<>(); KMap<String, String> f = new KMap<>();
for(World i : Bukkit.getWorlds()) for(World i : Bukkit.getWorlds())
{ {
@ -261,7 +261,7 @@ public class CommandIris implements CommandExecutor
if(msg.contains("|")) if(msg.contains("|"))
{ {
GList<String> fx = new GList<>(); KList<String> fx = new KList<>();
fx.add(msg.split("\\Q|\\E")); fx.add(msg.split("\\Q|\\E"));
fx.remove(0); fx.remove(0);
fx.remove(0); fx.remove(0);
@ -290,7 +290,7 @@ public class CommandIris implements CommandExecutor
{ {
if(cl.flip()) if(cl.flip())
{ {
msg(p, "Regenerating " + F.pc(pct)); msg(p, "Regenerating " + Form.pc(pct));
} }
}, () -> }, () ->
{ {

View File

@ -21,7 +21,7 @@ import ninja.bytecode.iris.generator.genobject.GenObject;
import ninja.bytecode.iris.util.Cuboid; import ninja.bytecode.iris.util.Cuboid;
import ninja.bytecode.iris.util.Cuboid.CuboidDirection; import ninja.bytecode.iris.util.Cuboid.CuboidDirection;
import ninja.bytecode.iris.util.Direction; import ninja.bytecode.iris.util.Direction;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
public class CommandIsh implements CommandExecutor public class CommandIsh implements CommandExecutor
{ {
@ -74,7 +74,7 @@ public class CommandIsh implements CommandExecutor
{ {
FileOutputStream fos = new FileOutputStream(f); FileOutputStream fos = new FileOutputStream(f);
s.write(fos, true); s.write(fos, true);
msg(p, "Saved " + args[1] + " (" + F.f(s.getSchematic().size()) + " Entries)"); msg(p, "Saved " + args[1] + " (" + Form.f(s.getSchematic().size()) + " Entries)");
p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 0.45f); p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 0.45f);
} }
@ -137,7 +137,7 @@ public class CommandIsh implements CommandExecutor
WandController.pasteSchematic(s, at); WandController.pasteSchematic(s, at);
p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.25f); p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.25f);
msg(p, "Pasted " + args[1] + " (" + F.f(s.getSchematic().size()) + " Blocks Modified)"); msg(p, "Pasted " + args[1] + " (" + Form.f(s.getSchematic().size()) + " Blocks Modified)");
} }
catch(Throwable e1) catch(Throwable e1)

View File

@ -8,9 +8,9 @@ import mortar.compute.math.M;
import mortar.util.text.C; import mortar.util.text.C;
import ninja.bytecode.iris.controller.ExecutionController; import ninja.bytecode.iris.controller.ExecutionController;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch; import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
import ninja.bytecode.shuriken.math.RollingSequence; import ninja.bytecode.shuriken.math.RollingSequence;
public class IrisMetrics public class IrisMetrics
@ -18,54 +18,54 @@ public class IrisMetrics
private int size; private int size;
private int generators; private int generators;
private double scale; private double scale;
private GMap<String, RollingSequence> sequences; private KMap<String, RollingSequence> sequences;
public IrisMetrics(int generators, int size) public IrisMetrics(int generators, int size)
{ {
scale = 1; scale = 1;
this.size = size; this.size = size;
this.generators = generators; this.generators = generators;
sequences = new GMap<>(); sequences = new KMap<>();
} }
public String avgMS(String s, int dec) public String avgMS(String s, int dec)
{ {
return F.duration(get(s).getAverage(), dec); return Form.duration(get(s).getAverage(), dec);
} }
public String avg(String s, int dec) public String avg(String s, int dec)
{ {
return F.f(get(s).getAverage(), dec); return Form.f(get(s).getAverage(), dec);
} }
public String maxMS(String s, int dec) public String maxMS(String s, int dec)
{ {
return F.duration(get(s).getMax(), dec); return Form.duration(get(s).getMax(), dec);
} }
public String max(String s, int dec) public String max(String s, int dec)
{ {
return F.f(get(s).getMax(), dec); return Form.f(get(s).getMax(), dec);
} }
public String minMS(String s, int dec) public String minMS(String s, int dec)
{ {
return F.duration(get(s).getMin(), dec); return Form.duration(get(s).getMin(), dec);
} }
public String min(String s, int dec) public String min(String s, int dec)
{ {
return F.f(get(s).getMin(), dec); return Form.f(get(s).getMin(), dec);
} }
public String medianMS(String s, int dec) public String medianMS(String s, int dec)
{ {
return F.duration(get(s).getMedian(), dec); return Form.duration(get(s).getMedian(), dec);
} }
public String median(String s, int dec) public String median(String s, int dec)
{ {
return F.f(get(s).getMedian(), dec); return Form.f(get(s).getMedian(), dec);
} }
public RollingSequence get(String s) public RollingSequence get(String s)
@ -108,12 +108,12 @@ public class IrisMetrics
this.generators = generators; this.generators = generators;
} }
public GMap<String, RollingSequence> getSequences() public KMap<String, RollingSequence> getSequences()
{ {
return sequences; return sequences;
} }
public void setSequences(GMap<String, RollingSequence> sequences) public void setSequences(KMap<String, RollingSequence> sequences)
{ {
this.sequences = sequences; this.sequences = sequences;
} }
@ -130,11 +130,11 @@ public class IrisMetrics
public void send(Player p, Consumer<String> c, String parent, int ind) public void send(Player p, Consumer<String> c, String parent, int ind)
{ {
GMap<String, String> out = new GMap<>(); KMap<String, String> out = new KMap<>();
looking: for(String i : getSequences().k()) looking: for(String i : getSequences().k())
{ {
GList<String> o = new GList<>(); KList<String> o = new KList<>();
if(i.contains(":")) if(i.contains(":"))
{ {
@ -208,24 +208,24 @@ public class IrisMetrics
comma = true; comma = true;
} }
String af = ms ? F.duration(vmin, dot) : comma ? F.f((int) vmin) : F.f(vmin, dot); String af = ms ? Form.duration(vmin, dot) : comma ? Form.f((int) vmin) : Form.f(vmin, dot);
String bf = ms ? F.duration(vmed, dot) : comma ? F.f((int) vmed) : F.f(vmed, dot); String bf = ms ? Form.duration(vmed, dot) : comma ? Form.f((int) vmed) : Form.f(vmed, dot);
String cf = ms ? F.duration(vavg, dot) : comma ? F.f((int) vavg) : F.f(vavg, dot); String cf = ms ? Form.duration(vavg, dot) : comma ? Form.f((int) vavg) : Form.f(vavg, dot);
String df = ms ? F.duration(vmax, dot) : comma ? F.f((int) vmax) : F.f(vmax, dot); String df = ms ? Form.duration(vmax, dot) : comma ? Form.f((int) vmax) : Form.f(vmax, dot);
out.put(pf, C.DARK_GREEN.toString() + C.ITALIC + cf + C.RESET + C.GRAY + " (" + C.DARK_AQUA + C.ITALIC + af + C.RESET + C.GRAY + " > " + C.GOLD + C.ITALIC + bf + C.RESET + C.GRAY + " < " + C.DARK_RED + C.ITALIC + df + C.RESET + C.GRAY + ")"); out.put(pf, C.DARK_GREEN.toString() + C.ITALIC + cf + C.RESET + C.GRAY + " (" + C.DARK_AQUA + C.ITALIC + af + C.RESET + C.GRAY + " > " + C.GOLD + C.ITALIC + bf + C.RESET + C.GRAY + " < " + C.DARK_RED + C.ITALIC + df + C.RESET + C.GRAY + ")");
} }
if(ind == 0) if(ind == 0)
{ {
c.accept(C.WHITE.toString() + C.BOLD + "Total Generators: " + C.RESET + C.DARK_AQUA + C.ITALIC + F.f(generators)); c.accept(C.WHITE.toString() + C.BOLD + "Total Generators: " + C.RESET + C.DARK_AQUA + C.ITALIC + Form.f(generators));
c.accept(C.WHITE.toString() + C.BOLD + "Parallelism: " + C.RESET + C.DARK_PURPLE + C.ITALIC + F.pc(scale) + C.WHITE + C.BOLD + " Threads: " + C.RESET + C.BLUE + C.ITALIC + Iris.getController(ExecutionController.class).getTC()); c.accept(C.WHITE.toString() + C.BOLD + "Parallelism: " + C.RESET + C.DARK_PURPLE + C.ITALIC + Form.pc(scale) + C.WHITE + C.BOLD + " Threads: " + C.RESET + C.BLUE + C.ITALIC + Iris.getController(ExecutionController.class).getTC());
} }
for(String i : out.k()) for(String i : out.k())
{ {
String g = F.capitalizeWords(i.replaceAll("\\Q-\\E", " ").toLowerCase()); String g = Form.capitalizeWords(i.replaceAll("\\Q-\\E", " ").toLowerCase());
c.accept(F.repeat(" ", M.iclip(ind, 0, 4)) + C.WHITE + C.BOLD + g + C.RESET + ": " + out.get(i)); c.accept(Form.repeat(" ", M.iclip(ind, 0, 4)) + C.WHITE + C.BOLD + g + C.RESET + ": " + out.get(i));
send(p, c, i, ind + 1); send(p, c, i, ind + 1);
} }

View File

@ -15,7 +15,7 @@ import ninja.bytecode.iris.controller.TimingsController;
import ninja.bytecode.iris.controller.WorldController; import ninja.bytecode.iris.controller.WorldController;
import ninja.bytecode.iris.generator.IrisGenerator; import ninja.bytecode.iris.generator.IrisGenerator;
import ninja.bytecode.iris.pack.IrisBiome; import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
public class CommandIris implements CommandExecutor public class CommandIris implements CommandExecutor
{ {
@ -41,9 +41,9 @@ public class CommandIris implements CommandExecutor
{ {
double t = Iris.getController(TimingsController.class).getResult("terrain"); double t = Iris.getController(TimingsController.class).getResult("terrain");
double d = Iris.getController(TimingsController.class).getResult("decor"); double d = Iris.getController(TimingsController.class).getResult("decor");
msg(sender, "Generation: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(t + d, 2)); msg(sender, "Generation: " + ChatColor.BOLD + ChatColor.WHITE + Form.duration(t + d, 2));
msg(sender, " \\Terrain: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(t, 2)); msg(sender, " \\Terrain: " + ChatColor.BOLD + ChatColor.WHITE + Form.duration(t, 2));
msg(sender, " \\Decor: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(d, 2)); msg(sender, " \\Decor: " + ChatColor.BOLD + ChatColor.WHITE + Form.duration(d, 2));
} }
if(args[0].equalsIgnoreCase("rtp")) if(args[0].equalsIgnoreCase("rtp"))

View File

@ -21,7 +21,7 @@ import ninja.bytecode.iris.generator.genobject.GenObject;
import ninja.bytecode.iris.util.Cuboid; import ninja.bytecode.iris.util.Cuboid;
import ninja.bytecode.iris.util.Cuboid.CuboidDirection; import ninja.bytecode.iris.util.Cuboid.CuboidDirection;
import ninja.bytecode.iris.util.Direction; import ninja.bytecode.iris.util.Direction;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
public class CommandIsh implements CommandExecutor public class CommandIsh implements CommandExecutor
{ {
@ -74,7 +74,7 @@ public class CommandIsh implements CommandExecutor
{ {
FileOutputStream fos = new FileOutputStream(f); FileOutputStream fos = new FileOutputStream(f);
s.write(fos, true); s.write(fos, true);
msg(p, "Saved " + args[1] + " (" + F.f(s.getSchematic().size()) + " Entries)"); msg(p, "Saved " + args[1] + " (" + Form.f(s.getSchematic().size()) + " Entries)");
p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 0.45f); p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 0.45f);
} }
@ -118,7 +118,7 @@ public class CommandIsh implements CommandExecutor
WandController.pasteSchematic(s, at); WandController.pasteSchematic(s, at);
p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.25f); p.playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.25f);
msg(p, "Pasted " + args[1] + " (" + F.f(s.getSchematic().size()) + " Blocks Modified)"); msg(p, "Pasted " + args[1] + " (" + Form.f(s.getSchematic().size()) + " Blocks Modified)");
} }
catch(Throwable e1) catch(Throwable e1)

View File

@ -12,8 +12,8 @@ import mortar.util.text.C;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.generator.IrisGenerator; import ninja.bytecode.iris.generator.IrisGenerator;
import ninja.bytecode.iris.util.IrisController; import ninja.bytecode.iris.util.IrisController;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GSet; import ninja.bytecode.shuriken.collections.KSet;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
public class DebugController implements IrisController public class DebugController implements IrisController
@ -39,8 +39,8 @@ public class DebugController implements IrisController
{ {
if(Iris.settings.performance.debugMode) if(Iris.settings.performance.debugMode)
{ {
GSet<String> ws = new GSet<>(); KSet<String> ws = new KSet<>();
GList<World> destroy = new GList<>(); KList<World> destroy = new KList<>();
for(World i : Bukkit.getWorlds()) for(World i : Bukkit.getWorlds())
{ {

View File

@ -4,17 +4,17 @@ import org.bukkit.World;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.util.IrisController; import ninja.bytecode.iris.util.IrisController;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.execution.TaskExecutor; import ninja.bytecode.shuriken.execution.TaskExecutor;
public class ExecutionController implements IrisController public class ExecutionController implements IrisController
{ {
GMap<String, TaskExecutor> executors; KMap<String, TaskExecutor> executors;
@Override @Override
public void onStart() public void onStart()
{ {
executors = new GMap<>(); executors = new KMap<>();
} }
@Override @Override

View File

@ -15,10 +15,10 @@ import ninja.bytecode.iris.pack.IrisDimension;
import ninja.bytecode.iris.pack.IrisPack; import ninja.bytecode.iris.pack.IrisPack;
import ninja.bytecode.iris.util.IrisController; import ninja.bytecode.iris.util.IrisController;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch; import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
import ninja.bytecode.shuriken.io.IO; import ninja.bytecode.shuriken.io.IO;
import ninja.bytecode.shuriken.json.JSONException; import ninja.bytecode.shuriken.json.JSONException;
import ninja.bytecode.shuriken.json.JSONObject; import ninja.bytecode.shuriken.json.JSONObject;
@ -26,19 +26,19 @@ import ninja.bytecode.shuriken.logging.L;
public class PackController implements IrisController public class PackController implements IrisController
{ {
private GMap<String, CompiledDimension> compiledDimensions; private KMap<String, CompiledDimension> compiledDimensions;
private GMap<String, IrisDimension> dimensions; private KMap<String, IrisDimension> dimensions;
private GMap<String, IrisBiome> biomes; private KMap<String, IrisBiome> biomes;
private GMap<String, GenObjectGroup> genObjectGroups; private KMap<String, GenObjectGroup> genObjectGroups;
private boolean ready; private boolean ready;
@Override @Override
public void onStart() public void onStart()
{ {
compiledDimensions = new GMap<>(); compiledDimensions = new KMap<>();
dimensions = new GMap<>(); dimensions = new KMap<>();
biomes = new GMap<>(); biomes = new KMap<>();
genObjectGroups = new GMap<>(); genObjectGroups = new KMap<>();
ready = false; ready = false;
} }
@ -53,9 +53,9 @@ public class PackController implements IrisController
return ready; return ready;
} }
public GList<File> getFiles(File folder) public KList<File> getFiles(File folder)
{ {
GList<File> buf = new GList<File>(); KList<File> buf = new KList<File>();
if(!folder.exists()) if(!folder.exists())
{ {
@ -83,9 +83,9 @@ public class PackController implements IrisController
public void compile() public void compile()
{ {
dimensions = new GMap<>(); dimensions = new KMap<>();
biomes = new GMap<>(); biomes = new KMap<>();
genObjectGroups = new GMap<>(); genObjectGroups = new KMap<>();
ready = false; ready = false;
PrecisionStopwatch p = PrecisionStopwatch.start(); PrecisionStopwatch p = PrecisionStopwatch.start();
File dims = new File(Iris.instance.getDataFolder(), "dimensions"); File dims = new File(Iris.instance.getDataFolder(), "dimensions");
@ -117,7 +117,7 @@ public class PackController implements IrisController
for(IrisBiome j : id.getBiomes()) for(IrisBiome j : id.getBiomes())
{ {
d.registerBiome(j); d.registerBiome(j);
GList<String> g = j.getSchematicGroups().k(); KList<String> g = j.getSchematicGroups().k();
g.sort(); g.sort();
for(String k : g) for(String k : g)
@ -152,13 +152,13 @@ public class PackController implements IrisController
CompiledDimension d = compiledDimensions.get(i); CompiledDimension d = compiledDimensions.get(i);
d.computeObjectSize(); d.computeObjectSize();
L.i(ChatColor.GREEN + i + ChatColor.WHITE + " (" + d.getEnvironment().toString().toLowerCase() + ")"); L.i(ChatColor.GREEN + i + ChatColor.WHITE + " (" + d.getEnvironment().toString().toLowerCase() + ")");
L.i(ChatColor.DARK_GREEN + " Biomes: " + ChatColor.GRAY + F.f(d.getBiomes().size())); L.i(ChatColor.DARK_GREEN + " Biomes: " + ChatColor.GRAY + Form.f(d.getBiomes().size()));
L.i(ChatColor.DARK_GREEN + " Objects: " + ChatColor.GRAY + F.f(d.countObjects())); L.i(ChatColor.DARK_GREEN + " Objects: " + ChatColor.GRAY + Form.f(d.countObjects()));
L.flush(); L.flush();
} }
L.i(""); L.i("");
L.i(ChatColor.LIGHT_PURPLE + "Compilation Time: " + ChatColor.WHITE + F.duration(p.getMilliseconds(), 2)); L.i(ChatColor.LIGHT_PURPLE + "Compilation Time: " + ChatColor.WHITE + Form.duration(p.getMilliseconds(), 2));
L.i(ChatColor.GREEN + "Iris Dimensions Successfully Compiled!"); L.i(ChatColor.GREEN + "Iris Dimensions Successfully Compiled!");
L.i(""); L.i("");
L.flush(); L.flush();
@ -166,22 +166,22 @@ public class PackController implements IrisController
ready = true; ready = true;
} }
public GMap<String, CompiledDimension> getCompiledDimensions() public KMap<String, CompiledDimension> getCompiledDimensions()
{ {
return compiledDimensions; return compiledDimensions;
} }
public GMap<String, IrisDimension> getDimensions() public KMap<String, IrisDimension> getDimensions()
{ {
return dimensions; return dimensions;
} }
public GMap<String, IrisBiome> getBiomes() public KMap<String, IrisBiome> getBiomes()
{ {
return biomes; return biomes;
} }
public GMap<String, GenObjectGroup> getGenObjectGroups() public KMap<String, GenObjectGroup> getGenObjectGroups()
{ {
return genObjectGroups; return genObjectGroups;
} }

View File

@ -34,20 +34,20 @@ import ninja.bytecode.iris.util.IrisController;
import ninja.bytecode.iris.util.MB; import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.ParticleEffect; import ninja.bytecode.iris.util.ParticleEffect;
import ninja.bytecode.iris.util.ParticleRedstone; import ninja.bytecode.iris.util.ParticleRedstone;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
public class WandController implements IrisController public class WandController implements IrisController
{ {
private GMap<String, GenObject> goc; private KMap<String, GenObject> goc;
private GMap<String, GenObjectGroup> gog; private KMap<String, GenObjectGroup> gog;
@Override @Override
public void onStart() public void onStart()
{ {
goc = new GMap<>(); goc = new KMap<>();
gog = new GMap<>(); gog = new KMap<>();
// TODO: Optimize // TODO: Optimize
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, () -> Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, () ->
{ {
@ -211,7 +211,7 @@ public class WandController implements IrisController
p.sendMessage(" "); p.sendMessage(" ");
} }
p.sendMessage(C.DARK_GREEN + C.BOLD.toString() + gg + C.GRAY + "/" + C.RESET + C.ITALIC + C.GRAY + g.getName() + C.RESET + C.WHITE + " (1 of " + F.f(generator.getDimension().getObjectGroup(gg).size()) + " variants)"); p.sendMessage(C.DARK_GREEN + C.BOLD.toString() + gg + C.GRAY + "/" + C.RESET + C.ITALIC + C.GRAY + g.getName() + C.RESET + C.WHITE + " (1 of " + Form.f(generator.getDimension().getObjectGroup(gg).size()) + " variants)");
if(biome.getSchematicGroups().containsKey(gg)) if(biome.getSchematicGroups().containsKey(gg))
{ {
@ -220,12 +220,12 @@ public class WandController implements IrisController
if(percent > 1D) if(percent > 1D)
{ {
f = (int) percent + " + " + F.pc(percent - (int) percent, percent - (int) percent >= 0.01 ? 0 : 3); f = (int) percent + " + " + Form.pc(percent - (int) percent, percent - (int) percent >= 0.01 ? 0 : 3);
} }
else else
{ {
f = F.pc(percent, percent >= 0.01 ? 0 : 3); f = Form.pc(percent, percent >= 0.01 ? 0 : 3);
} }
p.sendMessage(C.GOLD + "Spawn Chance in " + C.YELLOW + biome.getName() + C.RESET + ": " + C.BOLD + C.WHITE + f); p.sendMessage(C.GOLD + "Spawn Chance in " + C.YELLOW + biome.getName() + C.RESET + ": " + C.BOLD + C.WHITE + f);
@ -244,7 +244,7 @@ public class WandController implements IrisController
} }
c = ((double) a / (double) b); c = ((double) a / (double) b);
p.sendMessage(C.GRAY + "Grp: " + C.DARK_AQUA + F.f(a) + C.GRAY + " of " + C.AQUA + F.f(b) + C.GRAY + " placements (" + C.DARK_AQUA + F.pc(c, 0) + C.GRAY + ")"); p.sendMessage(C.GRAY + "Grp: " + C.DARK_AQUA + Form.f(a) + C.GRAY + " of " + C.AQUA + Form.f(b) + C.GRAY + " placements (" + C.DARK_AQUA + Form.pc(c, 0) + C.GRAY + ")");
} }
catch(Throwable e) catch(Throwable e)
@ -252,7 +252,7 @@ public class WandController implements IrisController
e.printStackTrace(); e.printStackTrace();
} }
p.sendMessage(C.GRAY + "Var: " + C.DARK_AQUA + F.f(g.getSuccesses()) + C.GRAY + " of " + C.AQUA + F.f(g.getPlaces()) + C.GRAY + " placements (" + C.DARK_AQUA + F.pc(g.getSuccess(), 0) + C.GRAY + ")"); p.sendMessage(C.GRAY + "Var: " + C.DARK_AQUA + Form.f(g.getSuccesses()) + C.GRAY + " of " + C.AQUA + Form.f(g.getPlaces()) + C.GRAY + " placements (" + C.DARK_AQUA + Form.pc(g.getSuccess(), 0) + C.GRAY + ")");
for(String i : ggg.getFlags()) for(String i : ggg.getFlags())
{ {
@ -397,7 +397,7 @@ public class WandController implements IrisController
im.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Wand of Iris"); im.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Wand of Iris");
im.setUnbreakable(true); im.setUnbreakable(true);
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS); im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS);
im.setLore(new GList<String>().add(locationToString(a), locationToString(b))); im.setLore(new KList<String>().add(locationToString(a), locationToString(b)));
is.setItemMeta(im); is.setItemMeta(im);
return is; return is;

View File

@ -33,7 +33,7 @@ import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.ObjectMode; import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SChunkVector; import ninja.bytecode.iris.util.SChunkVector;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch; 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.logging.L;
import ninja.bytecode.shuriken.math.CNG; import ninja.bytecode.shuriken.math.CNG;
import ninja.bytecode.shuriken.math.M; import ninja.bytecode.shuriken.math.M;
@ -42,7 +42,7 @@ import ninja.bytecode.shuriken.math.RNG;
public class IrisGenerator extends ParallaxWorldGenerator public class IrisGenerator extends ParallaxWorldGenerator
{ {
//@builder //@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), MB.of(Material.STONE),
MB.of(Material.STONE), MB.of(Material.STONE),
@ -246,7 +246,7 @@ public class IrisGenerator extends ParallaxWorldGenerator
@Override @Override
public List<BlockPopulator> getDefaultPopulators(World world) 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)) 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.ChronoQueue;
import ninja.bytecode.iris.util.ObjectMode; import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SMCAVector; import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
public class WorldReactor public class WorldReactor
{ {
private static GList<ChronoQueue> q = new GList<>(); private static KList<ChronoQueue> q = new KList<>();
private final World world; private final World world;
public WorldReactor(World world) public WorldReactor(World world)
@ -41,7 +41,7 @@ public class WorldReactor
WorldReactor.q.add(q); WorldReactor.q.add(q);
FinalDouble of = new FinalDouble(0D); FinalDouble of = new FinalDouble(0D);
FinalDouble max = 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 mx = p.getLocation().getChunk().getX();
int mz = p.getLocation().getChunk().getZ(); int mz = p.getLocation().getChunk().getZ();
for(int xx = p.getLocation().getChunk().getX() - 32; xx < p.getLocation().getChunk().getX() + 32; xx++) 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)))); Collections.sort(v, (a, b) -> (int) (10000 * (d.get(a) - d.get(b))));
for(SMCAVector i : v) for(SMCAVector i : v)

View File

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

View File

@ -8,22 +8,22 @@ import java.io.IOException;
import org.bukkit.World; import org.bukkit.World;
import ninja.bytecode.iris.util.SMCAVector; import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
public class AtomicWorldData public class AtomicWorldData
{ {
private World world; private World world;
private GMap<SMCAVector, AtomicRegionData> loadedSections; private KMap<SMCAVector, AtomicRegionData> loadedSections;
public AtomicWorldData(World world) public AtomicWorldData(World world)
{ {
this.world = world; this.world = world;
loadedSections = new GMap<>(); loadedSections = new KMap<>();
getSubregionFolder().mkdirs(); getSubregionFolder().mkdirs();
} }
public GList<SMCAVector> getLoadedRegions() public KList<SMCAVector> getLoadedRegions()
{ {
return loadedSections.k(); 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.MB;
import ninja.bytecode.iris.util.SBlockVector; import ninja.bytecode.iris.util.SBlockVector;
import ninja.bytecode.iris.util.VectorMath; import ninja.bytecode.iris.util.VectorMath;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.io.CustomOutputStream; import ninja.bytecode.shuriken.io.CustomOutputStream;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.RNG; import ninja.bytecode.shuriken.math.RNG;
@ -47,7 +47,7 @@ public class GenObject
private int failures; private int failures;
private int successes; private int successes;
private String name = "?"; private String name = "?";
private GMap<SBlockVector, MB> s; private KMap<SBlockVector, MB> s;
private BlockVector mount; private BlockVector mount;
private int mountHeight; private int mountHeight;
private BlockVector shift; private BlockVector shift;
@ -58,7 +58,7 @@ public class GenObject
this.h = h; this.h = h;
this.d = d; this.d = d;
shift = new BlockVector(); shift = new BlockVector();
s = new GMap<>(); s = new KMap<>();
centeredHeight = false; centeredHeight = false;
} }
@ -74,7 +74,7 @@ public class GenObject
} }
} }
GList<SBlockVector> fmount = new GList<>(); KList<SBlockVector> fmount = new KList<>();
for(SBlockVector i : s.keySet()) for(SBlockVector i : s.keySet())
{ {
@ -133,7 +133,7 @@ public class GenObject
return d; return d;
} }
public GMap<SBlockVector, MB> getSchematic() public KMap<SBlockVector, MB> getSchematic()
{ {
return s; return s;
} }
@ -227,7 +227,7 @@ public class GenObject
s.clear(); s.clear();
} }
public void fill(GMap<SBlockVector, MB> b) public void fill(KMap<SBlockVector, MB> b)
{ {
clear(); clear();
s.putAll(b); s.putAll(b);
@ -272,7 +272,7 @@ public class GenObject
} }
start.add(shift); start.add(shift);
GMap<Location, MB> undo = new GMap<>(); KMap<Location, MB> undo = new KMap<>();
for(SBlockVector i : s.keySet()) for(SBlockVector i : s.keySet())
{ {
@ -349,7 +349,7 @@ public class GenObject
public void rotate(Direction from, Direction to) public void rotate(Direction from, Direction to)
{ {
GMap<SBlockVector, MB> g = new GMap<>(); KMap<SBlockVector, MB> g = new KMap<>();
g.putAll(s); g.putAll(s);
s.clear(); 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.MB;
import ninja.bytecode.iris.util.ObjectMode; import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.SMCAVector; import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.collections.GSet; import ninja.bytecode.shuriken.collections.KSet;
import ninja.bytecode.shuriken.execution.ChronoLatch; import ninja.bytecode.shuriken.execution.ChronoLatch;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
@ -35,9 +35,9 @@ import ninja.bytecode.shuriken.math.RNG;
public class GenObjectDecorator extends BlockPopulator public class GenObjectDecorator extends BlockPopulator
{ {
private GList<PlacedObject> placeHistory; private KList<PlacedObject> placeHistory;
private GMap<IrisBiome, GList<GenObjectGroup>> orderCache; private KMap<IrisBiome, KList<GenObjectGroup>> orderCache;
private GMap<IrisBiome, GMap<GenObjectGroup, Double>> populationCache; private KMap<IrisBiome, KMap<GenObjectGroup, Double>> populationCache;
private IPlacer placer; private IPlacer placer;
private IrisGenerator g; private IrisGenerator g;
private ChronoLatch cl = new ChronoLatch(250); private ChronoLatch cl = new ChronoLatch(250);
@ -45,14 +45,14 @@ public class GenObjectDecorator extends BlockPopulator
public GenObjectDecorator(IrisGenerator generator) public GenObjectDecorator(IrisGenerator generator)
{ {
this.g = generator; this.g = generator;
placeHistory = new GList<>(); placeHistory = new KList<>();
populationCache = new GMap<>(); populationCache = new KMap<>();
orderCache = new GMap<>(); orderCache = new KMap<>();
for(IrisBiome i : generator.getDimension().getBiomes()) for(IrisBiome i : generator.getDimension().getBiomes())
{ {
GMap<GenObjectGroup, Double> gc = new GMap<>(); KMap<GenObjectGroup, Double> gc = new KMap<>();
GMap<Integer, GList<GenObjectGroup>> or = new GMap<>(); KMap<Integer, KList<GenObjectGroup>> or = new KMap<>();
int ff = 0; int ff = 0;
for(String j : i.getSchematicGroups().k()) for(String j : i.getSchematicGroups().k())
{ {
@ -66,7 +66,7 @@ public class GenObjectDecorator extends BlockPopulator
if(!or.containsKey(g.getPiority())) if(!or.containsKey(g.getPiority()))
{ {
or.put(g.getPiority(), new GList<>()); or.put(g.getPiority(), new KList<>());
} }
or.get(g.getPiority()).add(g); or.get(g.getPiority()).add(g);
@ -81,8 +81,8 @@ public class GenObjectDecorator extends BlockPopulator
if(!gc.isEmpty()) if(!gc.isEmpty())
{ {
GList<GenObjectGroup> g = new GList<>(); KList<GenObjectGroup> g = new KList<>();
for(GList<GenObjectGroup> j : or.v()) for(KList<GenObjectGroup> j : or.v())
{ {
g.addAll(j); g.addAll(j);
} }
@ -114,7 +114,7 @@ public class GenObjectDecorator extends BlockPopulator
return; return;
} }
GSet<IrisBiome> hits = new GSet<>(); KSet<IrisBiome> hits = new KSet<>();
int cx = source.getX(); int cx = source.getX();
int cz = source.getZ(); int cz = source.getZ();
@ -129,7 +129,7 @@ public class GenObjectDecorator extends BlockPopulator
continue; continue;
} }
GMap<GenObjectGroup, Double> objects = populationCache.get(biome); KMap<GenObjectGroup, Double> objects = populationCache.get(biome);
if(objects == null) if(objects == null)
{ {
@ -289,7 +289,7 @@ public class GenObjectDecorator extends BlockPopulator
} }
ParallaxCache cache = new ParallaxCache(g); 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++) for(int i = 0; i < Iris.settings.performance.decorationAccuracy; i++)
{ {
@ -302,7 +302,7 @@ public class GenObjectDecorator extends BlockPopulator
continue; continue;
} }
GMap<GenObjectGroup, Double> objects = populationCache.get(biome); KMap<GenObjectGroup, Double> objects = populationCache.get(biome);
if(objects == null) if(objects == null)
{ {
@ -426,7 +426,7 @@ public class GenObjectDecorator extends BlockPopulator
return floor; return floor;
} }
public GList<PlacedObject> getHistory() public KList<PlacedObject> getHistory()
{ {
return placeHistory; return placeHistory;
} }
@ -438,7 +438,7 @@ public class GenObjectDecorator extends BlockPopulator
public PlacedObject randomObject(String string) public PlacedObject randomObject(String string)
{ {
GList<PlacedObject> v = new GList<>(); KList<PlacedObject> v = new KList<>();
for(PlacedObject i : placeHistory) 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.Iris;
import ninja.bytecode.iris.controller.PackController; import ninja.bytecode.iris.controller.PackController;
import ninja.bytecode.iris.util.Direction; import ninja.bytecode.iris.util.Direction;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
import ninja.bytecode.shuriken.io.IO; import ninja.bytecode.shuriken.io.IO;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
public class GenObjectGroup public class GenObjectGroup
{ {
private GList<GenObject> schematics; private KList<GenObject> schematics;
private GList<String> flags; private KList<String> flags;
private String name; private String name;
private int priority; private int priority;
private double worldChance; private double worldChance;
@ -26,8 +26,8 @@ public class GenObjectGroup
public GenObjectGroup(String name) public GenObjectGroup(String name)
{ {
this.schematics = new GList<>(); this.schematics = new KList<>();
this.flags = new GList<>(); this.flags = new KList<>();
this.name = name; this.name = name;
priority = Integer.MIN_VALUE; priority = Integer.MIN_VALUE;
worldChance = Integer.MIN_VALUE; worldChance = Integer.MIN_VALUE;
@ -104,7 +104,7 @@ public class GenObjectGroup
public GenObjectGroup copy(String suffix) public GenObjectGroup copy(String suffix)
{ {
GenObjectGroup gog = new GenObjectGroup(name + suffix); GenObjectGroup gog = new GenObjectGroup(name + suffix);
gog.schematics = new GList<>(); gog.schematics = new KList<>();
gog.flags = flags.copy(); gog.flags = flags.copy();
for(GenObject i : schematics) for(GenObject i : schematics)
@ -127,22 +127,22 @@ public class GenObjectGroup
this.name = name; this.name = name;
} }
public GList<GenObject> getSchematics() public KList<GenObject> getSchematics()
{ {
return schematics; return schematics;
} }
public void setSchematics(GList<GenObject> schematics) public void setSchematics(KList<GenObject> schematics)
{ {
this.schematics = schematics; this.schematics = schematics;
} }
public GList<String> getFlags() public KList<String> getFlags()
{ {
return flags; return flags;
} }
public void setFlags(GList<String> flags) public void setFlags(KList<String> flags)
{ {
this.flags = flags; this.flags = flags;
} }
@ -228,7 +228,7 @@ public class GenObjectGroup
if(!flags.contains("no rotation")) if(!flags.contains("no rotation"))
{ {
GList<GenObject> inject = new GList<>(); KList<GenObject> inject = new KList<>();
for(GenObject i : getSchematics()) for(GenObject i : getSchematics())
{ {
for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W}) for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W})
@ -244,7 +244,7 @@ public class GenObjectGroup
getSchematics().add(inject); 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() 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.BiomeLayer;
import ninja.bytecode.iris.util.GenLayer; import ninja.bytecode.iris.util.GenLayer;
import ninja.bytecode.iris.util.PolygonGenerator; import ninja.bytecode.iris.util.PolygonGenerator;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.CNG; import ninja.bytecode.shuriken.math.CNG;
import ninja.bytecode.shuriken.math.RNG; import ninja.bytecode.shuriken.math.RNG;
public class GenLayerBiome extends GenLayer public class GenLayerBiome extends GenLayer
{ {
private GMap<String, IrisRegion> regions; private KMap<String, IrisRegion> regions;
private Function<CNG, CNG> factory; private Function<CNG, CNG> factory;
private CNG fracture; private CNG fracture;
private CNG fuzz; private CNG fuzz;
@ -29,7 +29,7 @@ public class GenLayerBiome extends GenLayer
private PolygonGenerator ocean; private PolygonGenerator ocean;
private BiomeLayer master; 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); super(iris, world, random, rng);
//@builder //@builder
@ -47,7 +47,7 @@ public class GenLayerBiome extends GenLayer
.scale(0.04) .scale(0.04)
.fractureWith(new CNG(rng.nextParallelRNG(1216), 1D, 3).scale(0.0004), 266), 66); .fractureWith(new CNG(rng.nextParallelRNG(1216), 1D, 3).scale(0.0004), 266), 66);
//@done //@done
regions = new GMap<>(); regions = new KMap<>();
for(IrisBiome i : biomes) 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.ChunkPlan;
import ninja.bytecode.iris.util.MB; import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.SMCAVector; import ninja.bytecode.iris.util.SMCAVector;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.collections.GSet; import ninja.bytecode.shuriken.collections.KSet;
public class ParallaxCache public class ParallaxCache
{ {
private GMap<SMCAVector, ChunkPlan> cachePlan; private KMap<SMCAVector, ChunkPlan> cachePlan;
private GMap<SMCAVector, AtomicChunkData> cacheData; private KMap<SMCAVector, AtomicChunkData> cacheData;
private GSet<SMCAVector> contains; private KSet<SMCAVector> contains;
private IrisGenerator gen; private IrisGenerator gen;
public ParallaxCache(IrisGenerator gen) public ParallaxCache(IrisGenerator gen)
{ {
this.gen = gen; this.gen = gen;
cacheData = new GMap<>(); cacheData = new KMap<>();
cachePlan = new GMap<>(); cachePlan = new KMap<>();
contains = new GSet<>(); contains = new KSet<>();
} }
public MB get(int x, int y, int z) 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.ObjectMode;
import ninja.bytecode.iris.util.SChunkVector; import ninja.bytecode.iris.util.SChunkVector;
import ninja.bytecode.shuriken.bench.PrecisionStopwatch; 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.ChronoLatch;
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup; import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
import ninja.bytecode.shuriken.math.RNG; import ninja.bytecode.shuriken.math.RNG;
@ -33,7 +33,7 @@ public abstract class ParallaxWorldGenerator extends ParallelChunkGenerator impl
private IrisWorldData data; private IrisWorldData data;
private RNG rMaster; private RNG rMaster;
private AtomicChunkData buffer; private AtomicChunkData buffer;
private GSet<Chunk> fix; private KSet<Chunk> fix;
private ChronoLatch cl; private ChronoLatch cl;
protected boolean saving; protected boolean saving;
@ -43,7 +43,7 @@ public abstract class ParallaxWorldGenerator extends ParallelChunkGenerator impl
this.world = world; this.world = world;
saving = true; saving = true;
cl = new ChronoLatch(3000); cl = new ChronoLatch(3000);
fix = new GSet<>(); fix = new KSet<>();
buffer = new AtomicChunkData(world); buffer = new AtomicChunkData(world);
this.data = new IrisWorldData(world); this.data = new IrisWorldData(world);
this.rMaster = new RNG(world.getSeed() + 1); this.rMaster = new RNG(world.getSeed() + 1);

View File

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

View File

@ -17,8 +17,8 @@ import ninja.bytecode.iris.generator.genobject.GenObject;
import ninja.bytecode.iris.generator.genobject.GenObjectGroup; import ninja.bytecode.iris.generator.genobject.GenObjectGroup;
import ninja.bytecode.iris.util.SChunkVector; import ninja.bytecode.iris.util.SChunkVector;
import ninja.bytecode.iris.util.SBlockVector; import ninja.bytecode.iris.util.SBlockVector;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.io.CustomOutputStream; import ninja.bytecode.shuriken.io.CustomOutputStream;
import ninja.bytecode.shuriken.json.JSONObject; import ninja.bytecode.shuriken.json.JSONObject;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
@ -29,18 +29,18 @@ public class CompiledDimension
{ {
public static IrisBiome theVoid = new IrisBiome("Void", Biome.VOID).height(0).seal(RNG.r); public static IrisBiome theVoid = new IrisBiome("Void", Biome.VOID).height(0).seal(RNG.r);
private IrisDimension dimension; private IrisDimension dimension;
private GList<IrisBiome> biomes; private KList<IrisBiome> biomes;
private GMap<String, IrisBiome> biomeCache; private KMap<String, IrisBiome> biomeCache;
private GMap<String, GenObjectGroup> objects; private KMap<String, GenObjectGroup> objects;
private SBlockVector maxSize; private SBlockVector maxSize;
private SChunkVector maxChunkSize; private SChunkVector maxChunkSize;
public CompiledDimension(IrisDimension dimension) public CompiledDimension(IrisDimension dimension)
{ {
this.dimension = dimension; this.dimension = dimension;
biomes = new GList<>(); biomes = new KList<>();
biomeCache = new GMap<>(); biomeCache = new KMap<>();
objects = new GMap<>(); objects = new KMap<>();
maxSize = new SBlockVector(0, 0, 0); maxSize = new SBlockVector(0, 0, 0);
maxChunkSize = new SChunkVector(0, 0); maxChunkSize = new SChunkVector(0, 0);
} }
@ -132,7 +132,7 @@ public class CompiledDimension
return dimension.getName(); return dimension.getName();
} }
public GList<IrisBiome> getBiomes() public KList<IrisBiome> getBiomes()
{ {
return biomes; return biomes;
} }
@ -222,12 +222,12 @@ public class CompiledDimension
return dimension; return dimension;
} }
public GMap<String, IrisBiome> getBiomeCache() public KMap<String, IrisBiome> getBiomeCache()
{ {
return biomeCache; return biomeCache;
} }
public GMap<String, GenObjectGroup> getObjects() public KMap<String, GenObjectGroup> getObjects()
{ {
return objects; return objects;
} }

View File

@ -13,8 +13,8 @@ import ninja.bytecode.iris.generator.layer.BiomeNoiseGenerator;
import ninja.bytecode.iris.util.MB; import ninja.bytecode.iris.util.MB;
import ninja.bytecode.iris.util.ObjectMode; import ninja.bytecode.iris.util.ObjectMode;
import ninja.bytecode.iris.util.PolygonGenerator; import ninja.bytecode.iris.util.PolygonGenerator;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.json.JSONArray; import ninja.bytecode.shuriken.json.JSONArray;
import ninja.bytecode.shuriken.json.JSONObject; import ninja.bytecode.shuriken.json.JSONObject;
@ -28,17 +28,17 @@ public class IrisBiome
public static final double MAX_HEIGHT = 0.77768; public static final double MAX_HEIGHT = 0.77768;
public static final double IDEAL_HEIGHT = 0.138; public static final double IDEAL_HEIGHT = 0.138;
public static final double MIN_HEIGHT = -0.0218; public static final double MIN_HEIGHT = -0.0218;
private static final GMap<Biome, IrisBiome> map = build(); private static final KMap<Biome, IrisBiome> map = build();
private String name; private String name;
private String parent; private String parent;
private Biome realBiome; private Biome realBiome;
private double height; private double height;
private GList<MB> rock; private KList<MB> rock;
private MB fluid; private MB fluid;
private int rockDepth; private int rockDepth;
private GList<MB> surface; private KList<MB> surface;
private GList<MB> dirt; private KList<MB> dirt;
private GMap<MB, Double> scatterChance; private KMap<MB, Double> scatterChance;
private boolean scatterSurface; private boolean scatterSurface;
private boolean scatterSurfaceRock; private boolean scatterSurfaceRock;
private boolean scatterSurfaceSub; private boolean scatterSurfaceSub;
@ -62,7 +62,7 @@ public class IrisBiome
private BiomeNoiseGenerator bng; private BiomeNoiseGenerator bng;
private BiomeType type; private BiomeType type;
private String region; private String region;
private GMap<String, Double> schematicGroups; private KMap<String, Double> schematicGroups;
private PolygonGenerator.EnumPolygonGenerator<MB> poly; private PolygonGenerator.EnumPolygonGenerator<MB> poly;
private PolygonGenerator.EnumPolygonGenerator<MB> polySub; private PolygonGenerator.EnumPolygonGenerator<MB> polySub;
private PolygonGenerator.EnumPolygonGenerator<MB> polyRock; private PolygonGenerator.EnumPolygonGenerator<MB> polyRock;
@ -82,7 +82,7 @@ public class IrisBiome
return MIN_HEIGHT; return MIN_HEIGHT;
} }
public static GMap<Biome, IrisBiome> getMap() public static KMap<Biome, IrisBiome> getMap()
{ {
return map; return map;
} }
@ -140,8 +140,8 @@ public class IrisBiome
scatterSurfaceRock = true; scatterSurfaceRock = true;
simplexScatterSub = false; simplexScatterSub = false;
scatterSurfaceSub = true; scatterSurfaceSub = true;
scatterChance = new GMap<>(); scatterChance = new KMap<>();
schematicGroups = new GMap<>(); schematicGroups = new KMap<>();
//@builder //@builder
surface(new MB(Material.GRASS)) surface(new MB(Material.GRASS))
.dirt(new MB(Material.DIRT), new MB(Material.DIRT, 1)) .dirt(new MB(Material.DIRT), new MB(Material.DIRT, 1))
@ -277,7 +277,7 @@ public class IrisBiome
else else
{ {
schematicGroups = new GMap<>(); schematicGroups = new KMap<>();
} }
if(chain) if(chain)
@ -329,9 +329,9 @@ public class IrisBiome
return j; return j;
} }
private GList<MB> mbListFromJSON(JSONArray ja) private KList<MB> mbListFromJSON(JSONArray ja)
{ {
GList<MB> mb = new GList<>(); KList<MB> mb = new KList<>();
for(int i = 0; i < ja.length(); i++) for(int i = 0; i < ja.length(); i++)
{ {
@ -341,7 +341,7 @@ public class IrisBiome
return mb; return mb;
} }
private JSONArray mbListToJSON(GList<MB> mbs) private JSONArray mbListToJSON(KList<MB> mbs)
{ {
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
@ -359,9 +359,9 @@ public class IrisBiome
return this; return this;
} }
private GMap<MB, Double> scatterFromJSON(JSONArray ja) private KMap<MB, Double> scatterFromJSON(JSONArray ja)
{ {
GMap<MB, Double> mb = new GMap<MB, Double>(); KMap<MB, Double> mb = new KMap<MB, Double>();
for(int i = 0; i < ja.length(); i++) for(int i = 0; i < ja.length(); i++)
{ {
@ -372,7 +372,7 @@ public class IrisBiome
return mb; return mb;
} }
private JSONArray scatterToJson(GMap<MB, Double> mbs) private JSONArray scatterToJson(KMap<MB, Double> mbs)
{ {
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
@ -384,9 +384,9 @@ public class IrisBiome
return ja; return ja;
} }
private GMap<String, Double> strFromJSON(JSONArray ja) private KMap<String, Double> strFromJSON(JSONArray ja)
{ {
GMap<String, Double> mb = new GMap<String, Double>(); KMap<String, Double> mb = new KMap<String, Double>();
for(int i = 0; i < ja.length(); i++) for(int i = 0; i < ja.length(); i++)
{ {
@ -397,7 +397,7 @@ public class IrisBiome
return mb; return mb;
} }
private JSONArray strToJson(GMap<String, Double> mbs) private JSONArray strToJson(KMap<String, Double> mbs)
{ {
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
@ -409,9 +409,9 @@ public class IrisBiome
return ja; return ja;
} }
private static GMap<Biome, IrisBiome> build() private static KMap<Biome, IrisBiome> build()
{ {
GMap<Biome, IrisBiome> g = new GMap<Biome, IrisBiome>(); KMap<Biome, IrisBiome> g = new KMap<Biome, IrisBiome>();
for(Field i : IrisBiome.class.getDeclaredFields()) for(Field i : IrisBiome.class.getDeclaredFields())
{ {
@ -459,19 +459,19 @@ public class IrisBiome
public IrisBiome surface(MB... mbs) public IrisBiome surface(MB... mbs)
{ {
surface = new GList<>(mbs); surface = new KList<>(mbs);
return this; return this;
} }
public IrisBiome dirt(MB... mbs) public IrisBiome dirt(MB... mbs)
{ {
dirt = new GList<>(mbs); dirt = new KList<>(mbs);
return this; return this;
} }
public IrisBiome rock(MB... mbs) public IrisBiome rock(MB... mbs)
{ {
rock = new GList<>(mbs); rock = new KList<>(mbs);
return this; return this;
} }
@ -505,17 +505,17 @@ public class IrisBiome
return height; return height;
} }
public GList<MB> getSurface() public KList<MB> getSurface()
{ {
return surface; return surface;
} }
public GList<MB> getRock() public KList<MB> getRock()
{ {
return rock; return rock;
} }
public GList<MB> getDirt() public KList<MB> getDirt()
{ {
return dirt; return dirt;
} }
@ -589,7 +589,7 @@ public class IrisBiome
return getSurface().getRandom(); return getSurface().getRandom();
} }
public GMap<MB, Double> getScatterChance() public KMap<MB, Double> getScatterChance()
{ {
return scatterChance; return scatterChance;
} }
@ -607,7 +607,7 @@ public class IrisBiome
return MB.of(Material.AIR); return MB.of(Material.AIR);
} }
public static GList<IrisBiome> getBiomes() public static KList<IrisBiome> getBiomes()
{ {
return map.v(); return map.v();
} }
@ -622,7 +622,7 @@ public class IrisBiome
return null; return null;
} }
public GMap<String, Double> getSchematicGroups() public KMap<String, Double> getSchematicGroups()
{ {
return schematicGroups; return schematicGroups;
} }
@ -690,9 +690,9 @@ public class IrisBiome
return parent; return parent;
} }
public GList<String> getParents() public KList<String> getParents()
{ {
GList<String> f = new GList<>(); KList<String> f = new KList<>();
if(getParent().trim().isEmpty()) if(getParent().trim().isEmpty())
{ {
@ -815,7 +815,7 @@ public class IrisBiome
this.height = height; this.height = height;
} }
public void setRock(GList<MB> rock) public void setRock(KList<MB> rock)
{ {
this.rock = rock; this.rock = rock;
} }
@ -825,17 +825,17 @@ public class IrisBiome
this.rockDepth = rockDepth; this.rockDepth = rockDepth;
} }
public void setSurface(GList<MB> surface) public void setSurface(KList<MB> surface)
{ {
this.surface = surface; this.surface = surface;
} }
public void setDirt(GList<MB> dirt) public void setDirt(KList<MB> dirt)
{ {
this.dirt = dirt; this.dirt = dirt;
} }
public void setScatterChance(GMap<MB, Double> scatterChance) public void setScatterChance(KMap<MB, Double> scatterChance)
{ {
this.scatterChance = scatterChance; this.scatterChance = scatterChance;
} }
@ -925,7 +925,7 @@ public class IrisBiome
this.region = region; this.region = region;
} }
public void setSchematicGroups(GMap<String, Double> schematicGroups) public void setSchematicGroups(KMap<String, Double> schematicGroups)
{ {
this.schematicGroups = schematicGroups; this.schematicGroups = schematicGroups;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.World.Environment;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.controller.PackController; import ninja.bytecode.iris.controller.PackController;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.json.JSONArray; import ninja.bytecode.shuriken.json.JSONArray;
import ninja.bytecode.shuriken.json.JSONException; import ninja.bytecode.shuriken.json.JSONException;
@ -16,7 +16,7 @@ public class IrisDimension
{ {
private String name; private String name;
private Environment environment; private Environment environment;
GList<IrisBiome> biomes; KList<IrisBiome> biomes;
public IrisDimension(JSONObject o) throws JSONException, IOException public IrisDimension(JSONObject o) throws JSONException, IOException
{ {
@ -26,7 +26,7 @@ public class IrisDimension
public IrisDimension() public IrisDimension()
{ {
biomes = new GList<IrisBiome>(); biomes = new KList<IrisBiome>();
environment = Environment.NORMAL; environment = Environment.NORMAL;
} }
@ -42,7 +42,7 @@ public class IrisDimension
try try
{ {
biomes = chain ? biomesFromArray(o.getJSONArray("biomes")) : new GList<>(); biomes = chain ? biomesFromArray(o.getJSONArray("biomes")) : new KList<>();
} }
catch(Throwable e) catch(Throwable e)
@ -62,9 +62,9 @@ public class IrisDimension
return o; return o;
} }
private GList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException private KList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException
{ {
GList<IrisBiome> b = new GList<>(); KList<IrisBiome> b = new KList<>();
for(int i = 0; i < a.length(); i++) for(int i = 0; i < a.length(); i++)
{ {
int ii = i; int ii = i;
@ -76,7 +76,7 @@ public class IrisDimension
return b; return b;
} }
private JSONArray biomesToArray(GList<IrisBiome> b) private JSONArray biomesToArray(KList<IrisBiome> b)
{ {
JSONArray a = new JSONArray(); JSONArray a = new JSONArray();
@ -88,7 +88,7 @@ public class IrisDimension
return a; return a;
} }
public GList<IrisBiome> getBiomes() public KList<IrisBiome> getBiomes()
{ {
return biomes; return biomes;
} }

View File

@ -4,7 +4,7 @@ import java.io.IOException;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.controller.PackController; import ninja.bytecode.iris.controller.PackController;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.json.JSONArray; import ninja.bytecode.shuriken.json.JSONArray;
import ninja.bytecode.shuriken.json.JSONException; import ninja.bytecode.shuriken.json.JSONException;
@ -12,15 +12,15 @@ import ninja.bytecode.shuriken.json.JSONObject;
public class IrisPack public class IrisPack
{ {
private GList<String> dimensions; private KList<String> dimensions;
private GList<String> biomes; private KList<String> biomes;
private GList<String> objects; private KList<String> objects;
public IrisPack() public IrisPack()
{ {
this.dimensions = new GList<>(); this.dimensions = new KList<>();
this.biomes = new GList<>(); this.biomes = new KList<>();
this.objects = new GList<>(); this.objects = new KList<>();
} }
public IrisPack(JSONObject o) public IrisPack(JSONObject o)
@ -46,9 +46,9 @@ public class IrisPack
return o; return o;
} }
public GList<String> fromArray(JSONArray ja) public KList<String> fromArray(JSONArray ja)
{ {
GList<String> g = new GList<>(); KList<String> g = new KList<>();
for(int i = 0; i < ja.length(); i++) for(int i = 0; i < ja.length(); i++)
{ {
@ -58,7 +58,7 @@ public class IrisPack
return g; return g;
} }
public JSONArray toArray(GList<String> s) public JSONArray toArray(KList<String> s)
{ {
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();

View File

@ -4,14 +4,14 @@ import java.util.Objects;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.controller.PackController; import ninja.bytecode.iris.controller.PackController;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.execution.J; import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.json.JSONObject; import ninja.bytecode.shuriken.json.JSONObject;
public class IrisRegion public class IrisRegion
{ {
private String name; private String name;
private GList<IrisBiome> biomes; private KList<IrisBiome> biomes;
private IrisBiome ocean; private IrisBiome ocean;
private IrisBiome lake; private IrisBiome lake;
private IrisBiome lakeBeach; private IrisBiome lakeBeach;
@ -21,7 +21,7 @@ public class IrisRegion
public IrisRegion(String name) public IrisRegion(String name)
{ {
this.name = name; this.name = name;
this.biomes = new GList<>(); this.biomes = new KList<>();
beach = null; beach = null;
ocean = null; ocean = null;
lake = null; lake = null;
@ -53,12 +53,12 @@ public class IrisRegion
this.name = name; this.name = name;
} }
public GList<IrisBiome> getBiomes() public KList<IrisBiome> getBiomes()
{ {
return biomes; return biomes;
} }
public void setBiomes(GList<IrisBiome> biomes) public void setBiomes(KList<IrisBiome> biomes)
{ {
this.biomes = biomes; this.biomes = biomes;
} }

View File

@ -13,7 +13,7 @@ import ninja.bytecode.iris.generator.IrisGenerator;
import ninja.bytecode.iris.pack.BiomeType; import ninja.bytecode.iris.pack.BiomeType;
import ninja.bytecode.iris.pack.IrisBiome; import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.iris.util.PolygonGenerator.EnumPolygonGenerator; import ninja.bytecode.iris.util.PolygonGenerator.EnumPolygonGenerator;
import ninja.bytecode.shuriken.collections.GSet; import ninja.bytecode.shuriken.collections.KSet;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.math.CNG; import ninja.bytecode.shuriken.math.CNG;
import ninja.bytecode.shuriken.math.RNG; import ninja.bytecode.shuriken.math.RNG;
@ -179,7 +179,7 @@ public class BiomeLayer
} }
} }
GSet<String> deject = new GSet<>(); KSet<String> deject = new KSet<>();
for(String i : components.keySet()) for(String i : components.keySet())
{ {

View File

@ -1,21 +1,21 @@
package ninja.bytecode.iris.util; package ninja.bytecode.iris.util;
import ninja.bytecode.iris.pack.IrisBiome; import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
public class ChunkPlan public class ChunkPlan
{ {
private final GMap<SChunkVector, Integer> realHeightCache; private final KMap<SChunkVector, Integer> realHeightCache;
private final GMap<SChunkVector, Integer> realWaterHeightCache; private final KMap<SChunkVector, Integer> realWaterHeightCache;
private final GMap<SChunkVector, Double> heightCache; private final KMap<SChunkVector, Double> heightCache;
private final GMap<SChunkVector, IrisBiome> biomeCache; private final KMap<SChunkVector, IrisBiome> biomeCache;
public ChunkPlan() public ChunkPlan()
{ {
this.realHeightCache = new GMap<>(); this.realHeightCache = new KMap<>();
this.realWaterHeightCache = new GMap<>(); this.realWaterHeightCache = new KMap<>();
this.heightCache = new GMap<>(); this.heightCache = new KMap<>();
this.biomeCache = new GMap<>(); this.biomeCache = new KMap<>();
} }
public IrisBiome getBiome(int x, int z) public IrisBiome getBiome(int x, int z)

View File

@ -17,7 +17,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
/** /**
* Cuboids * Cuboids
@ -55,9 +55,9 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
z2 = Math.max(l1.getBlockZ(), l2.getBlockZ()); z2 = Math.max(l1.getBlockZ(), l2.getBlockZ());
} }
public GList<LivingEntity> getLivingEntities() public KList<LivingEntity> getLivingEntities()
{ {
return new GList<LivingEntity>(new GListAdapter<Entity, LivingEntity>() return new KList<LivingEntity>(new GListAdapter<Entity, LivingEntity>()
{ {
@Override @Override
public LivingEntity onAdapt(Entity from) public LivingEntity onAdapt(Entity from)
@ -72,9 +72,9 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
}.adapt(getEntities())); }.adapt(getEntities()));
} }
public GList<Entity> getEntities() public KList<Entity> getEntities()
{ {
GList<Entity> en = new GList<Entity>(); KList<Entity> en = new KList<Entity>();
for(Chunk i : getChunks()) for(Chunk i : getChunks())
{ {

View File

@ -5,8 +5,8 @@ import org.bukkit.block.BlockFace;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import ninja.bytecode.iris.util.Cuboid.CuboidDirection; import ninja.bytecode.iris.util.Cuboid.CuboidDirection;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
/** /**
* Directions * Directions
@ -22,7 +22,7 @@ public enum Direction
E(1, 0, 0, CuboidDirection.East), E(1, 0, 0, CuboidDirection.East),
W(-1, 0, 0, CuboidDirection.West); W(-1, 0, 0, CuboidDirection.West);
private static GMap<GBiset<Direction, Direction>, DOP> permute = null; private static KMap<GBiset<Direction, Direction>, DOP> permute = null;
private int x; private int x;
private int y; private int y;
@ -143,7 +143,7 @@ public enum Direction
return s; return s;
} }
public static Direction closest(Vector v, GList<Direction> d) public static Direction closest(Vector v, KList<Direction> d)
{ {
double m = Double.MAX_VALUE; double m = Double.MAX_VALUE;
Direction s = null; Direction s = null;
@ -249,9 +249,9 @@ public enum Direction
return f; return f;
} }
public static GList<Direction> news() public static KList<Direction> news()
{ {
return new GList<Direction>().add(N, E, W, S); return new KList<Direction>().add(N, E, W, S);
} }
public static Direction getDirection(Vector v) public static Direction getDirection(Vector v)
@ -269,9 +269,9 @@ public enum Direction
return Direction.N; return Direction.N;
} }
public static GList<Direction> udnews() public static KList<Direction> udnews()
{ {
return new GList<Direction>().add(U, D, N, E, W, S); return new KList<Direction>().add(U, D, N, E, W, S);
} }
/** /**
@ -356,7 +356,7 @@ public enum Direction
return; return;
} }
permute = new GMap<GBiset<Direction, Direction>, DOP>(); permute = new KMap<GBiset<Direction, Direction>, DOP>();
for(Direction i : udnews()) for(Direction i : udnews())
{ {

View File

@ -3,7 +3,7 @@ package ninja.bytecode.iris.util;
import java.util.List; import java.util.List;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
/** /**
* Adapts a list of objects into a list of other objects * Adapts a list of objects into a list of other objects
@ -25,7 +25,7 @@ public abstract class GListAdapter<FROM, TO>
*/ */
public List<TO> adapt(List<FROM> from) public List<TO> adapt(List<FROM> from)
{ {
List<TO> adapted = new GList<TO>(); List<TO> adapted = new KList<TO>();
for(FROM i : from) for(FROM i : from)
{ {

View File

@ -7,17 +7,17 @@ import org.bukkit.Bukkit;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
import ninja.bytecode.shuriken.tools.JarScanner; import ninja.bytecode.shuriken.tools.JarScanner;
public class IrisControllerSet public class IrisControllerSet
{ {
private GMap<Class<?>, IrisController> controllers; private KMap<Class<?>, IrisController> controllers;
public IrisControllerSet() public IrisControllerSet()
{ {
controllers = new GMap<>(); controllers = new KMap<>();
} }
public void startControllers(File jar) throws IOException public void startControllers(File jar) throws IOException

View File

@ -11,8 +11,8 @@ import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.generator.atomics.AtomicChunkData; import ninja.bytecode.iris.generator.atomics.AtomicChunkData;
import ninja.bytecode.iris.generator.atomics.AtomicRegionData; import ninja.bytecode.iris.generator.atomics.AtomicRegionData;
import ninja.bytecode.iris.generator.atomics.AtomicWorldData; import ninja.bytecode.iris.generator.atomics.AtomicWorldData;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
public class IrisWorldData public class IrisWorldData
@ -20,14 +20,14 @@ public class IrisWorldData
private final World world; private final World world;
private final AtomicWorldData data; private final AtomicWorldData data;
private boolean saving; private boolean saving;
private final GMap<SMCAVector, AtomicChunkData> loadedChunks; private final KMap<SMCAVector, AtomicChunkData> loadedChunks;
public IrisWorldData(World world) public IrisWorldData(World world)
{ {
this.world = world; this.world = world;
saving = true; saving = true;
data = new AtomicWorldData(world); data = new AtomicWorldData(world);
loadedChunks = new GMap<>(); loadedChunks = new KMap<>();
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, this::softUnloadWorld, 200, 20); Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, this::softUnloadWorld, 200, 20);
} }
@ -232,12 +232,12 @@ public class IrisWorldData
return false; return false;
} }
public GList<SMCAVector> getLoadedChunks() public KList<SMCAVector> getLoadedChunks()
{ {
return loadedChunks.k(); return loadedChunks.k();
} }
public GList<SMCAVector> getLoadedRegions() public KList<SMCAVector> getLoadedRegions()
{ {
return data.getLoadedRegions(); return data.getLoadedRegions();
} }

View File

@ -3,7 +3,7 @@ package ninja.bytecode.iris.util;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
public abstract class ParticleBase implements VisualEffect public abstract class ParticleBase implements VisualEffect
{ {
@ -20,7 +20,7 @@ public abstract class ParticleBase implements VisualEffect
} }
@Override @Override
public void play(Location l, GList<Player> p) public void play(Location l, KList<Player> p)
{ {
for(Player i : p) for(Player i : p)
{ {

View File

@ -6,7 +6,7 @@ import org.bukkit.block.Biome;
import net.minecraft.server.v1_12_R1.BiomeBase; import net.minecraft.server.v1_12_R1.BiomeBase;
import net.minecraft.server.v1_12_R1.Block; import net.minecraft.server.v1_12_R1.Block;
import net.minecraft.server.v1_12_R1.IBlockData; import net.minecraft.server.v1_12_R1.IBlockData;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
public class RealBiome public class RealBiome
{ {
@ -30,7 +30,7 @@ public class RealBiome
public String toString() public String toString()
{ {
return F.capitalizeWords(b.toString().toLowerCase().replaceAll("\\Q_\\E", " ")) + " Temp: " + temperature + " Humidity: " + humidity + " Height: " + height + " Surf: " + F.capitalizeWords(surface.material.toString().replaceAll("_", " ").toLowerCase())+ " Dirt: " + F.capitalizeWords(dirt.material.toString().replaceAll("_", " ").toLowerCase()); return Form.capitalizeWords(b.toString().toLowerCase().replaceAll("\\Q_\\E", " ")) + " Temp: " + temperature + " Humidity: " + humidity + " Height: " + height + " Surf: " + Form.capitalizeWords(surface.material.toString().replaceAll("_", " ").toLowerCase())+ " Dirt: " + Form.capitalizeWords(dirt.material.toString().replaceAll("_", " ").toLowerCase());
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")

View File

@ -6,8 +6,8 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
import ninja.bytecode.shuriken.format.F; import ninja.bytecode.shuriken.format.Form;
/** /**
* Vector utilities * Vector utilities
@ -286,7 +286,7 @@ public class VectorMath
private static double round(double value, int precision) private static double round(double value, int precision)
{ {
return Double.valueOf(F.f(value, precision)); return Double.valueOf(Form.f(value, precision));
} }
public static Vector clip(Vector v, int decimals) public static Vector clip(Vector v, int decimals)
@ -323,9 +323,9 @@ public class VectorMath
* the block face * the block face
* @return multiple faces, or one if the face is already simple * @return multiple faces, or one if the face is already simple
*/ */
public static GList<BlockFace> split(BlockFace f) public static KList<BlockFace> split(BlockFace f)
{ {
GList<BlockFace> faces = new GList<BlockFace>(); KList<BlockFace> faces = new KList<BlockFace>();
switch(f) switch(f)
{ {
@ -527,9 +527,9 @@ public class VectorMath
* the vectors to be shifted * the vectors to be shifted
* @return the shifted vectors * @return the shifted vectors
*/ */
public static GList<Vector> shift(Vector vector, GList<Vector> vectors) public static KList<Vector> shift(Vector vector, KList<Vector> vectors)
{ {
return new GList<Vector>(new GListAdapter<Vector, Vector>() return new KList<Vector>(new GListAdapter<Vector, Vector>()
{ {
@Override @Override
public Vector onAdapt(Vector from) public Vector onAdapt(Vector from)

View File

@ -3,7 +3,7 @@ package ninja.bytecode.iris.util;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import ninja.bytecode.shuriken.collections.GList; import ninja.bytecode.shuriken.collections.KList;
public interface VisualEffect public interface VisualEffect
{ {
@ -13,5 +13,5 @@ public interface VisualEffect
public void play(Location l, Player p); public void play(Location l, Player p);
public void play(Location l, GList<Player> p); public void play(Location l, KList<Player> p);
} }

View File

@ -13,14 +13,14 @@ import org.bukkit.event.Listener;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.Iris;
import ninja.bytecode.shuriken.collections.GMap; import ninja.bytecode.shuriken.collections.KMap;
import ninja.bytecode.shuriken.io.CustomOutputStream; import ninja.bytecode.shuriken.io.CustomOutputStream;
import ninja.bytecode.shuriken.logging.L; import ninja.bytecode.shuriken.logging.L;
public class WorldState implements Listener public class WorldState implements Listener
{ {
private int taskId; private int taskId;
private GMap<MCAPos, MCAState> stateCache; private KMap<MCAPos, MCAState> stateCache;
private World world; private World world;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")