use of com.voxelgameslib.voxelgameslib.api.feature.features.MapFeature in project VoxelGamesLibv2 by VoxelGamesLib.
the class EditModePhase method init.
@Override
public void init() {
setName("EditMode");
super.init();
setAllowJoin(true);
setAllowSpectate(false);
AutoRespawnFeature autoRespawnFeature = getGame().createFeature(AutoRespawnFeature.class, this);
addFeature(autoRespawnFeature);
BossBarFeature bossBarFeature = getGame().createFeature(BossBarFeature.class, this);
bossBarFeature.setMessage("Edit Mode active");
bossBarFeature.setColor(BarColor.RED);
addFeature(bossBarFeature);
ClearInventoryFeature clearInventoryFeature = getGame().createFeature(ClearInventoryFeature.class, this);
addFeature(clearInventoryFeature);
DoubleJumpFeature doubleJumpFeature = getGame().createFeature(DoubleJumpFeature.class, this);
addFeature(doubleJumpFeature);
GameModeFeature gameModeFeature = getGame().createFeature(GameModeFeature.class, this);
gameModeFeature.setGameMode(org.bukkit.GameMode.CREATIVE);
addFeature(gameModeFeature);
JumpPadFeature jumpPadFeature = getGame().createFeature(JumpPadFeature.class, this);
addFeature(jumpPadFeature);
VoidTeleportFeature voidTeleportFeature = getGame().createFeature(VoidTeleportFeature.class, this);
addFeature(voidTeleportFeature);
SpawnFeature spawnFeature = getGame().createFeature(SpawnFeature.class, this);
addFeature(spawnFeature);
MapFeature mapFeature = getGame().createFeature(MapFeature.class, this);
addFeature(mapFeature);
MobFeature mobFeature = getGame().createFeature(MobFeature.class, this);
mobFeature.setRemoveExisting(true);
addFeature(mobFeature);
TimeFeature timeFeature = getGame().createFeature(TimeFeature.class, this);
addFeature(timeFeature);
}
use of com.voxelgameslib.voxelgameslib.api.feature.features.MapFeature in project VoxelGamesLibv2 by VoxelGamesLib.
the class GracePhase method init.
@Override
public void init() {
setName("GracePhase");
super.init();
setAllowJoin(false);
setAllowSpectate(true);
setTicks(60 * GameConstants.TPS);
MapFeature mapFeature = getGame().createFeature(MapFeature.class, this);
mapFeature.setShouldUnload(false);
addFeature(mapFeature);
SpawnFeature spawnFeature = getGame().createFeature(SpawnFeature.class, this);
addFeature(spawnFeature);
MapInfoFeature mapInfoFeature = getGame().createFeature(MapInfoFeature.class, this);
addFeature(mapInfoFeature);
ScoreboardFeature scoreboardFeature = getGame().createFeature(ScoreboardFeature.class, this);
addFeature(scoreboardFeature);
NoBlockBreakFeature noBlockBreakFeature = getGame().createFeature(NoBlockBreakFeature.class, this);
addFeature(noBlockBreakFeature);
NoBlockPlaceFeature noBlockPlaceFeature = getGame().createFeature(NoBlockPlaceFeature.class, this);
addFeature(noBlockPlaceFeature);
ClearInventoryFeature clearInventoryFeature = getGame().createFeature(ClearInventoryFeature.class, this);
addFeature(clearInventoryFeature);
NoDamageFeature noDamageFeature = getGame().createFeature(NoDamageFeature.class, this);
addFeature(noDamageFeature);
HealFeature healFeature = getGame().createFeature(HealFeature.class, this);
addFeature(healFeature);
GameModeFeature gameModeFeature = getGame().createFeature(GameModeFeature.class, this);
gameModeFeature.setGameMode(GameMode.SURVIVAL);
addFeature(gameModeFeature);
MobFeature mobFeature = getGame().createFeature(MobFeature.class, this);
addFeature(mobFeature);
SpectatorFeature spectatorFeature = getGame().createFeature(SpectatorFeature.class, this);
addFeature(spectatorFeature);
}
use of com.voxelgameslib.voxelgameslib.api.feature.features.MapFeature in project VoxelGamesLibv2 by VoxelGamesLib.
the class LobbyPhase method init.
@Override
public void init() {
setName("LobbyPhase");
super.init();
setAllowJoin(true);
setAllowSpectate(false);
MapFeature mapFeature = getGame().createFeature(MapFeature.class, this);
mapFeature.setShouldUnload(false);
mapFeature.setType(MapFeature.Type.LOBBY);
addFeature(mapFeature);
SpawnFeature spawnFeature = getGame().createFeature(SpawnFeature.class, this);
addFeature(spawnFeature);
NoBlockBreakFeature noBlockBreakFeature = getGame().createFeature(NoBlockBreakFeature.class, this);
addFeature(noBlockBreakFeature);
NoBlockPlaceFeature noBlockPlaceFeature = getGame().createFeature(NoBlockPlaceFeature.class, this);
addFeature(noBlockPlaceFeature);
ClearInventoryFeature clearInventoryFeature = getGame().createFeature(ClearInventoryFeature.class, this);
addFeature(clearInventoryFeature);
NoDamageFeature noDamageFeature = getGame().createFeature(NoDamageFeature.class, this);
addFeature(noDamageFeature);
HealFeature healFeature = getGame().createFeature(HealFeature.class, this);
addFeature(healFeature);
GameModeFeature gameModeFeature = getGame().createFeature(GameModeFeature.class, this);
gameModeFeature.setGameMode(GameMode.ADVENTURE);
addFeature(gameModeFeature);
LobbyFeature lobbyFeature = getGame().createFeature(LobbyFeature.class, this);
addFeature(lobbyFeature);
NoHungerLossFeature noHungerLossFeature = getGame().createFeature(NoHungerLossFeature.class, this);
addFeature(noHungerLossFeature);
ScoreboardFeature scoreboardFeature = getGame().createFeature(ScoreboardFeature.class, this);
addFeature(scoreboardFeature);
BossBarFeature bossBarFeature = getGame().createFeature(BossBarFeature.class, this);
addFeature(bossBarFeature);
MobFeature mobFeature = getGame().createFeature(MobFeature.class, this);
addFeature(mobFeature);
}
use of com.voxelgameslib.voxelgameslib.api.feature.features.MapFeature in project VoxelGamesLibv2 by VoxelGamesLib.
the class PodFeature method enable.
@Override
public void enable() {
MapFeature mapFeature = getPhase().getFeature(MapFeature.class);
List<Location> locations = mapFeature.getMap().getMarkers(spawnMarker).stream().map(marker -> marker.getLoc().toLocation(mapFeature.getWorld().getName())).collect(Collectors.toList());
powerRelative(locations, 2);
Bukkit.getScheduler().runTaskLater(voxelGamesLib, () -> powerRelative(locations, 0), 20);
}
use of com.voxelgameslib.voxelgameslib.api.feature.features.MapFeature in project VoxelGamesLibv2 by VoxelGamesLib.
the class SurvivalGamesPhase method init.
@Override
public void init() {
setName("SurvivalGamesPhase");
setTicks(2 * 60 * GameConstants.TPS);
super.init();
setAllowJoin(false);
setAllowSpectate(true);
MapFeature mapFeature = getGame().createFeature(MapFeature.class, this);
mapFeature.setShouldUnload(true);
addFeature(mapFeature);
SpawnFeature spawnFeature = getGame().createFeature(SpawnFeature.class, this);
spawnFeature.setRespawn(false);
spawnFeature.setInitialSpawn(false);
addFeature(spawnFeature);
GameModeFeature gameModeFeature = getGame().createFeature(GameModeFeature.class, this);
gameModeFeature.setGameMode(GameMode.SURVIVAL);
addFeature(gameModeFeature);
SurvivalGamesFeature survivalgamesFeature = getGame().createFeature(SurvivalGamesFeature.class, this);
addFeature(survivalgamesFeature);
AutoRespawnFeature autoRespawnFeature = getGame().createFeature(AutoRespawnFeature.class, this);
addFeature(autoRespawnFeature);
MobFeature mobFeature = getGame().createFeature(MobFeature.class, this);
addFeature(mobFeature);
SpectatorFeature spectatorFeature = getGame().createFeature(SpectatorFeature.class, this);
addFeature(spectatorFeature);
NoBlockBreakFeature noBlockBreakFeature = getGame().createFeature(NoBlockBreakFeature.class, this);
noBlockBreakFeature.setWhitelist(new Material[] { Material.ACACIA_LEAVES, Material.BIRCH_LEAVES, Material.DARK_OAK_LEAVES, Material.JUNGLE_LEAVES, Material.OAK_LEAVES, Material.SPRUCE_LEAVES, Material.SUNFLOWER, Material.ROSE_BUSH, Material.ROSE_RED, Material.DANDELION_YELLOW, Material.DANDELION, Material.VINE, Material.BROWN_MUSHROOM, Material.BROWN_MUSHROOM_BLOCK, Material.RED_MUSHROOM_BLOCK, Material.RED_MUSHROOM, Material.MELON, Material.MELON_STEM, Material.PUMPKIN_STEM, Material.WHEAT, Material.PUMPKIN });
addFeature(noBlockBreakFeature);
}
Aggregations