Search in sources :

Example 1 with NoBlockPlaceFeature

use of com.voxelgameslib.voxelgameslib.feature.features.NoBlockPlaceFeature 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);
}
Also used : NoBlockBreakFeature(com.voxelgameslib.voxelgameslib.feature.features.NoBlockBreakFeature) GameModeFeature(com.voxelgameslib.voxelgameslib.feature.features.GameModeFeature) MapInfoFeature(com.voxelgameslib.voxelgameslib.feature.features.MapInfoFeature) NoDamageFeature(com.voxelgameslib.voxelgameslib.feature.features.NoDamageFeature) ClearInventoryFeature(com.voxelgameslib.voxelgameslib.feature.features.ClearInventoryFeature) MobFeature(com.voxelgameslib.voxelgameslib.feature.features.MobFeature) MapFeature(com.voxelgameslib.voxelgameslib.feature.features.MapFeature) NoBlockPlaceFeature(com.voxelgameslib.voxelgameslib.feature.features.NoBlockPlaceFeature) SpawnFeature(com.voxelgameslib.voxelgameslib.feature.features.SpawnFeature) HealFeature(com.voxelgameslib.voxelgameslib.feature.features.HealFeature) ScoreboardFeature(com.voxelgameslib.voxelgameslib.feature.features.ScoreboardFeature)

Example 2 with NoBlockPlaceFeature

use of com.voxelgameslib.voxelgameslib.feature.features.NoBlockPlaceFeature 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);
}
Also used : MobFeature(com.voxelgameslib.voxelgameslib.feature.features.MobFeature) NoBlockBreakFeature(com.voxelgameslib.voxelgameslib.feature.features.NoBlockBreakFeature) GameModeFeature(com.voxelgameslib.voxelgameslib.feature.features.GameModeFeature) BossBarFeature(com.voxelgameslib.voxelgameslib.feature.features.BossBarFeature) NoDamageFeature(com.voxelgameslib.voxelgameslib.feature.features.NoDamageFeature) NoHungerLossFeature(com.voxelgameslib.voxelgameslib.feature.features.NoHungerLossFeature) ClearInventoryFeature(com.voxelgameslib.voxelgameslib.feature.features.ClearInventoryFeature) MapFeature(com.voxelgameslib.voxelgameslib.feature.features.MapFeature) NoBlockPlaceFeature(com.voxelgameslib.voxelgameslib.feature.features.NoBlockPlaceFeature) SpawnFeature(com.voxelgameslib.voxelgameslib.feature.features.SpawnFeature) HealFeature(com.voxelgameslib.voxelgameslib.feature.features.HealFeature) ScoreboardFeature(com.voxelgameslib.voxelgameslib.feature.features.ScoreboardFeature) LobbyFeature(com.voxelgameslib.voxelgameslib.feature.features.LobbyFeature)

Aggregations

ClearInventoryFeature (com.voxelgameslib.voxelgameslib.feature.features.ClearInventoryFeature)2 GameModeFeature (com.voxelgameslib.voxelgameslib.feature.features.GameModeFeature)2 HealFeature (com.voxelgameslib.voxelgameslib.feature.features.HealFeature)2 MapFeature (com.voxelgameslib.voxelgameslib.feature.features.MapFeature)2 MobFeature (com.voxelgameslib.voxelgameslib.feature.features.MobFeature)2 NoBlockBreakFeature (com.voxelgameslib.voxelgameslib.feature.features.NoBlockBreakFeature)2 NoBlockPlaceFeature (com.voxelgameslib.voxelgameslib.feature.features.NoBlockPlaceFeature)2 NoDamageFeature (com.voxelgameslib.voxelgameslib.feature.features.NoDamageFeature)2 ScoreboardFeature (com.voxelgameslib.voxelgameslib.feature.features.ScoreboardFeature)2 SpawnFeature (com.voxelgameslib.voxelgameslib.feature.features.SpawnFeature)2 BossBarFeature (com.voxelgameslib.voxelgameslib.feature.features.BossBarFeature)1 LobbyFeature (com.voxelgameslib.voxelgameslib.feature.features.LobbyFeature)1 MapInfoFeature (com.voxelgameslib.voxelgameslib.feature.features.MapInfoFeature)1 NoHungerLossFeature (com.voxelgameslib.voxelgameslib.feature.features.NoHungerLossFeature)1