Skip to content

Commit

Permalink
update ExpectPlatform
Browse files Browse the repository at this point in the history
how amazing, now i can use PlatformOnly
  • Loading branch information
rhysdh540 committed Jun 6, 2024
1 parent da65447 commit 1ec286c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ allprojects {
includeGroup("curse.maven")
}
}
maven("https://maven.wagyourtail.xyz/snapshots")
maven("https://maven.wagyourtail.xyz/releases")
}

tasks.withType<JavaCompile> {
Expand Down Expand Up @@ -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)
}
}

Expand Down
6 changes: 6 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<Multimap<Attribute, AttributeModifier>> modifySingleFabric(Supplier<?> original) {
return cu$singleRange();
}
Expand All @@ -40,7 +42,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> 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<Multimap<Attribute, AttributeModifier>> modifySingleForge(Supplier<?> original) {
return cu$singleRange();
}
Expand All @@ -50,7 +52,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> 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<Multimap<Attribute, AttributeModifier>> modifyDoubleFabric(Supplier<?> original) {
return cu$doubleRange();
}
Expand All @@ -60,7 +62,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> 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<Multimap<Attribute, AttributeModifier>> modifyDoubleForge(Supplier<?> original) {
return cu$doubleRange();
}
Expand Down

0 comments on commit 1ec286c

Please sign in to comment.