diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 2f679aa..d6edb84 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v7 - name: Setup java - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: java-version: 25 check-latest: true diff --git a/api/src/main/java/com/github/juliarn/npclib/api/protocol/enums/EntityAnimation.java b/api/src/main/java/com/github/juliarn/npclib/api/protocol/enums/EntityAnimation.java index 1707467..73c7445 100644 --- a/api/src/main/java/com/github/juliarn/npclib/api/protocol/enums/EntityAnimation.java +++ b/api/src/main/java/com/github/juliarn/npclib/api/protocol/enums/EntityAnimation.java @@ -26,20 +26,18 @@ public enum EntityAnimation { - SWING_MAIN_ARM(0), - TAKE_DAMAGE(1), - LEAVE_BED(2), - SWING_OFF_HAND(3), - CRITICAL_EFFECT(4), - MAGIC_CRITICAL_EFFECT(5); - - private final int id; - - EntityAnimation(int id) { - this.id = id; - } + SWING_MAIN_ARM, + TAKE_DAMAGE, + LEAVE_BED, + SWING_OFF_HAND, + CRITICAL_EFFECT, + MAGIC_CRITICAL_EFFECT; + /** + * @deprecated ids are different starting with 26.3, don't use them. + */ + @Deprecated public int id() { - return this.id; + return this.ordinal(); } } diff --git a/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/PacketEventsPacketAdapter.java b/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/PacketEventsPacketAdapter.java index 91ff762..36f90d6 100644 --- a/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/PacketEventsPacketAdapter.java +++ b/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/PacketEventsPacketAdapter.java @@ -48,6 +48,7 @@ import com.github.retrooper.packetevents.event.simple.PacketPlayReceiveEvent; import com.github.retrooper.packetevents.manager.player.PlayerManager; import com.github.retrooper.packetevents.manager.server.ServerVersion; +import com.github.retrooper.packetevents.protocol.component.builtin.item.ItemSwingAnimation; import com.github.retrooper.packetevents.protocol.entity.data.EntityData; import com.github.retrooper.packetevents.protocol.entity.data.EntityDataType; import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes; @@ -79,6 +80,7 @@ import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerPluginMessage; import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnEntity; import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnPlayer; +import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSwingAnimation; import com.google.common.collect.ImmutableMap; import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder; import io.github.retrooper.packetevents.util.SpigotReflectionUtil; @@ -104,7 +106,6 @@ final class PacketEventsPacketAdapter implements PlatformPacketAdapter { - // EntityAnimation (https://wiki.vg/Protocol#Entity_Animation_.28clientbound.29) + if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_26_3) + && (animation == EntityAnimation.SWING_MAIN_ARM || animation == EntityAnimation.SWING_OFF_HAND)) { + // main-/offhand swing is a separate packet + InteractionHand hand = + animation == EntityAnimation.SWING_MAIN_ARM ? InteractionHand.MAIN_HAND : InteractionHand.OFF_HAND; + PacketWrapper wrapper = new WrapperPlayServerSwingAnimation( + npc.entityId(), + hand, + Lazy.DEFAULT_SWING_ANIMATION); + this.packetPlayerManager.sendPacketSilently(player, wrapper); + return; + } + + // remap TAKE_DAMAGE to CRITICAL_EFFECT as it was removed in 1.19.3 + EntityAnimation finalAnimation = animation; + if (this.serverVersion.isNewerThanOrEquals(ServerVersion.V_1_19_3) && animation == EntityAnimation.TAKE_DAMAGE) { + finalAnimation = EntityAnimation.CRITICAL_EFFECT; + } + WrapperPlayServerEntityAnimation.EntityAnimationType animationType - = Lazy.ENTITY_ANIMATION_CONVERTER.get(animation); + = Lazy.ENTITY_ANIMATION_CONVERTER.get(finalAnimation); PacketWrapper wrapper = new WrapperPlayServerEntityAnimation(npc.entityId(), animationType); - - // send the packet without notifying any listeners this.packetPlayerManager.sendPacketSilently(player, wrapper); }; } @@ -450,6 +466,10 @@ private static final class Lazy { WrapperPlayServerPlayerInfoUpdate.Action.UPDATE_GAME_MODE, WrapperPlayServerPlayerInfoUpdate.Action.UPDATE_DISPLAY_NAME); + // default item swing animation (since 26.3) + private static final ItemSwingAnimation DEFAULT_SWING_ANIMATION = + new ItemSwingAnimation(ItemSwingAnimation.Type.WHACK, 6); + static { // associate item slots actions with their respective packet events enum ITEM_SLOT_CONVERTER = new EnumMap<>(ItemSlot.class); diff --git a/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/ProtocolLibPacketAdapter.java b/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/ProtocolLibPacketAdapter.java index 4a0835e..b1bbb42 100644 --- a/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/ProtocolLibPacketAdapter.java +++ b/bukkit/src/main/java/com/github/juliarn/npclib/bukkit/protocol/ProtocolLibPacketAdapter.java @@ -27,9 +27,11 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolManager; +import com.comphenix.protocol.events.InternalStructure; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; +import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.utility.MinecraftReflection; import com.comphenix.protocol.utility.MinecraftVersion; import com.comphenix.protocol.wrappers.EnumWrappers; @@ -77,6 +79,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -92,6 +95,7 @@ final class ProtocolLibPacketAdapter implements PlatformPacketAdapter ENTITY_POSE_CONVERTER; + private static final EnumMap ENTITY_ANIMATION_ID_LOOKUP; private static final EnumMap ITEM_SLOT_CONVERTER; private static final EnumMap HAND_CONVERTER; @@ -106,6 +110,9 @@ final class ProtocolLibPacketAdapter implements PlatformPacketAdapter WHACK_ANIMATION_TYPE; + static { // associate item slots with their respective protocol lib enum ITEM_SLOT_CONVERTER = new EnumMap<>(ItemSlot.class); @@ -193,6 +200,33 @@ final class ProtocolLibPacketAdapter implements PlatformPacketAdapter(EntityAnimation.class); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.SWING_MAIN_ARM, 0); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.TAKE_DAMAGE, 1); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.LEAVE_BED, 2); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.SWING_OFF_HAND, 3); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.CRITICAL_EFFECT, 4); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.MAGIC_CRITICAL_EFFECT, 5); + if (MinecraftVersion.FEATURE_PREVIEW_UPDATE.atOrAbove()) { + // 1.19.3+: TAKE_DAMAGE was removed, use CRITICAL_EFFECT instead + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.TAKE_DAMAGE, 4); + } + if (MinecraftVersion.v26_3.atOrAbove()) { + // 26.3+: SWING_MAIN_HAND/SWING_OFF_HAND were removed, all ids were shifted + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.LEAVE_BED, 0); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.TAKE_DAMAGE, 1); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.CRITICAL_EFFECT, 1); + ENTITY_ANIMATION_ID_LOOKUP.put(EntityAnimation.MAGIC_CRITICAL_EFFECT, 2); + ENTITY_ANIMATION_ID_LOOKUP.remove(EntityAnimation.SWING_MAIN_ARM); + ENTITY_ANIMATION_ID_LOOKUP.remove(EntityAnimation.SWING_OFF_HAND); + } + + // WHACK animation type + Class swingAnimType = MinecraftReflection.getNullableNMS("world.item.SwingAnimationType"); + //noinspection unchecked,rawtypes + WHACK_ANIMATION_TYPE = swingAnimType == null ? null : Enum.valueOf((Class) swingAnimType, "WHACK"); } // MonotonicNonNull, lazily initialized @@ -295,6 +329,13 @@ final class ProtocolLibPacketAdapter implements PlatformPacketAdapter { - // EntityAnimation (https://wiki.vg/Protocol#Entity_Animation_.28clientbound.29) - PacketContainer container = new PacketContainer(PacketType.Play.Server.ANIMATION); - - // entity id & animation id - container.getIntegers() - .write(0, npc.entityId()) - .write(1, animation.id()); + if (MinecraftVersion.v26_3.atOrAbove() + && (animation == EntityAnimation.SWING_MAIN_ARM || animation == EntityAnimation.SWING_OFF_HAND)) { + // main-/offhand swing is a separate packet + EnumWrappers.Hand hand = animation == EntityAnimation.SWING_MAIN_ARM + ? EnumWrappers.Hand.MAIN_HAND + : EnumWrappers.Hand.OFF_HAND; + PacketContainer container = new PacketContainer(PacketType.Play.Server.SWING_ANIMATION); + container.getIntegers().write(0, npc.entityId()); + container.getHands().write(0, hand); + + // modify the animation (default WHACK animation) + InternalStructure animationStructure = container.getStructures().read(1); + StructureModifier> animationTypeModifier = animationStructure.getModifier().withType(Enum.class); + animationStructure.getIntegers().write(0, 6); // duration + animationTypeModifier.write(0, WHACK_ANIMATION_TYPE); + + PROTOCOL_MANAGER.sendServerPacket(player, container, false); + return; + } - // send the packet without notifying any bound packet listeners + int animationId = ENTITY_ANIMATION_ID_LOOKUP.get(animation); + PacketContainer container = new PacketContainer(PacketType.Play.Server.ANIMATION); + container.getIntegers().write(0, npc.entityId()).write(1, animationId); PROTOCOL_MANAGER.sendServerPacket(player, container, false); }; } diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index 04529f5..7d08b97 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -55,7 +55,7 @@ tasks.shadowJar { } tasks.compileJava { - options.release = 21 + options.release = 25 } tasks.processResources { diff --git a/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/PlayerListMixin.java b/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/PlayerListMixin.java index e4a1a6f..c7cb564 100644 --- a/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/PlayerListMixin.java +++ b/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/PlayerListMixin.java @@ -46,12 +46,12 @@ public abstract class PlayerListMixin { @Inject(method = "placeNewPlayer", at = @At("TAIL")) public void npc_lib$placeNewPlayer( Connection connection, - ServerPlayer serverPlayer, - CommonListenerCookie commonListenerCookie, + ServerPlayer player, + CommonListenerCookie cookie, CallbackInfo ci ) { - var newLevel = serverPlayer.level(); + var newLevel = player.level(); var invoker = FabricActionControllerEvents.SERVER_PLAYER_LEVEL_CHANGE.invoker(); - invoker.levelChange(serverPlayer, null, newLevel); + invoker.levelChange(player, null, newLevel); } } diff --git a/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/ServerGamePacketListenerImplMixin.java b/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/ServerGamePacketListenerImplMixin.java index 441eeba..5ea7c72 100644 --- a/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/ServerGamePacketListenerImplMixin.java +++ b/fabric/src/main/java/com/github/juliarn/npclib/fabric/mixins/ServerGamePacketListenerImplMixin.java @@ -30,7 +30,7 @@ import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket; import net.minecraft.network.protocol.game.ServerboundMoveVehiclePacket; import net.minecraft.network.protocol.game.ServerboundPlayerInputPacket; -import net.minecraft.network.protocol.game.ServerboundSwingPacket; +import net.minecraft.network.protocol.game.ServerboundPunchPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.world.InteractionHand; @@ -67,8 +67,8 @@ public abstract class ServerGamePacketListenerImplMixin { } } - @Inject(method = "handleAnimate", at = @At("TAIL")) - public void npc_lib$handleAnimate(ServerboundSwingPacket packet, CallbackInfo ci) { + @Inject(method = "handlePunch", at = @At("TAIL")) + public void npc_lib$handlePunch(ServerboundPunchPacket packet, CallbackInfo ci) { var player = this.getPlayer(); var invoker = FabricActionControllerEvents.SERVER_PLAYER_HAND_SWING.invoker(); invoker.swingHand(player); @@ -120,17 +120,18 @@ public abstract class ServerGamePacketListenerImplMixin { public void npc_lib$handleMoveVehicle(ServerboundMoveVehiclePacket packet, CallbackInfo ci) { var player = this.getPlayer(); var rootVehicle = player.getRootVehicle(); + var newPosAndRot = packet.movingTo(); // get the target position, set to null in case it didn't change var posFrom = rootVehicle.position(); - var posTo = packet.position(); + var posTo = newPosAndRot.position(); if (posTo.equals(posFrom)) { posTo = null; } // get the target rotation, set to null in case it didn't change var rotFrom = rootVehicle.getRotationVector(); - var rotTo = new Vec2(packet.xRot(), packet.yRot()); + var rotTo = new Vec2(newPosAndRot.xRot(), newPosAndRot.yRot()); if (rotTo.equals(rotFrom)) { rotTo = null; } diff --git a/fabric/src/main/java/com/github/juliarn/npclib/fabric/protocol/FabricProtocolAdapter.java b/fabric/src/main/java/com/github/juliarn/npclib/fabric/protocol/FabricProtocolAdapter.java index 86d0656..4bffc54 100644 --- a/fabric/src/main/java/com/github/juliarn/npclib/fabric/protocol/FabricProtocolAdapter.java +++ b/fabric/src/main/java/com/github/juliarn/npclib/fabric/protocol/FabricProtocolAdapter.java @@ -72,6 +72,7 @@ import net.minecraft.network.protocol.game.ClientboundRotateHeadPacket; import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket; import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket; +import net.minecraft.network.protocol.game.ClientboundSwingAnimationPacket; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.resources.Identifier; @@ -83,6 +84,7 @@ import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.Pose; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.component.SwingAnimation; import net.minecraft.world.level.GameType; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.NotNull; @@ -322,7 +324,20 @@ private FabricProtocolAdapter() { @NotNull EntityAnimation animation ) { return (player, npc) -> { - var packet = new ClientboundAnimatePacket(player, animation.id()); + if (animation == EntityAnimation.SWING_MAIN_ARM || animation == EntityAnimation.SWING_OFF_HAND) { + var hand = animation == EntityAnimation.SWING_MAIN_ARM ? InteractionHand.MAIN_HAND : InteractionHand.OFF_HAND; + var packet = new ClientboundSwingAnimationPacket(npc.entityId(), hand, SwingAnimation.DEFAULT); + player.connection.send(packet); + return; + } + + var animationId = switch (animation) { + case LEAVE_BED -> ClientboundAnimatePacket.WAKE_UP; + case MAGIC_CRITICAL_EFFECT -> ClientboundAnimatePacket.MAGIC_CRITICAL_HIT; + case CRITICAL_EFFECT, TAKE_DAMAGE -> ClientboundAnimatePacket.CRITICAL_HIT; + case SWING_MAIN_ARM, SWING_OFF_HAND -> throw new AssertionError("Must not reach here"); + }; + var packet = new ClientboundAnimatePacket(player, animationId); packet.id = npc.entityId(); player.connection.send(packet); }; diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 61d8a26..83ef14d 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -19,8 +19,8 @@ "accessWidener": "npc_lib.accesswidener", "depends": { "fabricloader": ">=0.17.0", - "minecraft": "~26.2", - "java": ">=21", + "minecraft": "~26.3", + "java": ">=25", "fabric-networking-api-v1": "*" } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 97d3236..6eb749b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,32 +1,32 @@ [versions] # plugins -shadow = "9.6.0" -spotless = "8.8.0" +shadow = "9.6.1" +spotless = "8.10.3" nexusPublish = "2.0.0" -checkstyleTools = "13.8.0" +checkstyleTools = "14.3.0" # general gson = "2.14.0" -slf4j = "2.0.18" +slf4j = "2.0.20" geantyref = "1.3.16" annotations = "26.1.0" netty = "4.1.117.Final" # platform api versions sponge = "10.0.0" -paper = "26.2.build.62-beta" +paper = "26.3.build.49-alpha" minestom = "2026.07.12-26.2" # fabric -minecraft = "26.2" -fabricLoom = "1.17.16" -fabricLoader = "0.19.3" -fabricApi = "0.155.2+26.2" +minecraft = "26.3" +fabricLoom = "1.18.2" +fabricLoader = "0.19.5" +fabricApi = "0.161.0+26.3" # platform extensions -packetEvents = "2.13.0" -protocolLib = "8eeb82f89d" +packetEvents = "2.14.0" +protocolLib = "583353e9fa" [libraries] diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index b1b8ef5..5097068 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a9db115..9b7cb4a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/gradlew.bat b/gradlew.bat index a51ec4f..3185a43 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,33 @@ @rem Set local scope for the variables, and ensure extensions are enabled setlocal EnableExtensions +@rem Catch executions from older scripts and ensure they exit cleanly. +@rem This can be removed once we can be reasonably confident that few people +@rem will be migrating directly to this new wrapper. +goto afterSafetyNet +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto exitWithErrorLevel +:afterSafetyNet + set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @rem This is normally unused @@ -45,13 +72,14 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. "%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -59,13 +87,14 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. "%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :execute @rem Setup the command line @@ -75,8 +104,9 @@ echo location of your Java installation. 1>&2 @rem Execute gradlew @rem endlocal doesn't take effect until after the line is parsed and variables are expanded @rem which allows us to clear the local environment before executing the java command -endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel +@rem This label must not be changed. We rely on old scripts being able to jump to this point. :exitWithErrorLevel @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts "%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/jitpack.yml b/jitpack.yml index 293d510..6686a6f 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,4 +1,4 @@ before_install: - sdk update - - sdk install java 21-zulu - - sdk use java 21-zulu + - sdk install java 25-zulu + - sdk use java 25-zulu