use of org.spongepowered.api.data.manipulator.mutable.entity.GameModeData in project LanternServer by LanternPowered.
the class SelectorResolver method addGamemodeFilters.
private void addGamemodeFilters(List<Predicate<Entity>> filters) {
Selector sel = this.selector;
Optional<GameMode> gamemode = sel.get(ArgumentTypes.GAME_MODE);
// If the game mode is NOT_SET, that means accept any
if (gamemode.isPresent() && gamemode.get() != GameModes.NOT_SET) {
final GameMode actualMode = gamemode.get();
filters.add(input -> {
Optional<GameModeData> mode = input.get(GameModeData.class);
return mode.isPresent() && mode.get() == actualMode;
});
}
}
use of org.spongepowered.api.data.manipulator.mutable.entity.GameModeData in project SpongeCommon by SpongePowered.
the class SelectorResolver method addGamemodeFilters.
private void addGamemodeFilters(List<Predicate<Entity>> filters) {
Selector sel = this.selector;
Optional<GameMode> gamemode = sel.get(ArgumentTypes.GAME_MODE);
// If the gamemode is NOT_SET, that means accept any
if (gamemode.isPresent() && gamemode.get() != GameModes.NOT_SET) {
final GameMode actualMode = gamemode.get();
filters.add(input -> {
Optional<GameModeData> mode = input.get(GameModeData.class);
return mode.isPresent() && mode.get() == actualMode;
});
}
}
Aggregations