|
|
|
@@ -17,7 +17,7 @@ import ca.recrown.islandsurvivalcraft.utilities.datatypes.Point2;
|
|
|
|
|
import ca.recrown.islandsurvivalcraft.world.WorldInfo;
|
|
|
|
|
import ca.recrown.islandsurvivalcraft.world.Information.IslandInformation;
|
|
|
|
|
|
|
|
|
|
public class HighlightCommand implements CommandRunnable {
|
|
|
|
|
public class IslandCommand implements CommandRunnable {
|
|
|
|
|
private IslandSurvivalCraft islandSurvivalCraft;
|
|
|
|
|
private final Particle.DustOptions EDGE_DUST_OPTIONS = new Particle.DustOptions(Color.RED, 1f);
|
|
|
|
|
private final Particle.DustOptions ORIGIN_DUST_OPTIONS = new Particle.DustOptions(Color.LIME, 1.5f);
|
|
|
|
@@ -28,7 +28,7 @@ public class HighlightCommand implements CommandRunnable {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return "Displays particle effects at edge of islands.";
|
|
|
|
|
return "Various debugging information about islands.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@@ -38,10 +38,10 @@ public class HighlightCommand implements CommandRunnable {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
Player player = (Player) sender;
|
|
|
|
|
if (args[0].isEmpty()) {
|
|
|
|
|
if (args.length == 0 || args[0].isEmpty()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (args[0].toLowerCase().equals("start")) {
|
|
|
|
|
if (args[0].toLowerCase().equals("highlight")) {
|
|
|
|
|
if (playersHighlighting.add(player)) {
|
|
|
|
|
sender.sendMessage("You are now highlighting islands.");
|
|
|
|
|
} else {
|
|
|
|
@@ -56,6 +56,9 @@ public class HighlightCommand implements CommandRunnable {
|
|
|
|
|
} else if (args[0].toLowerCase().equals("origin")) {
|
|
|
|
|
Point2 playerLoc = new Point2(player.getLocation().getBlockX(), player.getLocation().getBlockZ());
|
|
|
|
|
sender.sendMessage("Current island's origin point: " + islandSurvivalCraft.getWorldInfoManager().retrieve(player.getWorld().getName()).getIslandInfoManager().getIslandInformation(playerLoc, true).getIslandOrigin());
|
|
|
|
|
} else if (args[0].toLowerCase().equals("size")) {
|
|
|
|
|
Point2 playerLoc = new Point2(player.getLocation().getBlockX(), player.getLocation().getBlockZ());
|
|
|
|
|
sender.sendMessage("Current island's raw size in blocks: " + islandSurvivalCraft.getWorldInfoManager().retrieve(player.getWorld().getName()).getIslandInfoManager().getIslandInformation(playerLoc, true).getIslandSize());
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@@ -103,9 +106,10 @@ public class HighlightCommand implements CommandRunnable {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getDetailedDescription() {
|
|
|
|
|
return "A helpful debugging command to analyze what the plugin considers an island by displaying particle effects around the player that is a part of the island. " +
|
|
|
|
|
"Red particles indicate the islands border, and green particles indicate the origin. " +
|
|
|
|
|
"The <start | stop> argument is required to dicate whether or not to start the highlighting or stop it.";
|
|
|
|
|
return "Usage: \"island <arg>\". replacing <args> with \"highlight\" will start highlighting the island by " +
|
|
|
|
|
"displaying red particles that indicate the islands border, and green particles indicate the origin. \"stop\" will stop the highlighting. " +
|
|
|
|
|
"\"origin\" will print the current island's origin point. " +
|
|
|
|
|
"\"size\" will print the raw island size in blocks including the shallow portions.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|