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;
}
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());
}
}
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;
}
Aggregations