use of com.magmaguy.elitemobs.dungeons.Minidungeon in project EliteMobs by MagmaGuy.
the class SetupHandler method setupUnminidungeonCommand.
public static void setupUnminidungeonCommand(Player player, String minidungeonName) {
Minidungeon minidungeon = Minidungeon.getMinidungeons().get(minidungeonName);
minidungeon.uninstallSchematicMinidungeon(player);
player.performCommand("/undo");
}
use of com.magmaguy.elitemobs.dungeons.Minidungeon in project EliteMobs by MagmaGuy.
the class SetupHandler method setupMinidungeonCommand.
public static void setupMinidungeonCommand(Player player, String minidungeonName) {
Minidungeon minidungeon = Minidungeon.getMinidungeons().get(minidungeonName);
minidungeon.finalizeMinidungeonInstallation(player, true);
player.performCommand("/rotate " + minidungeon.getDungeonPackagerConfigFields().getRotation());
player.performCommand("/paste");
}
use of com.magmaguy.elitemobs.dungeons.Minidungeon in project EliteMobs by MagmaGuy.
the class RelativeCoordinatesCommand method get.
public static void get(Player player, String minidungeonString) {
Minidungeon minidungeon = Minidungeon.getMinidungeons().get(minidungeonString);
if (minidungeon == null) {
player.sendMessage(ChatColorConverter.convert("&8[EliteMobs] &4Minidungeons name " + minidungeonString + " &4isn't valid!"));
return;
}
if (!minidungeon.isInstalled()) {
player.sendMessage(ChatColorConverter.convert("&8[EliteMobs] &4Minidungeon isn't installed! Can't get the relative location for uninstalled Minidungeons!"));
return;
}
Location anchorpoint = minidungeon.getDungeonPackagerConfigFields().getAnchorPoint();
if (anchorpoint == null) {
player.sendMessage(ChatColorConverter.convert("&8[EliteMobs] &4Something went wrong and made the anchor point not valid!"));
return;
}
Vector relativeVector = player.getLocation().clone().subtract(anchorpoint).toVector();
if (minidungeon.getDungeonPackagerConfigFields().getRotation() != 0)
GenericRotationMatrixMath.rotateVectorYAxis(minidungeon.getDungeonPackagerConfigFields().getRotation(), anchorpoint, relativeVector);
String relativePosition = relativeVector.getBlockX() + ", " + relativeVector.getBlockY() + ", " + relativeVector.getBlockZ();
player.sendMessage(ChatColorConverter.convert("[EliteMobs] Relative position to anchor point of " + minidungeon.getDungeonPackagerConfigFields().getName() + ": " + relativePosition));
}
Aggregations