Skip to content

Commit 35ea12d

Browse files
committed
Build spacenpcs with java 21q
1 parent 1dce582 commit 35ea12d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

spaceNPC/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ dependencies {
2626
implementation(project(":platforms:movement"))
2727
}
2828

29+
tasks {
30+
compileJava {
31+
sourceCompatibility = "21"
32+
targetCompatibility = "21"
33+
options.release.set(21)
34+
}
35+
}
36+
2937
tasks {
3038
val version = "1.21.3"
3139
val javaVersion = JavaLanguageVersion.of(21)

spaceNPC/src/main/java/me/tofaa/entitylib/npc/NPCMovement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ private static void processPathFollowing() {
215215
double newY = current.getY();
216216

217217
if (npc.getOptions().isClampToGround()) {
218-
var world = npc.getWorld();
218+
World world = npc.getWorld();
219219
if (world != null) {
220220
int bx = (int) Math.floor(newX);
221221
int bz = (int) Math.floor(newZ);
222222
int feetY = (int) Math.floor(current.getY());
223223

224224
// Check if there's a solid block ahead at feet level (obstacle)
225-
var blockAtFeet = world.getBlockAt(bx, feetY, bz);
226-
var blockAboveFeet = world.getBlockAt(bx, feetY + 1, bz);
225+
Block blockAtFeet = world.getBlockAt(bx, feetY, bz);
226+
Block blockAboveFeet = world.getBlockAt(bx, feetY + 1, bz);
227227

228228
boolean obstacleAhead = !blockAtFeet.isPassable()
229229
&& blockAboveFeet.isPassable();

0 commit comments

Comments
 (0)