mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 11:09:06 +00:00
Massive enhancements
This commit is contained in:
@@ -10,8 +10,10 @@ import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import ninja.bytecode.iris.controller.TimingsController;
|
||||
import ninja.bytecode.iris.controller.WorldController;
|
||||
import ninja.bytecode.iris.generator.IrisGenerator;
|
||||
import ninja.bytecode.iris.spec.IrisBiome;
|
||||
import ninja.bytecode.iris.pack.IrisBiome;
|
||||
import ninja.bytecode.shuriken.format.F;
|
||||
|
||||
public class CommandIris implements CommandExecutor
|
||||
@@ -28,7 +30,7 @@ public class CommandIris implements CommandExecutor
|
||||
{
|
||||
msg(sender, "/iris timings - Iris Timings");
|
||||
msg(sender, "/iris rtp [biome] - RTP to a biome");
|
||||
msg(sender, "/iris gen - Gen a new Iris World");
|
||||
msg(sender, "/iris reload - Reload & Recompile");
|
||||
msg(sender, "/ish - Iris Schematic Commands");
|
||||
}
|
||||
|
||||
@@ -36,8 +38,8 @@ public class CommandIris implements CommandExecutor
|
||||
{
|
||||
if(args[0].equalsIgnoreCase("timings"))
|
||||
{
|
||||
double t = Iris.profiler.getResult("terrain").getAverage();
|
||||
double d = Iris.profiler.getResult("decor").getAverage();
|
||||
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));
|
||||
@@ -104,23 +106,10 @@ public class CommandIris implements CommandExecutor
|
||||
}
|
||||
}
|
||||
|
||||
if(args[0].equalsIgnoreCase("gen"))
|
||||
if(args[0].equalsIgnoreCase("reload"))
|
||||
{
|
||||
if(sender instanceof Player)
|
||||
{
|
||||
World wold = ((Player) sender).getWorld();
|
||||
World w = Iris.instance.createIrisWorld();
|
||||
((Player) sender).teleport(new Location(w, 0, 256, 0));
|
||||
((Player) sender).setFlying(true);
|
||||
((Player) sender).setGameMode(GameMode.CREATIVE);
|
||||
wold.setAutoSave(false);
|
||||
Bukkit.unloadWorld(wold, false);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Iris.instance.createIrisWorld();
|
||||
}
|
||||
msg(sender, "Reloading Iris...");
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(Iris.instance, () -> Iris.instance.reload());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user