mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
67325fdb79
@ -25,6 +25,7 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.schematic.Schematic;
|
||||
import ninja.bytecode.iris.schematic.SchematicGroup;
|
||||
@ -60,6 +61,7 @@ public class Iris extends JavaPlugin implements Listener
|
||||
|
||||
public void onEnable()
|
||||
{
|
||||
L.consoleConsumer = (s) -> Bukkit.getConsoleSender().sendMessage(s);
|
||||
Direction.calculatePermutations();
|
||||
dimensions = new GMap<>();
|
||||
biomes = new GMap<>();
|
||||
@ -78,12 +80,12 @@ public class Iris extends JavaPlugin implements Listener
|
||||
new WandManager();
|
||||
loadComplete();
|
||||
}
|
||||
|
||||
|
||||
public static void started(String obj)
|
||||
{
|
||||
profiler.start(obj);
|
||||
}
|
||||
|
||||
|
||||
public static void stopped(String obj)
|
||||
{
|
||||
profiler.stop(obj);
|
||||
@ -170,7 +172,7 @@ public class Iris extends JavaPlugin implements Listener
|
||||
m += i.size();
|
||||
}
|
||||
|
||||
L.v("Processing Content");
|
||||
L.v(ChatColor.LIGHT_PURPLE + "Processing Content");
|
||||
|
||||
TaskExecutor exf = new TaskExecutor(settings.performance.compilerThreads, settings.performance.compilerPriority, "Iris Compiler");
|
||||
TaskGroup gg = exf.startWork();
|
||||
@ -180,12 +182,12 @@ public class Iris extends JavaPlugin implements Listener
|
||||
}
|
||||
gg.execute();
|
||||
exf.close();
|
||||
|
||||
L.i("Dimensions: " + dimensions.size());
|
||||
L.i("Biomes: " + biomes.size());
|
||||
L.i("Object Groups: " + schematics.size());
|
||||
L.i("Objects: " + F.f(m));
|
||||
L.i("Compilation Time: " + F.duration(p.getMilliseconds(), 2));
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Dimensions: " + ChatColor.WHITE + dimensions.size());
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Biomes: " + ChatColor.WHITE + biomes.size());
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Object Groups: " + ChatColor.WHITE + F.f(schematics.size()));
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Objects: " + ChatColor.WHITE + F.f(m));
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Compilation Time: " + ChatColor.WHITE + F.duration(p.getMilliseconds(), 2));
|
||||
L.i(ChatColor.GREEN + "Iris Dimensions Successfully Compiled!");
|
||||
L.flush();
|
||||
}
|
||||
|
||||
@ -246,13 +248,11 @@ public class Iris extends JavaPlugin implements Listener
|
||||
|
||||
public static IrisDimension loadDimension(String s) throws JSONException, IOException
|
||||
{
|
||||
L.i("Loading Iris Dimension " + s);
|
||||
return new IrisDimension(loadJSON("pack/dimensions/" + s + ".json"));
|
||||
}
|
||||
|
||||
public static IrisBiome loadBiome(String s) throws JSONException, IOException
|
||||
{
|
||||
L.i("Loading Iris Biome " + s);
|
||||
return new IrisBiome(loadJSON("pack/biomes/" + s + ".json"));
|
||||
}
|
||||
|
||||
@ -263,7 +263,6 @@ public class Iris extends JavaPlugin implements Listener
|
||||
if(g != null)
|
||||
{
|
||||
schematics.put(s, g);
|
||||
L.i("Loaded Object Group: " + g.getName() + " (" + g.getSchematics().size() + " Objects)");
|
||||
return g;
|
||||
}
|
||||
|
||||
@ -274,7 +273,6 @@ public class Iris extends JavaPlugin implements Listener
|
||||
|
||||
public static Schematic loadSchematic(String s) throws IOException
|
||||
{
|
||||
L.i("Loading Iris Object " + s);
|
||||
return Schematic.load(loadResource("pack/objects/" + s + ".ish"));
|
||||
}
|
||||
|
||||
@ -289,11 +287,10 @@ public class Iris extends JavaPlugin implements Listener
|
||||
|
||||
if(internal.exists())
|
||||
{
|
||||
L.v("Loading Group: " + string);
|
||||
return internal;
|
||||
}
|
||||
|
||||
L.f("Cannot find folder: " + internal.getAbsolutePath());
|
||||
L.f(ChatColor.RED + "Cannot find folder: " + internal.getAbsolutePath());
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -303,14 +300,14 @@ public class Iris extends JavaPlugin implements Listener
|
||||
|
||||
if(internal.exists())
|
||||
{
|
||||
L.v("Loading Resource: " + internal.getAbsolutePath());
|
||||
L.v(ChatColor.DARK_PURPLE + "Loading Resource: " + ChatColor.GRAY + internal.getAbsolutePath());
|
||||
L.flush();
|
||||
return new FileInputStream(internal);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
L.f("Cannot find Resource: " + internal.getAbsolutePath());
|
||||
L.f(ChatColor.RED + "Cannot find Resource: " + ChatColor.YELLOW + internal.getAbsolutePath());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class Schematic
|
||||
|
||||
mountHeight = avg(avy);
|
||||
mount = new BlockVector(avg(avx), 0, avg(avz));
|
||||
L.i("Corrected " + getName() + "'s Mount Point: 0,0,0 -> " + mount.getBlockX() + "," + mount.getBlockY() + "," + mount.getBlockZ());
|
||||
}
|
||||
|
||||
private int avg(double[] v)
|
||||
@ -260,7 +259,6 @@ public class Schematic
|
||||
Schematic s = new Schematic(1, 1, 1);
|
||||
s.read(in);
|
||||
|
||||
L.i("Loaded Internal Object: " + s.getSchematic().size());
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -271,7 +269,6 @@ public class Schematic
|
||||
FileInputStream fin = new FileInputStream(f);
|
||||
s.read(fin);
|
||||
|
||||
L.i("Loaded Object: " + f.getPath() + " Size: " + s.getSchematic().size());
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -335,7 +332,6 @@ public class Schematic
|
||||
{
|
||||
int downshift = Integer.valueOf(j.split("\\Q=\\E")[1]);
|
||||
shift.subtract(new Vector(0, downshift, 0));
|
||||
L.i("Corrected " + getName() + "'s Mount Height: 0,0,0 -> " + shift.getBlockX() + "," + shift.getBlockY() + "," + shift.getBlockZ());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,13 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.util.Direction;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
import ninja.bytecode.shuriken.io.IO;
|
||||
import ninja.bytecode.shuriken.logging.L;
|
||||
|
||||
@ -121,8 +123,6 @@ public class SchematicGroup
|
||||
public void processVariants()
|
||||
{
|
||||
GList<Schematic> inject = new GList<>();
|
||||
L.v("Processing " + name + " Objects");
|
||||
L.v("# Creating Rotations for " + getSchematics().size() + " Objects");
|
||||
String x = Thread.currentThread().getName();
|
||||
ReentrantLock rr = new ReentrantLock();
|
||||
TaskExecutor ex = new TaskExecutor(Iris.settings.performance.compilerThreads, Iris.settings.performance.compilerPriority, x + "/Subroutine ");
|
||||
@ -146,7 +146,6 @@ public class SchematicGroup
|
||||
gg.execute();
|
||||
gg = ex.startWork();
|
||||
getSchematics().add(inject);
|
||||
L.v("# Generated " + inject.size() + " Rotated Objects to " + getName());
|
||||
|
||||
for(Schematic i : getSchematics())
|
||||
{
|
||||
@ -162,6 +161,7 @@ public class SchematicGroup
|
||||
|
||||
gg.execute();
|
||||
ex.close();
|
||||
L.i(ChatColor.LIGHT_PURPLE + "Processed " + ChatColor.WHITE + F.f(schematics.size()) + ChatColor.LIGHT_PURPLE + " Schematics in " + ChatColor.WHITE + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,6 @@ import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.execution.J;
|
||||
import ninja.bytecode.shuriken.json.JSONArray;
|
||||
import ninja.bytecode.shuriken.json.JSONObject;
|
||||
import ninja.bytecode.shuriken.logging.L;
|
||||
import ninja.bytecode.shuriken.math.CNG;
|
||||
import ninja.bytecode.shuriken.math.M;
|
||||
import ninja.bytecode.shuriken.math.RNG;
|
||||
@ -170,7 +169,6 @@ public class IrisBiome
|
||||
|
||||
for(String i : schematicGroups.k())
|
||||
{
|
||||
L.v("Loading Object Group: " + i);
|
||||
Iris.loadSchematicGroup(i);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user