use of pl.themolka.arcade.spawn.SpawnAgent in project Arcade2 by ShootGame.
the class PortalParser method parseDestination.
protected SpawnApply parseDestination(Node node, String name, String value) throws ParserException {
Spawn destination = (Spawn) this.destinationParser.parse(node.property("destination")).orFail().get();
boolean smooth = this.smoothParser.parse(node.property("smooth")).orDefault(false);
Direction yaw = this.yawDirectionParser.parse(node.property("yaw")).orDefault(Direction.ENTITY);
Direction pitch = this.pitchDirectionParser.parse(node.property("pitch")).orDefault(Direction.ENTITY);
return new SpawnApply(destination, new SpawnApply.AgentFactory() {
@Override
public SpawnAgent createAgent(Spawn spawn, GamePlayer player, Player bukkit) {
if (smooth) {
return SmoothSpawnAgent.create(spawn, player.getBukkit(), yaw, pitch);
} else {
return SpawnAgent.create(spawn, player.getBukkit(), yaw, pitch);
}
}
});
}
Aggregations