private void stateSuccess(String playerName, String worldName) { this.plugin.log(Level.FINE, "MV-Core is allowing Player '" + playerName + "' to go to '" + worldName + "'."); }
private void brokenWorld(String name) { this.plugin.log(Level.SEVERE, "The world '" + name + "' could NOT be loaded because it contains errors and is probably corrupt!"); this.plugin.log(Level.SEVERE, "Try using Minecraft Region Fixer to repair your world! '" + name + "'"); this.plugin.log(Level.SEVERE, "https://github.com/Fenixin/Minecraft-Region-Fixer"); }
public MVPlayerChatListener(MultiverseCore plugin, MVPlayerListener playerListener) { super(plugin, playerListener); plugin.log(Level.FINE, "Registered PlayerChatEvent listener."); }
public MVAsyncPlayerChatListener(MultiverseCore plugin, MVPlayerListener playerListener) { super(plugin, playerListener); plugin.log(Level.FINE, "Created AsyncPlayerChatEvent listener."); }
private void nullWorld(String name) { this.plugin.log(Level.SEVERE, "The world '" + name + "' could NOT be loaded because the server didn't like it!"); this.plugin.log(Level.SEVERE, "We don't really know why this is. Contact the developer of your server software!"); this.plugin.log(Level.SEVERE, "Server version info: " + Bukkit.getServer().getVersion()); }
/** * Saves all anchors. * @return True if all anchors were successfully saved. */ public boolean saveAnchors() { try { this.anchorConfig.save(new File(this.plugin.getDataFolder(), "anchors.yml")); return true; } catch (IOException e) { this.plugin.log(Level.SEVERE, "Failed to save anchors.yml. Please check your file permissions."); return false; } }
@Override public int getValue() { int count = 0; for (MultiverseWorld w : core.getMVWorldManager().getMVWorlds()) if (gen.equals(w.getGenerator())) count++; core.log(Level.FINE, String.format("Tracking %d worlds of type %s", count, gen)); return count; } }
private boolean checkActualPermission(CommandSender sender, String node) { Player player = (Player) sender; boolean hasPermission = sender.hasPermission(node); if (!sender.isPermissionSet(node)) { this.plugin.log(Level.FINER, String.format("The node [%s%s%s] was %sNOT%s set for [%s%s%s].", ChatColor.RED, node, ChatColor.WHITE, ChatColor.RED, ChatColor.WHITE, ChatColor.AQUA, player.getDisplayName(), ChatColor.WHITE)); } if (hasPermission) { this.plugin.log(Level.FINER, "Checking to see if player [" + player.getName() + "] has permission [" + node + "]... YES"); } else { this.plugin.log(Level.FINER, "Checking to see if player [" + player.getName() + "] has permission [" + node + "]... NO"); } return hasPermission; }
@Override public Double validateChange(String property, Double newValue, Double oldValue, MVWorld object) throws ChangeDeniedException { if (newValue <= 0) { plugin.log(Level.FINE, "Someone tried to set a scale <= 0, aborting!"); throw new ChangeDeniedException(); } return super.validateChange(property, newValue, oldValue, object); } }
@Override public int getValue() { int count = 0; for (MultiverseWorld w : core.getMVWorldManager().getMVWorlds()) if (w.getEnvironment() == env) count++; core.log(Level.FINE, String.format("Tracking %d worlds of type %s", count, env)); return count; } }
/** * {@inheritDoc} */ @Override public boolean saveWorldsConfig() { try { this.configWorlds.options().pathSeparator(SEPARATOR); this.configWorlds.set("worlds", null); for (Map.Entry<String, WorldProperties> entry : worldsFromTheConfig.entrySet()) { this.configWorlds.set("worlds" + SEPARATOR + entry.getKey(), entry.getValue()); } this.configWorlds.save(new File(this.plugin.getDataFolder(), "worlds.yml")); return true; } catch (IOException e) { this.plugin.log(Level.SEVERE, "Could not save worlds.yml. Please check your settings."); return false; } }
/** * Saves the Multiverse-Config. * * @return Whether the Multiverse-Config was successfully saved */ public boolean saveMVConfig() { try { this.multiverseConfig.set("multiverse-configuration", getMVConfig()); this.multiverseConfig.save(new File(getDataFolder(), "config.yml")); return true; } catch (IOException e) { this.log(Level.SEVERE, "Could not save Multiverse config.yml config. Please check your file permissions."); return false; } }
private void displayDebugMode(CommandSender sender) { final int debugLevel = plugin.getMVConfig().getGlobalDebug(); if (debugLevel == 0) { sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF"); } else { sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel); this.plugin.log(Level.FINE, "Multiverse Debug ENABLED"); } } }
/** * {@inheritDoc} */ @Override public MultiverseWorld getFirstSpawnWorld() { MultiverseWorld world = this.getMVWorld(this.firstSpawn); if (world == null) { // If the spawn world was unloaded, get the default world this.plugin.log(Level.WARNING, "The world specified as the spawn world (" + this.firstSpawn + ") did not exist!!"); try { return this.getMVWorld(this.plugin.getServer().getWorlds().get(0)); } catch (IndexOutOfBoundsException e) { // This should only happen in tests. return null; } } return world; }
private void handleGameModeAndFlight(Player player, World world) { MultiverseWorld mvWorld = this.worldManager.getMVWorld(world.getName()); if (mvWorld != null) { this.handleGameModeAndFlight(player, mvWorld); } else { this.plugin.log(Level.FINER, "Not handling gamemode and flight for world '" + world.getName() + "' not managed by Multiverse."); } }
/** * {@inheritDoc} */ @Override public Location getSafeLocation(Location l, int tolerance, int radius) { // Check around the player first in a configurable radius: // TODO: Make this configurable Location safe = checkAboveAndBelowLocation(l, tolerance, radius); if (safe != null) { safe.setX(safe.getBlockX() + .5); // SUPPRESS CHECKSTYLE: MagicNumberCheck safe.setZ(safe.getBlockZ() + .5); // SUPPRESS CHECKSTYLE: MagicNumberCheck this.plugin.log(Level.FINE, "Hey! I found one: " + plugin.getLocationManipulation().strCoordsRaw(safe)); } else { this.plugin.log(Level.FINE, "Uh oh! No safe place found!"); } return safe; }
/** * Check if the Player has the permissions to enter this world. * * @param p The {@link Player} player that wants to enter * @param w The {@link MultiverseWorld} he wants to enter * @return Whether he has the permission to enter the world */ public boolean canEnterWorld(Player p, MultiverseWorld w) { // If we're not enforcing access, anyone can enter. if (!plugin.getMVConfig().getEnforceAccess()) { this.plugin.log(Level.FINEST, "EnforceAccess is OFF. Player was allowed in " + w.getAlias()); return true; } return this.hasPermission(p, "multiverse.access." + w.getName(), false); }
private Location getSafeLocation() { // At this time, these can never use the velocity. if (this.destination instanceof CannonDestination) { this.core.log(Level.FINE, "Using Stock TP method. This cannon will have 0 velocity"); } SafeTTeleporter teleporter = this.core.getSafeTTeleporter(); Location newLoc = this.destination.getLocation(this.player); if (this.destination.useSafeTeleporter()) { newLoc = teleporter.getSafeLocation(this.player, this.destination); } if (newLoc == null) { return this.player.getLocation(); } return newLoc; }
@Override public GameMode validateChange(String property, GameMode newValue, GameMode oldValue, MVWorld object) throws ChangeDeniedException { for (Player p : plugin.getServer().getWorld(getName()).getPlayers()) { plugin.log(Level.FINER, String.format("Setting %s's GameMode to %s", p.getName(), newValue.toString())); plugin.getPlayerListener().handleGameModeAndFlight(p, MVWorld.this); } return super.validateChange(property, newValue, oldValue, object); } }
/** * This is called when a portal is created as the result of another world being linked. * @param event The event where a portal was formed due to a world link */ @EventHandler(ignoreCancelled = true) public void portalForm(PortalCreateEvent event) { MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld()); if (world != null && !world.getAllowedPortals().isPortalAllowed(PortalType.NETHER)) { plugin.log(Level.FINE, "Cancelling creation of nether portal because portalForm disallows."); event.setCancelled(true); } }