use of com.magmaguy.elitemobs.utils.InfoMessage in project EliteMobs by MagmaGuy.
the class CustomWorldLoading method startupWorldInitialization.
public static void startupWorldInitialization() {
File folder = new File(Bukkit.getWorldContainer().getAbsolutePath());
File[] listOfFiles = folder.listFiles();
assert listOfFiles != null;
for (File listOfFile : listOfFiles) {
if (listOfFile.isDirectory() && listOfFile.getName().equals(AdventurersGuildConfig.getGuildWorldName())) {
new InfoMessage("[EliteMobs] World " + AdventurersGuildConfig.getGuildWorldName() + " found! Loading it in...");
try {
WorldCreator worldCreator = new WorldCreator(AdventurersGuildConfig.getGuildWorldName());
Objects.requireNonNull(Bukkit.createWorld(worldCreator)).setKeepSpawnInMemory(false);
new InfoMessage("[EliteMobs] World " + AdventurersGuildConfig.getGuildWorldName() + " has been successfully loaded! It can be accessed through the '/ag' command, unless you changed that config option!");
} catch (Exception ex) {
new WarningMessage("Failed to generate Adventurer's Guild World!");
ex.printStackTrace();
}
break;
}
}
}
use of com.magmaguy.elitemobs.utils.InfoMessage in project EliteMobs by MagmaGuy.
the class Wormhole method getDungeonLocation.
private Location getDungeonLocation(String dungeonFilename) {
Minidungeon minidungeon = Minidungeon.getMinidungeons().get(dungeonFilename);
if (minidungeon == null) {
new WarningMessage("Dungeon " + dungeonFilename + " is not a valid dungeon packager name! Wormhole " + getWormholeConfigFields().getFilename() + " will not lead anywhere.");
setPortalMissingMessage(WormholesConfig.getDefaultPortalMissingMessage());
return null;
}
if (!minidungeon.isDownloaded() || !minidungeon.isInstalled()) {
new InfoMessage("Wormhole " + getWormholeConfigFields().getFilename() + " will not lead anywhere because the dungeon " + dungeonFilename + " is not installed!");
setPortalMissingMessage(WormholesConfig.getDungeonNotInstalledMessage().replace("$dungeonID", minidungeon.getDungeonPackagerConfigFields().getName()));
this.opMessage = ChatColorConverter.convert("&8[EliteMobs - OP-only message] &fDownload links are available on &9https://magmaguy.itch.io/ &f" + "(free and premium) and &9https://www.patreon.com/magmaguy &f(premium). You can check the difference " + "between the two and get support here: " + DiscordLinks.mainLink);
return null;
}
Vector offsetVector = minidungeon.getTeleportLocation().getDirection().clone().setY(0).normalize().multiply(1.5 * getWormholeConfigFields().getSizeMultiplier()).setY(-1 * getWormholeConfigFields().getSizeMultiplier());
return minidungeon.getTeleportLocation().clone().subtract(offsetVector);
}
use of com.magmaguy.elitemobs.utils.InfoMessage in project EliteMobs by MagmaGuy.
the class ConfigurationImporter method moveWorlds.
private static void moveWorlds(File worldcontainerFile) {
for (File file : worldcontainerFile.listFiles()) try {
File destinationFile = new File(Paths.get(Bukkit.getWorldContainer().getCanonicalPath() + File.separatorChar + file.getName()).normalize().toString());
if (destinationFile.exists()) {
new InfoMessage("Overriding existing directory " + destinationFile.getPath());
if (Bukkit.getWorld(file.getName()) != null) {
Bukkit.unloadWorld(file.getName(), false);
new WarningMessage("Unloaded world " + file.getName() + " for safe replacement!");
}
deleteDirectory(destinationFile);
}
FileUtils.moveDirectory(file, destinationFile);
} catch (Exception exception) {
new WarningMessage("Failed to move worlds for " + file.getName() + "! Tell the dev!");
exception.printStackTrace();
}
}
use of com.magmaguy.elitemobs.utils.InfoMessage in project EliteMobs by MagmaGuy.
the class ConfigurationImporter method moveDirectory.
private static void moveDirectory(File unzippedDirectory, Path targetPath) {
for (File file : unzippedDirectory.listFiles()) try {
new InfoMessage("Adding " + file.getCanonicalPath());
moveFile(file, targetPath);
} catch (Exception exception) {
new WarningMessage("Failed to move directories for " + file.getName() + "! Tell the dev!");
exception.printStackTrace();
}
}
Aggregations