Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package thecube.zombie.survival;
- import com.cubemc.api.CubeAPI;
- import com.cubemc.api.game.CubeGame;
- import com.cubemc.api.game.GamePlugin;
- import com.cubemc.api.game.GameState;
- import com.cubemc.api.game.kits.GameKit;
- import com.cubemc.api.game.lobby.JoinAction;
- import com.cubemc.api.game.maps.GameMap;
- import com.cubemc.api.game.prevention.PreventionSet;
- import com.cubemc.api.game.teams.GameTeam;
- import org.bukkit.Bukkit;
- import org.bukkit.plugin.java.JavaPlugin;
- import thecube.zombie.survival.Executors.EndGame;
- import thecube.zombie.survival.Executors.StartGame;
- import thecube.zombie.survival.Kits.KnightKit;
- import thecube.zombie.survival.Listeners.Death;
- import thecube.zombie.survival.Listeners.Join;
- import thecube.zombie.survival.Listeners.Leave;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- /**
- * Created by New-Pc on 24/05/2015.
- */
- public class Core extends JavaPlugin implements GamePlugin {
- public void onEnable(){
- List<GameMap> maps = new ArrayList<GameMap>();
- maps.add(new GameMap("testmap", "Devtom","testmap"));
- CubeAPI.getGameManager().initializeGame(setupGame(), maps);
- Bukkit.getPluginManager().registerEvents(new Join(), this);
- Bukkit.getPluginManager().registerEvents(new Death(), this);
- Bukkit.getPluginManager().registerEvents(new Leave(), this);
- }
- @Override
- public CubeGame setupGame() {
- CubeGame game = new CubeGame("ZombieSurvival", "Survival","§6", new PreventionSet());
- game.setState(GameState.WAITING);
- game.setTicks(5);
- game.setDescription(Arrays.asList("Choose a kit.", "Fight the zombies.", "Last team alive wins!"));
- game.setStartGameExecutor(new StartGame());
- game.setEndGameExecutor(new EndGame());
- game.setSubtitles("H1z1 remake");
- game.setEnforcePlayableArena(false);
- game.setJoinAction(JoinAction.SEND_TO_LOBBY);
- game.setKitsEnabled(true);
- game.setMaxPlayers(10);
- game.setMinPlayers(1);
- List<GameTeam> teams = new ArrayList<GameTeam>();
- {
- GameTeam team = new GameTeam("Red", "§c");
- team.setMaxSize(5);
- teams.add(team);
- }
- {
- GameTeam team = new GameTeam("Blue", "§9");
- team.setMaxSize(5);
- teams.add(team);
- }
- {
- GameTeam team = new GameTeam("Spectators", "§7");
- team.setMaxSize(-1);
- team.setVisible(false);
- teams.add(team);
- }
- game.setTeams(teams);
- List<GameKit> kits = new ArrayList<GameKit>();
- kits.add(new KnightKit());
- game.setGameKits(kits);
- return game;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement