public MVEntityListener(MultiverseCore plugin) { this.plugin = plugin; this.worldManager = plugin.getMVWorldManager(); }
public MVChatListener(MultiverseCore plugin, MVPlayerListener playerListener) { this.plugin = plugin; this.worldManager = plugin.getMVWorldManager(); this.playerListener = playerListener; }
public MVPlayerListener(MultiverseCore plugin) { this.plugin = plugin; worldManager = plugin.getMVWorldManager(); pt = new PermissionTools(plugin); }
@Override public int getValue() { return getMVWorldManager().getMVWorlds().size() + getMVWorldManager().getUnloadedWorlds().size(); } });
@Override public int getValue() { return getMVWorldManager().getMVWorlds().size(); } });
@Override public void runCommand(CommandSender sender, List<String> args) { if (this.plugin.getMVWorldManager().unloadWorld(args.get(0))) { Command.broadcastCommandMessage(sender, "Unloaded world '" + args.get(0) + "'!"); } else { sender.sendMessage("Error trying to unload world '" + args.get(0) + "'!"); } } }
@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; } }
@Override public void runCommand(CommandSender sender, List<String> args) { if (this.plugin.getMVWorldManager().loadWorld(args.get(0))) { Command.broadcastCommandMessage(sender, "Loaded world '" + args.get(0) + "'!"); } else { sender.sendMessage("Error trying to load world '" + args.get(0) + "'!"); } } }
/** * {@inheritDoc} */ @Override public boolean setRespawnToWorld(String respawnToWorld) { if (!this.plugin.getMVWorldManager().isMVWorld(respawnToWorld)) return false; return this.props.setRespawnToWorld(respawnToWorld); }
@Override public String validateChange(String property, String newValue, String oldValue, MVWorld object) throws ChangeDeniedException { if (!newValue.isEmpty() && !plugin.getMVWorldManager().isMVWorld(newValue)) throw new ChangeDeniedException(); return super.validateChange(property, newValue, oldValue, object); } }
@Override public void runCommand(CommandSender sender, List<String> args) { if (this.plugin.getMVWorldManager().removeWorldFromConfig(args.get(0))) { sender.sendMessage("World removed from config!"); } else { sender.sendMessage("Error trying to remove world from config!"); } } }
@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; } }
@Override public boolean isPVPAllowed(Player player, Location location) { if (!enabled || mv == null || location == null) return true; World world = location.getWorld(); if (world == null) return true; MVWorldManager manager = mv.getMVWorldManager(); if (manager == null) return true; MultiverseWorld mvWorld = manager.getMVWorld(world); if (mvWorld == null) return true; ; return mvWorld.isPVPEnabled(); } }
@Override public void run() { player.teleport(plugin.getMVWorldManager().getFirstSpawnWorld().getSpawnLocation()); } }, 1L);
private boolean canEnterLocation(Player p, Location l) { if (l == null) { return false; } String worldName = l.getWorld().getName(); if (!this.plugin.getMVWorldManager().isMVWorld(worldName)) { return false; } return this.hasPermission(p, "multiverse.access." + worldName, false); }
public void setSpawnLocation(World world, int x, int y, int z) { MultiverseWorld mvw = mvc.getMVWorldManager().getMVWorld(world.getName()); Location spawn = new Location(world, (x + 0.5), y, (z + 1.5), 0, 0); mvw.setSpawnLocation(spawn); }
@EventHandler public void initWorld(WorldInitEvent event) { if (!plugin.getMVWorldManager().isKeepingSpawnInMemory(event.getWorld())) { event.getWorld().setKeepSpawnInMemory(false); } } }
/** * 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); } }
private void spawnAccurately(Player player) { MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(player.getWorld().getName()); Location spawnLocation; if (world != null) { spawnLocation = world.getSpawnLocation(); } else { spawnLocation = player.getWorld().getSpawnLocation(); } this.plugin.getSafeTTeleporter().safelyTeleport(player, player, spawnLocation, false); } }
public CoordCommand(MultiverseCore plugin) { super(plugin); this.setName("Coordinates"); this.setCommandUsage("/mv coord"); this.setArgRange(0, 0); this.addKey("mv coord"); this.addKey("mvcoord"); this.addKey("mvco"); this.addCommandExample("/mv coord"); this.setPermission("multiverse.core.coord", "Returns detailed information on the Players where abouts.", PermissionDefault.OP); this.worldManager = this.plugin.getMVWorldManager(); }