From 1ec286c807542289c7a6aae56e5e62184db65830 Mon Sep 17 00:00:00 2001 From: Rhys <98863820+rhysdh540@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:49:01 +0800 Subject: [PATCH] update ExpectPlatform how amazing, now i can use PlatformOnly --- build.gradle.kts | 5 ++--- buildSrc/build.gradle.kts | 6 ++++++ gradle.properties | 2 +- .../asm/mixin/ExtendoGripItemMixin.java | 10 ++++++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0a7ae75..303afd6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,7 @@ allprojects { includeGroup("curse.maven") } } - maven("https://maven.wagyourtail.xyz/snapshots") + maven("https://maven.wagyourtail.xyz/releases") } tasks.withType { @@ -94,8 +94,7 @@ allprojects { } compileOnly("io.github.llamalad7:mixinextras-common:${"mixin_extras_version"()}") -// compileOnly(expectPlatform.annotationsDep) - compileOnly("xyz.wagyourtail.unimined.expect-platform:expect-platform:1.0.0-20240605.031731-2:annotations") + compileOnly(expectPlatform.annotationsDep) } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 9f454d0..5d307ef 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -23,6 +23,12 @@ fun DependencyHandler.plugin(id: String, version: String) { tasks.compileKotlin { compilerOptions.languageVersion.set(KotlinVersion.KOTLIN_2_0) + kotlinOptions.jvmTarget = "17" +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } val gradleProperties = Properties().apply { diff --git a/gradle.properties b/gradle.properties index 2d54156..dc63bf6 100755 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ mixin.debug = true # gradle plugin versions unimined_version = 1.2.6 -expectplatform_version = 1.0.0-SNAPSHOT +expectplatform_version = 1.0.2 forgix_version = 1.2.9 shadow_version = 8.1.1 diff --git a/src/main/java/dev/rdh/createunlimited/asm/mixin/ExtendoGripItemMixin.java b/src/main/java/dev/rdh/createunlimited/asm/mixin/ExtendoGripItemMixin.java index f85564c..5b4dc30 100644 --- a/src/main/java/dev/rdh/createunlimited/asm/mixin/ExtendoGripItemMixin.java +++ b/src/main/java/dev/rdh/createunlimited/asm/mixin/ExtendoGripItemMixin.java @@ -16,6 +16,8 @@ import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; +import xyz.wagyourtail.unimined.expect.annotation.PlatformOnly; + import dev.rdh.createunlimited.Util; import dev.rdh.createunlimited.config.CUConfigs; @@ -30,7 +32,7 @@ public abstract class ExtendoGripItemMixin { "holdingExtendoGripIncreasesRange(Lnet/minecraft/world/entity/LivingEntity;)V", "addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/nbt/CompoundTag;)V", }, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;")) -// @PlatformOnly(PlatformOnly.FABRIC) + @PlatformOnly(PlatformOnly.FABRIC) private static Supplier> modifySingleFabric(Supplier original) { return cu$singleRange(); } @@ -40,7 +42,7 @@ private static Supplier> modifySingleFabr "holdingExtendoGripIncreasesRange(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V", "addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V" }, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;")) -// @PlatformOnly(PlatformOnly.FORGE) + @PlatformOnly(PlatformOnly.FORGE) private static Supplier> modifySingleForge(Supplier original) { return cu$singleRange(); } @@ -50,7 +52,7 @@ private static Supplier> modifySingleForg "holdingExtendoGripIncreasesRange(Lnet/minecraft/world/entity/LivingEntity;)V", "addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/nbt/CompoundTag;)V", }, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;")) -// @PlatformOnly(PlatformOnly.FABRIC) + @PlatformOnly(PlatformOnly.FABRIC) private static Supplier> modifyDoubleFabric(Supplier original) { return cu$doubleRange(); } @@ -60,7 +62,7 @@ private static Supplier> modifyDoubleFabr "holdingExtendoGripIncreasesRange(Lnet/minecraftforge/event/entity/living/LivingEvent$LivingTickEvent;)V", "addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V" }, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;")) -// @PlatformOnly(PlatformOnly.FORGE) + @PlatformOnly(PlatformOnly.FORGE) private static Supplier> modifyDoubleForge(Supplier original) { return cu$doubleRange(); }