mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
K
This commit is contained in:
parent
ea71474b62
commit
64674026a6
2
pom.xml
2
pom.xml
@ -151,7 +151,7 @@
|
||||
<dependency>
|
||||
<groupId>ninja.bytecode</groupId>
|
||||
<artifactId>Shuriken</artifactId>
|
||||
<version>1.0.3</version>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
|
@ -22,10 +22,10 @@ import ninja.bytecode.iris.generator.genobject.PlacedObject;
|
||||
import ninja.bytecode.iris.pack.CompiledDimension;
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
import ninja.bytecode.iris.util.BiomeLayer;
|
||||
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.execution.ChronoLatch;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
import ninja.bytecode.shuriken.logging.L;
|
||||
|
||||
public class CommandIris implements CommandExecutor
|
||||
@ -92,15 +92,15 @@ public class CommandIris implements CommandExecutor
|
||||
|
||||
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
|
||||
{
|
||||
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 ===");
|
||||
PackController c = Iris.getController(PackController.class);
|
||||
GMap<String, String> f = new GMap<>();
|
||||
KMap<String, String> f = new KMap<>();
|
||||
|
||||
for(World i : Bukkit.getWorlds())
|
||||
{
|
||||
@ -261,7 +261,7 @@ public class CommandIris implements CommandExecutor
|
||||
|
||||
if(msg.contains("|"))
|
||||
{
|
||||
GList<String> fx = new GList<>();
|
||||
KList<String> fx = new KList<>();
|
||||
fx.add(msg.split("\\Q|\\E"));
|
||||
fx.remove(0);
|
||||
fx.remove(0);
|
||||
@ -290,7 +290,7 @@ public class CommandIris implements CommandExecutor
|
||||
{
|
||||
if(cl.flip())
|
||||
{
|
||||
msg(p, "Regenerating " + F.pc(pct));
|
||||
msg(p, "Regenerating " + Form.pc(pct));
|
||||
}
|
||||
}, () ->
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ import ninja.bytecode.iris.generator.genobject.GenObject;
|
||||
import ninja.bytecode.iris.util.Cuboid;
|
||||
import ninja.bytecode.iris.util.Cuboid.CuboidDirection;
|
||||
import ninja.bytecode.iris.util.Direction;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
|
||||
public class CommandIsh implements CommandExecutor
|
||||
{
|
||||
@ -74,7 +74,7 @@ public class CommandIsh implements CommandExecutor
|
||||
{
|
||||
FileOutputStream fos = new FileOutputStream(f);
|
||||
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);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ public class CommandIsh implements CommandExecutor
|
||||
|
||||
WandController.pasteSchematic(s, at);
|
||||
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)
|
||||
|
@ -8,9 +8,9 @@ import mortar.compute.math.M;
|
||||
import mortar.util.text.C;
|
||||
import ninja.bytecode.iris.controller.ExecutionController;
|
||||
import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
import ninja.bytecode.shuriken.collections.KMap;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
import ninja.bytecode.shuriken.math.RollingSequence;
|
||||
|
||||
public class IrisMetrics
|
||||
@ -18,54 +18,54 @@ public class IrisMetrics
|
||||
private int size;
|
||||
private int generators;
|
||||
private double scale;
|
||||
private GMap<String, RollingSequence> sequences;
|
||||
private KMap<String, RollingSequence> sequences;
|
||||
|
||||
public IrisMetrics(int generators, int size)
|
||||
{
|
||||
scale = 1;
|
||||
this.size = size;
|
||||
this.generators = generators;
|
||||
sequences = new GMap<>();
|
||||
sequences = new KMap<>();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return F.f(get(s).getAverage(), dec);
|
||||
return Form.f(get(s).getAverage(), 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)
|
||||
{
|
||||
return F.f(get(s).getMax(), dec);
|
||||
return Form.f(get(s).getMax(), 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)
|
||||
{
|
||||
return F.f(get(s).getMin(), dec);
|
||||
return Form.f(get(s).getMin(), 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)
|
||||
{
|
||||
return F.f(get(s).getMedian(), dec);
|
||||
return Form.f(get(s).getMedian(), dec);
|
||||
}
|
||||
|
||||
public RollingSequence get(String s)
|
||||
@ -108,12 +108,12 @@ public class IrisMetrics
|
||||
this.generators = generators;
|
||||
}
|
||||
|
||||
public GMap<String, RollingSequence> getSequences()
|
||||
public KMap<String, RollingSequence> getSequences()
|
||||
{
|
||||
return sequences;
|
||||
}
|
||||
|
||||
public void setSequences(GMap<String, RollingSequence> sequences)
|
||||
public void setSequences(KMap<String, RollingSequence> sequences)
|
||||
{
|
||||
this.sequences = sequences;
|
||||
}
|
||||
@ -130,11 +130,11 @@ public class IrisMetrics
|
||||
|
||||
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())
|
||||
{
|
||||
GList<String> o = new GList<>();
|
||||
KList<String> o = new KList<>();
|
||||
|
||||
if(i.contains(":"))
|
||||
{
|
||||
@ -208,24 +208,24 @@ public class IrisMetrics
|
||||
comma = true;
|
||||
}
|
||||
|
||||
String af = ms ? F.duration(vmin, dot) : comma ? F.f((int) vmin) : F.f(vmin, dot);
|
||||
String bf = ms ? F.duration(vmed, dot) : comma ? F.f((int) vmed) : F.f(vmed, dot);
|
||||
String cf = ms ? F.duration(vavg, dot) : comma ? F.f((int) vavg) : F.f(vavg, dot);
|
||||
String df = ms ? F.duration(vmax, dot) : comma ? F.f((int) vmax) : F.f(vmax, dot);
|
||||
String af = ms ? Form.duration(vmin, dot) : comma ? Form.f((int) vmin) : Form.f(vmin, dot);
|
||||
String bf = ms ? Form.duration(vmed, dot) : comma ? Form.f((int) vmed) : Form.f(vmed, dot);
|
||||
String cf = ms ? Form.duration(vavg, dot) : comma ? Form.f((int) vavg) : Form.f(vavg, 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 + ")");
|
||||
}
|
||||
|
||||
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 + "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 + "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 + Form.pc(scale) + C.WHITE + C.BOLD + " Threads: " + C.RESET + C.BLUE + C.ITALIC + Iris.getController(ExecutionController.class).getTC());
|
||||
}
|
||||
|
||||
for(String i : out.k())
|
||||
{
|
||||
String g = F.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));
|
||||
String g = Form.capitalizeWords(i.replaceAll("\\Q-\\E", " ").toLowerCase());
|
||||
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);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import ninja.bytecode.iris.controller.TimingsController;
|
||||
import ninja.bytecode.iris.controller.WorldController;
|
||||
import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
|
||||
public class CommandIris implements CommandExecutor
|
||||
{
|
||||
@ -41,9 +41,9 @@ public class CommandIris implements CommandExecutor
|
||||
{
|
||||
double t = Iris.getController(TimingsController.class).getResult("terrain");
|
||||
double d = Iris.getController(TimingsController.class).getResult("decor");
|
||||
msg(sender, "Generation: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(t + d, 2));
|
||||
msg(sender, " \\Terrain: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(t, 2));
|
||||
msg(sender, " \\Decor: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(d, 2));
|
||||
msg(sender, "Generation: " + ChatColor.BOLD + ChatColor.WHITE + Form.duration(t + d, 2));
|
||||
msg(sender, " \\Terrain: " + ChatColor.BOLD + ChatColor.WHITE + Form.duration(t, 2));
|
||||
msg(sender, " \\Decor: " + ChatColor.BOLD + ChatColor.WHITE + Form.duration(d, 2));
|
||||
}
|
||||
|
||||
if(args[0].equalsIgnoreCase("rtp"))
|
||||
|
@ -21,7 +21,7 @@ import ninja.bytecode.iris.generator.genobject.GenObject;
|
||||
import ninja.bytecode.iris.util.Cuboid;
|
||||
import ninja.bytecode.iris.util.Cuboid.CuboidDirection;
|
||||
import ninja.bytecode.iris.util.Direction;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
|
||||
public class CommandIsh implements CommandExecutor
|
||||
{
|
||||
@ -74,7 +74,7 @@ public class CommandIsh implements CommandExecutor
|
||||
{
|
||||
FileOutputStream fos = new FileOutputStream(f);
|
||||
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);
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public class CommandIsh implements CommandExecutor
|
||||
|
||||
WandController.pasteSchematic(s, at);
|
||||
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)
|
||||
|
@ -12,8 +12,8 @@ import mortar.util.text.C;
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.util.IrisController;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GSet;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
import ninja.bytecode.shuriken.collections.KSet;
|
||||
import ninja.bytecode.shuriken.execution.J;
|
||||
|
||||
public class DebugController implements IrisController
|
||||
@ -39,8 +39,8 @@ public class DebugController implements IrisController
|
||||
{
|
||||
if(Iris.settings.performance.debugMode)
|
||||
{
|
||||
GSet<String> ws = new GSet<>();
|
||||
GList<World> destroy = new GList<>();
|
||||
KSet<String> ws = new KSet<>();
|
||||
KList<World> destroy = new KList<>();
|
||||
|
||||
for(World i : Bukkit.getWorlds())
|
||||
{
|
||||
|
@ -4,17 +4,17 @@ import org.bukkit.World;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.util.IrisController;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.collections.KMap;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
||||
|
||||
public class ExecutionController implements IrisController
|
||||
{
|
||||
GMap<String, TaskExecutor> executors;
|
||||
KMap<String, TaskExecutor> executors;
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
executors = new GMap<>();
|
||||
executors = new KMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -15,10 +15,10 @@ import ninja.bytecode.iris.pack.IrisDimension;
|
||||
import ninja.bytecode.iris.pack.IrisPack;
|
||||
import ninja.bytecode.iris.util.IrisController;
|
||||
import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
|
||||
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.execution.J;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
import ninja.bytecode.shuriken.io.IO;
|
||||
import ninja.bytecode.shuriken.json.JSONException;
|
||||
import ninja.bytecode.shuriken.json.JSONObject;
|
||||
@ -26,19 +26,19 @@ import ninja.bytecode.shuriken.logging.L;
|
||||
|
||||
public class PackController implements IrisController
|
||||
{
|
||||
private GMap<String, CompiledDimension> compiledDimensions;
|
||||
private GMap<String, IrisDimension> dimensions;
|
||||
private GMap<String, IrisBiome> biomes;
|
||||
private GMap<String, GenObjectGroup> genObjectGroups;
|
||||
private KMap<String, CompiledDimension> compiledDimensions;
|
||||
private KMap<String, IrisDimension> dimensions;
|
||||
private KMap<String, IrisBiome> biomes;
|
||||
private KMap<String, GenObjectGroup> genObjectGroups;
|
||||
private boolean ready;
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
compiledDimensions = new GMap<>();
|
||||
dimensions = new GMap<>();
|
||||
biomes = new GMap<>();
|
||||
genObjectGroups = new GMap<>();
|
||||
compiledDimensions = new KMap<>();
|
||||
dimensions = new KMap<>();
|
||||
biomes = new KMap<>();
|
||||
genObjectGroups = new KMap<>();
|
||||
ready = false;
|
||||
}
|
||||
|
||||
@ -53,9 +53,9 @@ public class PackController implements IrisController
|
||||
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())
|
||||
{
|
||||
@ -83,9 +83,9 @@ public class PackController implements IrisController
|
||||
|
||||
public void compile()
|
||||
{
|
||||
dimensions = new GMap<>();
|
||||
biomes = new GMap<>();
|
||||
genObjectGroups = new GMap<>();
|
||||
dimensions = new KMap<>();
|
||||
biomes = new KMap<>();
|
||||
genObjectGroups = new KMap<>();
|
||||
ready = false;
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
File dims = new File(Iris.instance.getDataFolder(), "dimensions");
|
||||
@ -117,7 +117,7 @@ public class PackController implements IrisController
|
||||
for(IrisBiome j : id.getBiomes())
|
||||
{
|
||||
d.registerBiome(j);
|
||||
GList<String> g = j.getSchematicGroups().k();
|
||||
KList<String> g = j.getSchematicGroups().k();
|
||||
g.sort();
|
||||
|
||||
for(String k : g)
|
||||
@ -152,13 +152,13 @@ public class PackController implements IrisController
|
||||
CompiledDimension d = compiledDimensions.get(i);
|
||||
d.computeObjectSize();
|
||||
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 + " Objects: " + ChatColor.GRAY + F.f(d.countObjects()));
|
||||
L.i(ChatColor.DARK_GREEN + " Biomes: " + ChatColor.GRAY + Form.f(d.getBiomes().size()));
|
||||
L.i(ChatColor.DARK_GREEN + " Objects: " + ChatColor.GRAY + Form.f(d.countObjects()));
|
||||
L.flush();
|
||||
}
|
||||
|
||||
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("");
|
||||
L.flush();
|
||||
@ -166,22 +166,22 @@ public class PackController implements IrisController
|
||||
ready = true;
|
||||
}
|
||||
|
||||
public GMap<String, CompiledDimension> getCompiledDimensions()
|
||||
public KMap<String, CompiledDimension> getCompiledDimensions()
|
||||
{
|
||||
return compiledDimensions;
|
||||
}
|
||||
|
||||
public GMap<String, IrisDimension> getDimensions()
|
||||
public KMap<String, IrisDimension> getDimensions()
|
||||
{
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
public GMap<String, IrisBiome> getBiomes()
|
||||
public KMap<String, IrisBiome> getBiomes()
|
||||
{
|
||||
return biomes;
|
||||
}
|
||||
|
||||
public GMap<String, GenObjectGroup> getGenObjectGroups()
|
||||
public KMap<String, GenObjectGroup> getGenObjectGroups()
|
||||
{
|
||||
return genObjectGroups;
|
||||
}
|
||||
|
@ -34,20 +34,20 @@ import ninja.bytecode.iris.util.IrisController;
|
||||
import ninja.bytecode.iris.util.MB;
|
||||
import ninja.bytecode.iris.util.ParticleEffect;
|
||||
import ninja.bytecode.iris.util.ParticleRedstone;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
import ninja.bytecode.shuriken.collections.KMap;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
|
||||
public class WandController implements IrisController
|
||||
{
|
||||
private GMap<String, GenObject> goc;
|
||||
private GMap<String, GenObjectGroup> gog;
|
||||
private KMap<String, GenObject> goc;
|
||||
private KMap<String, GenObjectGroup> gog;
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
goc = new GMap<>();
|
||||
gog = new GMap<>();
|
||||
goc = new KMap<>();
|
||||
gog = new KMap<>();
|
||||
// TODO: Optimize
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, () ->
|
||||
{
|
||||
@ -211,7 +211,7 @@ public class WandController implements IrisController
|
||||
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))
|
||||
{
|
||||
@ -220,12 +220,12 @@ public class WandController implements IrisController
|
||||
|
||||
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
|
||||
{
|
||||
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);
|
||||
@ -244,7 +244,7 @@ public class WandController implements IrisController
|
||||
}
|
||||
|
||||
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)
|
||||
@ -252,7 +252,7 @@ public class WandController implements IrisController
|
||||
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())
|
||||
{
|
||||
@ -397,7 +397,7 @@ public class WandController implements IrisController
|
||||
im.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Wand of Iris");
|
||||
im.setUnbreakable(true);
|
||||
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);
|
||||
|
||||
return is;
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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")
|
||||
|
@ -17,8 +17,8 @@ import ninja.bytecode.iris.generator.genobject.GenObject;
|
||||
import ninja.bytecode.iris.generator.genobject.GenObjectGroup;
|
||||
import ninja.bytecode.iris.util.SChunkVector;
|
||||
import ninja.bytecode.iris.util.SBlockVector;
|
||||
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.json.JSONObject;
|
||||
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);
|
||||
private IrisDimension dimension;
|
||||
private GList<IrisBiome> biomes;
|
||||
private GMap<String, IrisBiome> biomeCache;
|
||||
private GMap<String, GenObjectGroup> objects;
|
||||
private KList<IrisBiome> biomes;
|
||||
private KMap<String, IrisBiome> biomeCache;
|
||||
private KMap<String, GenObjectGroup> objects;
|
||||
private SBlockVector maxSize;
|
||||
private SChunkVector maxChunkSize;
|
||||
|
||||
public CompiledDimension(IrisDimension dimension)
|
||||
{
|
||||
this.dimension = dimension;
|
||||
biomes = new GList<>();
|
||||
biomeCache = new GMap<>();
|
||||
objects = new GMap<>();
|
||||
biomes = new KList<>();
|
||||
biomeCache = new KMap<>();
|
||||
objects = new KMap<>();
|
||||
maxSize = new SBlockVector(0, 0, 0);
|
||||
maxChunkSize = new SChunkVector(0, 0);
|
||||
}
|
||||
@ -132,7 +132,7 @@ public class CompiledDimension
|
||||
return dimension.getName();
|
||||
}
|
||||
|
||||
public GList<IrisBiome> getBiomes()
|
||||
public KList<IrisBiome> getBiomes()
|
||||
{
|
||||
return biomes;
|
||||
}
|
||||
@ -222,12 +222,12 @@ public class CompiledDimension
|
||||
return dimension;
|
||||
}
|
||||
|
||||
public GMap<String, IrisBiome> getBiomeCache()
|
||||
public KMap<String, IrisBiome> getBiomeCache()
|
||||
{
|
||||
return biomeCache;
|
||||
}
|
||||
|
||||
public GMap<String, GenObjectGroup> getObjects()
|
||||
public KMap<String, GenObjectGroup> getObjects()
|
||||
{
|
||||
return objects;
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ import ninja.bytecode.iris.generator.layer.BiomeNoiseGenerator;
|
||||
import ninja.bytecode.iris.util.MB;
|
||||
import ninja.bytecode.iris.util.ObjectMode;
|
||||
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.execution.J;
|
||||
import ninja.bytecode.shuriken.json.JSONArray;
|
||||
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 IDEAL_HEIGHT = 0.138;
|
||||
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 parent;
|
||||
private Biome realBiome;
|
||||
private double height;
|
||||
private GList<MB> rock;
|
||||
private KList<MB> rock;
|
||||
private MB fluid;
|
||||
private int rockDepth;
|
||||
private GList<MB> surface;
|
||||
private GList<MB> dirt;
|
||||
private GMap<MB, Double> scatterChance;
|
||||
private KList<MB> surface;
|
||||
private KList<MB> dirt;
|
||||
private KMap<MB, Double> scatterChance;
|
||||
private boolean scatterSurface;
|
||||
private boolean scatterSurfaceRock;
|
||||
private boolean scatterSurfaceSub;
|
||||
@ -62,7 +62,7 @@ public class IrisBiome
|
||||
private BiomeNoiseGenerator bng;
|
||||
private BiomeType type;
|
||||
private String region;
|
||||
private GMap<String, Double> schematicGroups;
|
||||
private KMap<String, Double> schematicGroups;
|
||||
private PolygonGenerator.EnumPolygonGenerator<MB> poly;
|
||||
private PolygonGenerator.EnumPolygonGenerator<MB> polySub;
|
||||
private PolygonGenerator.EnumPolygonGenerator<MB> polyRock;
|
||||
@ -82,7 +82,7 @@ public class IrisBiome
|
||||
return MIN_HEIGHT;
|
||||
}
|
||||
|
||||
public static GMap<Biome, IrisBiome> getMap()
|
||||
public static KMap<Biome, IrisBiome> getMap()
|
||||
{
|
||||
return map;
|
||||
}
|
||||
@ -140,8 +140,8 @@ public class IrisBiome
|
||||
scatterSurfaceRock = true;
|
||||
simplexScatterSub = false;
|
||||
scatterSurfaceSub = true;
|
||||
scatterChance = new GMap<>();
|
||||
schematicGroups = new GMap<>();
|
||||
scatterChance = new KMap<>();
|
||||
schematicGroups = new KMap<>();
|
||||
//@builder
|
||||
surface(new MB(Material.GRASS))
|
||||
.dirt(new MB(Material.DIRT), new MB(Material.DIRT, 1))
|
||||
@ -277,7 +277,7 @@ public class IrisBiome
|
||||
|
||||
else
|
||||
{
|
||||
schematicGroups = new GMap<>();
|
||||
schematicGroups = new KMap<>();
|
||||
}
|
||||
|
||||
if(chain)
|
||||
@ -329,9 +329,9 @@ public class IrisBiome
|
||||
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++)
|
||||
{
|
||||
@ -341,7 +341,7 @@ public class IrisBiome
|
||||
return mb;
|
||||
}
|
||||
|
||||
private JSONArray mbListToJSON(GList<MB> mbs)
|
||||
private JSONArray mbListToJSON(KList<MB> mbs)
|
||||
{
|
||||
JSONArray ja = new JSONArray();
|
||||
|
||||
@ -359,9 +359,9 @@ public class IrisBiome
|
||||
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++)
|
||||
{
|
||||
@ -372,7 +372,7 @@ public class IrisBiome
|
||||
return mb;
|
||||
}
|
||||
|
||||
private JSONArray scatterToJson(GMap<MB, Double> mbs)
|
||||
private JSONArray scatterToJson(KMap<MB, Double> mbs)
|
||||
{
|
||||
JSONArray ja = new JSONArray();
|
||||
|
||||
@ -384,9 +384,9 @@ public class IrisBiome
|
||||
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++)
|
||||
{
|
||||
@ -397,7 +397,7 @@ public class IrisBiome
|
||||
return mb;
|
||||
}
|
||||
|
||||
private JSONArray strToJson(GMap<String, Double> mbs)
|
||||
private JSONArray strToJson(KMap<String, Double> mbs)
|
||||
{
|
||||
JSONArray ja = new JSONArray();
|
||||
|
||||
@ -409,9 +409,9 @@ public class IrisBiome
|
||||
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())
|
||||
{
|
||||
@ -459,19 +459,19 @@ public class IrisBiome
|
||||
|
||||
public IrisBiome surface(MB... mbs)
|
||||
{
|
||||
surface = new GList<>(mbs);
|
||||
surface = new KList<>(mbs);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IrisBiome dirt(MB... mbs)
|
||||
{
|
||||
dirt = new GList<>(mbs);
|
||||
dirt = new KList<>(mbs);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IrisBiome rock(MB... mbs)
|
||||
{
|
||||
rock = new GList<>(mbs);
|
||||
rock = new KList<>(mbs);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -505,17 +505,17 @@ public class IrisBiome
|
||||
return height;
|
||||
}
|
||||
|
||||
public GList<MB> getSurface()
|
||||
public KList<MB> getSurface()
|
||||
{
|
||||
return surface;
|
||||
}
|
||||
|
||||
public GList<MB> getRock()
|
||||
public KList<MB> getRock()
|
||||
{
|
||||
return rock;
|
||||
}
|
||||
|
||||
public GList<MB> getDirt()
|
||||
public KList<MB> getDirt()
|
||||
{
|
||||
return dirt;
|
||||
}
|
||||
@ -589,7 +589,7 @@ public class IrisBiome
|
||||
return getSurface().getRandom();
|
||||
}
|
||||
|
||||
public GMap<MB, Double> getScatterChance()
|
||||
public KMap<MB, Double> getScatterChance()
|
||||
{
|
||||
return scatterChance;
|
||||
}
|
||||
@ -607,7 +607,7 @@ public class IrisBiome
|
||||
return MB.of(Material.AIR);
|
||||
}
|
||||
|
||||
public static GList<IrisBiome> getBiomes()
|
||||
public static KList<IrisBiome> getBiomes()
|
||||
{
|
||||
return map.v();
|
||||
}
|
||||
@ -622,7 +622,7 @@ public class IrisBiome
|
||||
return null;
|
||||
}
|
||||
|
||||
public GMap<String, Double> getSchematicGroups()
|
||||
public KMap<String, Double> getSchematicGroups()
|
||||
{
|
||||
return schematicGroups;
|
||||
}
|
||||
@ -690,9 +690,9 @@ public class IrisBiome
|
||||
return parent;
|
||||
}
|
||||
|
||||
public GList<String> getParents()
|
||||
public KList<String> getParents()
|
||||
{
|
||||
GList<String> f = new GList<>();
|
||||
KList<String> f = new KList<>();
|
||||
|
||||
if(getParent().trim().isEmpty())
|
||||
{
|
||||
@ -815,7 +815,7 @@ public class IrisBiome
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public void setRock(GList<MB> rock)
|
||||
public void setRock(KList<MB> rock)
|
||||
{
|
||||
this.rock = rock;
|
||||
}
|
||||
@ -825,17 +825,17 @@ public class IrisBiome
|
||||
this.rockDepth = rockDepth;
|
||||
}
|
||||
|
||||
public void setSurface(GList<MB> surface)
|
||||
public void setSurface(KList<MB> surface)
|
||||
{
|
||||
this.surface = surface;
|
||||
}
|
||||
|
||||
public void setDirt(GList<MB> dirt)
|
||||
public void setDirt(KList<MB> dirt)
|
||||
{
|
||||
this.dirt = dirt;
|
||||
}
|
||||
|
||||
public void setScatterChance(GMap<MB, Double> scatterChance)
|
||||
public void setScatterChance(KMap<MB, Double> scatterChance)
|
||||
{
|
||||
this.scatterChance = scatterChance;
|
||||
}
|
||||
@ -925,7 +925,7 @@ public class IrisBiome
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public void setSchematicGroups(GMap<String, Double> schematicGroups)
|
||||
public void setSchematicGroups(KMap<String, Double> schematicGroups)
|
||||
{
|
||||
this.schematicGroups = schematicGroups;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.World.Environment;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
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.json.JSONArray;
|
||||
import ninja.bytecode.shuriken.json.JSONException;
|
||||
@ -16,7 +16,7 @@ public class IrisDimension
|
||||
{
|
||||
private String name;
|
||||
private Environment environment;
|
||||
GList<IrisBiome> biomes;
|
||||
KList<IrisBiome> biomes;
|
||||
|
||||
public IrisDimension(JSONObject o) throws JSONException, IOException
|
||||
{
|
||||
@ -26,7 +26,7 @@ public class IrisDimension
|
||||
|
||||
public IrisDimension()
|
||||
{
|
||||
biomes = new GList<IrisBiome>();
|
||||
biomes = new KList<IrisBiome>();
|
||||
environment = Environment.NORMAL;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public class IrisDimension
|
||||
|
||||
try
|
||||
{
|
||||
biomes = chain ? biomesFromArray(o.getJSONArray("biomes")) : new GList<>();
|
||||
biomes = chain ? biomesFromArray(o.getJSONArray("biomes")) : new KList<>();
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
@ -62,9 +62,9 @@ public class IrisDimension
|
||||
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++)
|
||||
{
|
||||
int ii = i;
|
||||
@ -76,7 +76,7 @@ public class IrisDimension
|
||||
return b;
|
||||
}
|
||||
|
||||
private JSONArray biomesToArray(GList<IrisBiome> b)
|
||||
private JSONArray biomesToArray(KList<IrisBiome> b)
|
||||
{
|
||||
JSONArray a = new JSONArray();
|
||||
|
||||
@ -88,7 +88,7 @@ public class IrisDimension
|
||||
return a;
|
||||
}
|
||||
|
||||
public GList<IrisBiome> getBiomes()
|
||||
public KList<IrisBiome> getBiomes()
|
||||
{
|
||||
return biomes;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import java.io.IOException;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
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.json.JSONArray;
|
||||
import ninja.bytecode.shuriken.json.JSONException;
|
||||
@ -12,15 +12,15 @@ import ninja.bytecode.shuriken.json.JSONObject;
|
||||
|
||||
public class IrisPack
|
||||
{
|
||||
private GList<String> dimensions;
|
||||
private GList<String> biomes;
|
||||
private GList<String> objects;
|
||||
private KList<String> dimensions;
|
||||
private KList<String> biomes;
|
||||
private KList<String> objects;
|
||||
|
||||
public IrisPack()
|
||||
{
|
||||
this.dimensions = new GList<>();
|
||||
this.biomes = new GList<>();
|
||||
this.objects = new GList<>();
|
||||
this.dimensions = new KList<>();
|
||||
this.biomes = new KList<>();
|
||||
this.objects = new KList<>();
|
||||
}
|
||||
|
||||
public IrisPack(JSONObject o)
|
||||
@ -46,9 +46,9 @@ public class IrisPack
|
||||
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++)
|
||||
{
|
||||
@ -58,7 +58,7 @@ public class IrisPack
|
||||
return g;
|
||||
}
|
||||
|
||||
public JSONArray toArray(GList<String> s)
|
||||
public JSONArray toArray(KList<String> s)
|
||||
{
|
||||
JSONArray ja = new JSONArray();
|
||||
|
||||
|
@ -4,14 +4,14 @@ import java.util.Objects;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
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.json.JSONObject;
|
||||
|
||||
public class IrisRegion
|
||||
{
|
||||
private String name;
|
||||
private GList<IrisBiome> biomes;
|
||||
private KList<IrisBiome> biomes;
|
||||
private IrisBiome ocean;
|
||||
private IrisBiome lake;
|
||||
private IrisBiome lakeBeach;
|
||||
@ -21,7 +21,7 @@ public class IrisRegion
|
||||
public IrisRegion(String name)
|
||||
{
|
||||
this.name = name;
|
||||
this.biomes = new GList<>();
|
||||
this.biomes = new KList<>();
|
||||
beach = null;
|
||||
ocean = null;
|
||||
lake = null;
|
||||
@ -53,12 +53,12 @@ public class IrisRegion
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public GList<IrisBiome> getBiomes()
|
||||
public KList<IrisBiome> getBiomes()
|
||||
{
|
||||
return biomes;
|
||||
}
|
||||
|
||||
public void setBiomes(GList<IrisBiome> biomes)
|
||||
public void setBiomes(KList<IrisBiome> biomes)
|
||||
{
|
||||
this.biomes = biomes;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.pack.BiomeType;
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
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.math.CNG;
|
||||
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())
|
||||
{
|
||||
|
@ -1,21 +1,21 @@
|
||||
package ninja.bytecode.iris.util;
|
||||
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.collections.KMap;
|
||||
|
||||
public class ChunkPlan
|
||||
{
|
||||
private final GMap<SChunkVector, Integer> realHeightCache;
|
||||
private final GMap<SChunkVector, Integer> realWaterHeightCache;
|
||||
private final GMap<SChunkVector, Double> heightCache;
|
||||
private final GMap<SChunkVector, IrisBiome> biomeCache;
|
||||
private final KMap<SChunkVector, Integer> realHeightCache;
|
||||
private final KMap<SChunkVector, Integer> realWaterHeightCache;
|
||||
private final KMap<SChunkVector, Double> heightCache;
|
||||
private final KMap<SChunkVector, IrisBiome> biomeCache;
|
||||
|
||||
public ChunkPlan()
|
||||
{
|
||||
this.realHeightCache = new GMap<>();
|
||||
this.realWaterHeightCache = new GMap<>();
|
||||
this.heightCache = new GMap<>();
|
||||
this.biomeCache = new GMap<>();
|
||||
this.realHeightCache = new KMap<>();
|
||||
this.realWaterHeightCache = new KMap<>();
|
||||
this.heightCache = new KMap<>();
|
||||
this.biomeCache = new KMap<>();
|
||||
}
|
||||
|
||||
public IrisBiome getBiome(int x, int z)
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
|
||||
/**
|
||||
* Cuboids
|
||||
@ -55,9 +55,9 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
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
|
||||
public LivingEntity onAdapt(Entity from)
|
||||
@ -72,9 +72,9 @@ public class Cuboid implements Iterable<Block>, Cloneable, ConfigurationSerializ
|
||||
}.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())
|
||||
{
|
||||
|
@ -5,8 +5,8 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import ninja.bytecode.iris.util.Cuboid.CuboidDirection;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
import ninja.bytecode.shuriken.collections.KMap;
|
||||
|
||||
/**
|
||||
* Directions
|
||||
@ -22,7 +22,7 @@ public enum Direction
|
||||
E(1, 0, 0, CuboidDirection.East),
|
||||
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 y;
|
||||
@ -143,7 +143,7 @@ public enum Direction
|
||||
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;
|
||||
Direction s = null;
|
||||
@ -249,9 +249,9 @@ public enum Direction
|
||||
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)
|
||||
@ -269,9 +269,9 @@ public enum Direction
|
||||
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;
|
||||
}
|
||||
|
||||
permute = new GMap<GBiset<Direction, Direction>, DOP>();
|
||||
permute = new KMap<GBiset<Direction, Direction>, DOP>();
|
||||
|
||||
for(Direction i : udnews())
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ package ninja.bytecode.iris.util;
|
||||
|
||||
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
|
||||
@ -25,7 +25,7 @@ public abstract class GListAdapter<FROM, TO>
|
||||
*/
|
||||
public List<TO> adapt(List<FROM> from)
|
||||
{
|
||||
List<TO> adapted = new GList<TO>();
|
||||
List<TO> adapted = new KList<TO>();
|
||||
|
||||
for(FROM i : from)
|
||||
{
|
||||
|
@ -7,17 +7,17 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
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.tools.JarScanner;
|
||||
|
||||
public class IrisControllerSet
|
||||
{
|
||||
private GMap<Class<?>, IrisController> controllers;
|
||||
private KMap<Class<?>, IrisController> controllers;
|
||||
|
||||
public IrisControllerSet()
|
||||
{
|
||||
controllers = new GMap<>();
|
||||
controllers = new KMap<>();
|
||||
}
|
||||
|
||||
public void startControllers(File jar) throws IOException
|
||||
|
@ -11,8 +11,8 @@ import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.generator.atomics.AtomicChunkData;
|
||||
import ninja.bytecode.iris.generator.atomics.AtomicRegionData;
|
||||
import ninja.bytecode.iris.generator.atomics.AtomicWorldData;
|
||||
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;
|
||||
|
||||
public class IrisWorldData
|
||||
@ -20,14 +20,14 @@ public class IrisWorldData
|
||||
private final World world;
|
||||
private final AtomicWorldData data;
|
||||
private boolean saving;
|
||||
private final GMap<SMCAVector, AtomicChunkData> loadedChunks;
|
||||
private final KMap<SMCAVector, AtomicChunkData> loadedChunks;
|
||||
|
||||
public IrisWorldData(World world)
|
||||
{
|
||||
this.world = world;
|
||||
saving = true;
|
||||
data = new AtomicWorldData(world);
|
||||
loadedChunks = new GMap<>();
|
||||
loadedChunks = new KMap<>();
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, this::softUnloadWorld, 200, 20);
|
||||
}
|
||||
|
||||
@ -232,12 +232,12 @@ public class IrisWorldData
|
||||
return false;
|
||||
}
|
||||
|
||||
public GList<SMCAVector> getLoadedChunks()
|
||||
public KList<SMCAVector> getLoadedChunks()
|
||||
{
|
||||
return loadedChunks.k();
|
||||
}
|
||||
|
||||
public GList<SMCAVector> getLoadedRegions()
|
||||
public KList<SMCAVector> getLoadedRegions()
|
||||
{
|
||||
return data.getLoadedRegions();
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package ninja.bytecode.iris.util;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
|
||||
public abstract class ParticleBase implements VisualEffect
|
||||
{
|
||||
@ -20,7 +20,7 @@ public abstract class ParticleBase implements VisualEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public void play(Location l, GList<Player> p)
|
||||
public void play(Location l, KList<Player> p)
|
||||
{
|
||||
for(Player i : p)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.block.Biome;
|
||||
import net.minecraft.server.v1_12_R1.BiomeBase;
|
||||
import net.minecraft.server.v1_12_R1.Block;
|
||||
import net.minecraft.server.v1_12_R1.IBlockData;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
|
||||
public class RealBiome
|
||||
{
|
||||
@ -30,7 +30,7 @@ public class RealBiome
|
||||
|
||||
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")
|
||||
|
@ -6,8 +6,8 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
import ninja.bytecode.shuriken.format.Form;
|
||||
|
||||
/**
|
||||
* Vector utilities
|
||||
@ -286,7 +286,7 @@ public class VectorMath
|
||||
|
||||
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)
|
||||
@ -323,9 +323,9 @@ public class VectorMath
|
||||
* the block face
|
||||
* @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)
|
||||
{
|
||||
@ -527,9 +527,9 @@ public class VectorMath
|
||||
* the vectors to be shifted
|
||||
* @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
|
||||
public Vector onAdapt(Vector from)
|
||||
|
@ -3,7 +3,7 @@ package ninja.bytecode.iris.util;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.KList;
|
||||
|
||||
public interface VisualEffect
|
||||
{
|
||||
@ -13,5 +13,5 @@ public interface VisualEffect
|
||||
|
||||
public void play(Location l, Player p);
|
||||
|
||||
public void play(Location l, GList<Player> p);
|
||||
public void play(Location l, KList<Player> p);
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ import org.bukkit.event.Listener;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
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.logging.L;
|
||||
|
||||
public class WorldState implements Listener
|
||||
{
|
||||
private int taskId;
|
||||
private GMap<MCAPos, MCAState> stateCache;
|
||||
private KMap<MCAPos, MCAState> stateCache;
|
||||
private World world;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
Loading…
x
Reference in New Issue
Block a user