1
現在、APIを使用してBeam
対話型アプリケーションを設定しようとしていますが、問題が発生しています。言語レベルをjava 8に設定するといくつかのメソッドが消えます
BeamAPI beam = new BeamAPI("oauthtoken");
BeamUser user = beam.use(UsersService.class).getCurrent().get();
pro.beam.interactive.robot.Robot robot = new RobotBuilder()
.channel(user.channel)
.build(beam, false)
.get();
robot.on(Protocol.Report.class, report -> {
// If we have any joysticks in the report
if (report.getJoystickCount() > 0) {
// Get the coordMean from the joystick
Protocol.Coordinate coordMean = report.getJoystick(0).getCoordMean();
Point mousePosition = MouseInfo.getPointerInfo().getLocation();
// Apply it to the current mouse position, if its values are not NaN
if (!Double.isNaN(coordMean.getX()) && !Double.isNaN(coordMean.getY())) {
}
}
});
}
問題は、getJoystickCount
などの方法が表示されない、解決されていない、しかし私は、Java 7のすべてのメソッドに自分の語学レベルを設定した場合、正しく表示が、コードがしないということですJava 8のラムダを使用しています。
すべてのmaven設定はプロジェクト設定と同様に設定されており、Protocol
クラスのすべてのメソッドがそこにあります。
この問題の原因は何ですか?
これは私のPOMファイルです:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>beamplays</groupId>
<artifactId>splix</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>beam-releases</id>
<url>https://maven.beam.pro/content/repositories/releases/</url>
</repository>
<repository>
<id>beam-snapshots</id>
<url>https://maven.beam.pro/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>pro.beam</groupId>
<artifactId>api</artifactId>
<version>3.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>pro.beam</groupId>
<artifactId>interactive</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
</dependencies>
あなたのmaven pomファイルを表示してください。どのIDEを使用していますか? –
私はIntellIJ Ideaを使用しています。私は質問に – Checkium
を追加しました。 ' 3.6.1 'をmavenコンパイラプラグインの依存関係に追加して、プロジェクトを掃除して更新します(IntellIJ内のそれがalt + f5となるようにしてください)、再度チェックしてください。 –