9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 11:09:06 +00:00
This commit is contained in:
Daniel Mills
2020-01-19 02:45:28 -05:00
parent 1b9c7d48e4
commit 445ce46357
13 changed files with 391 additions and 109 deletions

View File

@@ -9,10 +9,13 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import mortar.api.nms.NMP;
import mortar.util.text.C;
import ninja.bytecode.iris.controller.TimingsController;
import ninja.bytecode.iris.generator.IrisGenerator;
import ninja.bytecode.iris.pack.IrisBiome;
import ninja.bytecode.iris.util.BiomeLayer;
import ninja.bytecode.shuriken.format.F;
import ninja.bytecode.shuriken.logging.L;
public class CommandIris implements CommandExecutor
{
@@ -44,6 +47,46 @@ public class CommandIris implements CommandExecutor
msg(sender, " \\Decor: " + ChatColor.BOLD + ChatColor.WHITE + F.duration(d, 2));
}
if(args[0].equalsIgnoreCase("info"))
{
if(sender instanceof Player)
{
Player p = (Player) sender;
World w = p.getWorld();
if(w.getGenerator() instanceof IrisGenerator)
{
IrisGenerator g = (IrisGenerator) w.getGenerator();
IrisBiome biome = g.getBiome((int) g.getOffsetX(p.getLocation().getX()), (int) g.getOffsetZ(p.getLocation().getZ()));
BiomeLayer l = new BiomeLayer(g, biome);
msg(p, "Biome: " + C.BOLD + C.WHITE + biome.getName() + C.RESET + C.GRAY + " (" + C.GOLD + l.getBiome().getRarityString() + C.GRAY + ")");
for(String i : biome.getSchematicGroups().k())
{
String f = "";
double percent = biome.getSchematicGroups().get(i);
if(percent > 1D)
{
f = (int) percent + " + " + F.pc(percent - (int) percent, percent - (int) percent >= 0.01 ? 0 : 3);
}
else
{
f = F.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)");
}
}
else
{
msg(sender, "Not in an Iris World");
}
}
}
if(args[0].equalsIgnoreCase("rtp"))
{
if(sender instanceof Player)
@@ -118,6 +161,11 @@ public class CommandIris implements CommandExecutor
p.teleport(w.getHighestBlockAt(x, z).getLocation());
}
}
else
{
msg(sender, "Not in an Iris World");
}
}
}