Search in sources :

Example 1 with Vector3D

use of com.voxelgameslib.voxelgameslib.map.Vector3D in project VoxelGamesLibv2 by VoxelGamesLib.

the class WorldCreator method center.

@Subcommand("center")
@CommandPermission("%admin")
public void center(@Nonnull User sender) {
    if (step != 2) {
        Lang.msg(sender, LangKey.WORLD_CREATOR_WRONG_STEP, step, 2);
        return;
    }
    center = new Vector3D(sender.getPlayer().getLocation().getX(), sender.getPlayer().getLocation().getY(), sender.getPlayer().getLocation().getZ());
    Lang.msg(sender, LangKey.WORLD_CREATOR_ENTER_RADIUS, "/worldcreator radius ");
    step = 3;
}
Also used : Vector3D(com.voxelgameslib.voxelgameslib.map.Vector3D) Subcommand(co.aikar.commands.annotation.Subcommand) CommandPermission(co.aikar.commands.annotation.CommandPermission)

Example 2 with Vector3D

use of com.voxelgameslib.voxelgameslib.map.Vector3D in project VoxelGamesLibv2 by VoxelGamesLib.

the class WorldModifyCommands method center.

@Subcommand("center")
@CommandPermission("%admin")
public void center(@Nonnull User user, @Nullable @co.aikar.commands.annotation.Optional String set) {
    if (!check(user))
        return;
    // view
    if (set == null) {
        Lang.msg(user, LangKey.WORLD_MODIFY_CENTER_VIEW, map.getCenter());
    } else // edit
    {
        map.setCenter(new Vector3D(user.getPlayer().getLocation().getX(), user.getPlayer().getLocation().getY(), user.getPlayer().getLocation().getZ()));
        Lang.msg(user, LangKey.WORLD_MODIFY_CENTER_EDIT, map.getCenter());
    }
}
Also used : Vector3D(com.voxelgameslib.voxelgameslib.map.Vector3D) Subcommand(co.aikar.commands.annotation.Subcommand) CommandPermission(co.aikar.commands.annotation.CommandPermission)

Example 3 with Vector3D

use of com.voxelgameslib.voxelgameslib.map.Vector3D in project VoxelGamesLibv2 by VoxelGamesLib.

the class WorldCreator method world.

@Subcommand("world")
@CommandPermission("%admin")
public void world(@Nonnull User sender, @Nonnull String worldName) {
    if (step != 1) {
        Lang.msg(sender, LangKey.WORLD_CREATOR_WRONG_STEP, step, 1);
        return;
    }
    this.worldName = worldName;
    worldHandler.loadLocalWorld(worldName);
    Location spawnLoc = Bukkit.getWorld(worldName).getSpawnLocation();
    Vector3D spawn = new Vector3D(spawnLoc.getX(), spawnLoc.getY(), spawnLoc.getZ());
    sender.getPlayer().teleport(spawnLoc);
    game = gameHandler.startGame(EditModeGame.GAMEMODE);
    game.getActivePhase().getNextPhase().getFeature(SpawnFeature.class).addSpawn(spawn);
    Map map = new Map(null, worldName, spawn, 100);
    map.load(game.getUuid(), worldName);
    game.getActivePhase().getNextPhase().getFeature(MapFeature.class).setMap(map);
    game.join(editor);
    game.endPhase();
    Lang.msg(sender, LangKey.WORLD_CREATOR_ENTER_CENTER, "/worldcreator center");
    step = 2;
}
Also used : Vector3D(com.voxelgameslib.voxelgameslib.map.Vector3D) MapFeature(com.voxelgameslib.voxelgameslib.feature.features.MapFeature) SpawnFeature(com.voxelgameslib.voxelgameslib.feature.features.SpawnFeature) Map(com.voxelgameslib.voxelgameslib.map.Map) Location(org.bukkit.Location) Subcommand(co.aikar.commands.annotation.Subcommand) CommandPermission(co.aikar.commands.annotation.CommandPermission)

Aggregations

CommandPermission (co.aikar.commands.annotation.CommandPermission)3 Subcommand (co.aikar.commands.annotation.Subcommand)3 Vector3D (com.voxelgameslib.voxelgameslib.map.Vector3D)3 MapFeature (com.voxelgameslib.voxelgameslib.feature.features.MapFeature)1 SpawnFeature (com.voxelgameslib.voxelgameslib.feature.features.SpawnFeature)1 Map (com.voxelgameslib.voxelgameslib.map.Map)1 Location (org.bukkit.Location)1