world.setSpawnLocation(x, y, z);
world.setSpawnLocation(spawnLocation.getBlockX(), spawnLocation.getBlockY(), spawnLocation.getBlockZ()); sender.sendMessage(
@Override public void setSpawnLocation(int x, int y, int z) { w.setSpawnLocation(x, y, z); }
@Override public void set(Location newValue) { if (getCBWorld() != null) getCBWorld().setSpawnLocation(newValue.getBlockX(), newValue.getBlockY(), newValue.getBlockZ()); props.spawnLocation = new SpawnLocation(newValue); }
public void create() { arenaWorld = plugin.getServer().getWorld(Statics.ARENA_WORLD_NAME); if (arenaWorld == null) { plugin.getLogger().info("Loading world '" + Statics.ARENA_WORLD_NAME + "'."); WorldCreator arenaWorldCreator = new WorldCreator(Statics.ARENA_WORLD_NAME); arenaWorldCreator.generateStructures(false); arenaWorldCreator.generator(new VoidGenerator()); arenaWorldCreator.type(WorldType.FLAT); arenaWorldCreator.seed(0); arenaWorld = arenaWorldCreator.createWorld(); plugin.getLogger().info("Done loading world '" + Statics.ARENA_WORLD_NAME + "'."); } else { plugin.getLogger().info("The world '" + Statics.ARENA_WORLD_NAME + "' was already loaded."); } arenaWorld.setAutoSave(false); arenaWorld.getBlockAt(-5000, 45, -5000).setType(Material.STONE); arenaWorld.setSpawnLocation(-5000, 50, -5000); for (Map.Entry<String, String> entry : plugin.getConfiguration().getArenaGamerules().entrySet()) { arenaWorld.setGameRuleValue(entry.getKey(), entry.getValue()); } arenaWorld.setTime(4000); }
world.setSpawnLocation(x, y, z);
@Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { Location pos = playerSender.getLocation(); playerSender.getWorld().setSpawnLocation(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()); msg("Spawn location for this world set to: " + FUtil.formatLocation(playerSender.getWorld().getSpawnLocation())); if (ConfigEntry.PROTECTAREA_ENABLED.getBoolean() && ConfigEntry.PROTECTAREA_SPAWNPOINTS.getBoolean()) { plugin.pa.addProtectedArea("spawn_" + playerSender.getWorld().getName(), pos, ConfigEntry.PROTECTAREA_RADIUS.getDouble()); } return true; } }
public WrappedSpawn setWorldSpawn(Location loc) { WrappedSpawn spawn = getEnrichment(loc.getWorld()); loc.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); spawn.setPitch(loc.getPitch()); spawn.setYaw(loc.getYaw()); config.setProperty(spawn.getWorldName() + ".pitch", spawn.getPitch()); config.setProperty(spawn.getWorldName() + ".yaw", spawn.getYaw()); config.setHeader(CONFIG_HEADER); config.save(); return spawn; }
plugin.getMVHelper().setSpawnLocation(world, x, y, z); } else { world.setSpawnLocation(x, y, (z + 1));
plugin.getMVHelper().setSpawnLocation(world, x, y, z); } else { world.setSpawnLocation(x, y, (z + 1));
plugin.getMVHelper().setSpawnLocation(world, x, y, z); } else { world.setSpawnLocation(x, y, (z + 1));
public MVWorld(MultiverseCore plugin, World world, WorldProperties properties, boolean fixSpawn) { this.plugin = plugin; this.name = world.getName(); this.worldUID = world.getUID(); this.props = properties; setupProperties(); if (!fixSpawn) { props.setAdjustSpawn(false); } // Setup spawn separately so we can use the validator with the world spawn value.. final SpawnLocationPropertyValidator spawnValidator = new SpawnLocationPropertyValidator(); this.props.setValidator("spawn", spawnValidator); this.props.spawnLocation.setWorld(world); if (this.props.spawnLocation instanceof NullLocation) { final SpawnLocation newLoc = new SpawnLocation(readSpawnFromWorld(world)); this.props.spawnLocation = newLoc; world.setSpawnLocation(newLoc.getBlockX(), newLoc.getBlockY(), newLoc.getBlockZ()); } this.props.environment = world.getEnvironment(); this.props.seed = world.getSeed(); this.initPerms(); this.props.flushChanges(); validateProperties(); }
@Override protected World generateWorld() { final WorldCreator worldCreator = new WorldCreator(getName()); worldCreator.generateStructures(false); worldCreator.type(WorldType.NORMAL); worldCreator.environment(World.Environment.NORMAL); worldCreator.generator(new CleanroomChunkGenerator(GENERATION_PARAMETERS)); final World world = Bukkit.getServer().createWorld(worldCreator); world.setSpawnFlags(false, false); world.setSpawnLocation(0, 50, 0); final Block welcomeSignBlock = world.getBlockAt(0, 50, 0); welcomeSignBlock.setType(Material.SIGN_POST); org.bukkit.block.Sign welcomeSign = (org.bukkit.block.Sign) welcomeSignBlock.getState(); org.bukkit.material.Sign signData = (org.bukkit.material.Sign) welcomeSign.getData(); signData.setFacingDirection(BlockFace.NORTH); welcomeSign.setLine(0, ChatColor.GREEN + "AdminWorld"); welcomeSign.setLine(1, ChatColor.DARK_GRAY + "---"); welcomeSign.setLine(2, ChatColor.YELLOW + "Spawn Point"); welcomeSign.setLine(3, ChatColor.DARK_GRAY + "---"); welcomeSign.update(); plugin.gr.commitGameRules(); return world; }
@Override protected World generateWorld() { if (!ConfigEntry.FLATLANDS_GENERATE.getBoolean()) { return null; } wipeFlatlandsIfFlagged(); final WorldCreator worldCreator = new WorldCreator(getName()); worldCreator.generateStructures(false); worldCreator.type(WorldType.NORMAL); worldCreator.environment(World.Environment.NORMAL); worldCreator.generator(new CleanroomChunkGenerator(GENERATION_PARAMETERS)); final World world = Bukkit.getServer().createWorld(worldCreator); world.setSpawnFlags(false, false); world.setSpawnLocation(0, 50, 0); final Block welcomeSignBlock = world.getBlockAt(0, 50, 0); welcomeSignBlock.setType(Material.SIGN_POST); org.bukkit.block.Sign welcomeSign = (org.bukkit.block.Sign) welcomeSignBlock.getState(); org.bukkit.material.Sign signData = (org.bukkit.material.Sign) welcomeSign.getData(); signData.setFacingDirection(BlockFace.NORTH); welcomeSign.setLine(0, ChatColor.GREEN + "Flatlands"); welcomeSign.setLine(1, ChatColor.DARK_GRAY + "---"); welcomeSign.setLine(2, ChatColor.YELLOW + "Spawn Point"); welcomeSign.setLine(3, ChatColor.DARK_GRAY + "---"); welcomeSign.update(); plugin.gr.commitGameRules(); return world; }
w.setSpawnLocation(l.getBlockX(), l.getBlockY(), l.getBlockZ()); sender.sendMessage("Multiverse does not know about this world, only X,Y and Z set. Please import it to set the spawn fully (Pitch/Yaws).");