diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle index 35a2c5a2..b155cdd2 100644 --- a/buildSrc/src/main/groovy/multiloader-common.gradle +++ b/buildSrc/src/main/groovy/multiloader-common.gradle @@ -177,7 +177,8 @@ processResources { 'java_version' : java_version, 'veil_version' : veil_version, 'sodium_version' : sodium_version, - 'sable_companion_version' : sable_companion_version + 'sable_companion_version' : sable_companion_version, + 'shouldersurfing_version' : shouldersurfing_version ] filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) { @@ -217,4 +218,4 @@ publishing { } } } -} \ No newline at end of file +} diff --git a/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/ObjectPickerMixin.java b/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/ObjectPickerMixin.java index ee752b2e..603f1926 100644 --- a/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/ObjectPickerMixin.java +++ b/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/ObjectPickerMixin.java @@ -1,8 +1,7 @@ package dev.ryanhcode.sable.mixin.compatibility.shouldersurfing; -import com.github.exopandora.shouldersurfing.api.model.PickContext; -import com.github.exopandora.shouldersurfing.client.ObjectPicker; -import com.llamalad7.mixinextras.injector.ModifyReturnValue; +import com.github.exopandora.shouldersurfing.api.client.world.phys.PickContext; +import com.github.exopandora.shouldersurfing.client.world.phys.ObjectPicker; import com.llamalad7.mixinextras.sugar.Local; import dev.ryanhcode.sable.Sable; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/PerspectiveMixin.java b/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/PerspectiveMixin.java index 89e36d9c..de0c8561 100644 --- a/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/PerspectiveMixin.java +++ b/common/src/main/java/dev/ryanhcode/sable/mixin/compatibility/shouldersurfing/PerspectiveMixin.java @@ -1,8 +1,8 @@ package dev.ryanhcode.sable.mixin.compatibility.shouldersurfing; -import com.github.exopandora.shouldersurfing.api.client.IClientConfig; -import com.github.exopandora.shouldersurfing.api.model.CrosshairVisibility; -import com.github.exopandora.shouldersurfing.api.model.Perspective; +import com.github.exopandora.shouldersurfing.api.client.CrosshairVisibility; +import com.github.exopandora.shouldersurfing.api.client.Perspective; +import com.github.exopandora.shouldersurfing.api.config.IPerspectiveConfig; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.lib.apache.commons.ArrayUtils; @@ -45,8 +45,8 @@ private static Perspective create(final String name, final int ordinal, final Ca } @SuppressWarnings("ConstantValue") - @WrapOperation(method = "next", at = @At(value = "INVOKE", target = "Lcom/github/exopandora/shouldersurfing/api/client/IClientConfig;replaceDefaultPerspective()Z")) - public boolean nextPerspective(final IClientConfig instance, final Operation original) { + @WrapOperation(method = "next", at = @At(value = "INVOKE", target = "Lcom/github/exopandora/shouldersurfing/api/config/IPerspectiveConfig;isThirdPersonReplaced()Z")) + public boolean nextPerspective(final IPerspectiveConfig instance, final Operation original) { if ((Object) this == SablePerspectives.SUB_LEVEL_VIEW || (Object) this == SablePerspectives.SUB_LEVEL_VIEW_UNLOCKED) { return false; } @@ -54,8 +54,8 @@ public boolean nextPerspective(final IClientConfig instance, final Operation original) { + @WrapOperation(method = "togglePerspective", at = @At(value = "INVOKE", target = "Lcom/github/exopandora/shouldersurfing/api/client/Perspective;next(Lcom/github/exopandora/shouldersurfing/api/config/IPerspectiveConfig;)Lcom/github/exopandora/shouldersurfing/api/client/Perspective;")) + public Perspective next(final Perspective instance, final IPerspectiveConfig config, final Operation original) { final Entity cameraEntity = Minecraft.getInstance().cameraEntity; Perspective next = original.call(instance, config); diff --git a/common/src/main/java/dev/ryanhcode/sable/mixinhelpers/compatibility/shouldersurfing/SablePerspectives.java b/common/src/main/java/dev/ryanhcode/sable/mixinhelpers/compatibility/shouldersurfing/SablePerspectives.java index 54f4a539..debb264c 100644 --- a/common/src/main/java/dev/ryanhcode/sable/mixinhelpers/compatibility/shouldersurfing/SablePerspectives.java +++ b/common/src/main/java/dev/ryanhcode/sable/mixinhelpers/compatibility/shouldersurfing/SablePerspectives.java @@ -1,6 +1,6 @@ package dev.ryanhcode.sable.mixinhelpers.compatibility.shouldersurfing; -import com.github.exopandora.shouldersurfing.api.model.Perspective; +import com.github.exopandora.shouldersurfing.api.client.Perspective; public class SablePerspectives { diff --git a/common/src/main/resources/sable.mixins.json b/common/src/main/resources/sable.mixins.json index 0d735015..21604d6f 100644 --- a/common/src/main/resources/sable.mixins.json +++ b/common/src/main/resources/sable.mixins.json @@ -115,7 +115,7 @@ "compatibility.shouldersurfing.EntityHelperMixin", "compatibility.shouldersurfing.PerspectiveMixin", "compatibility.shouldersurfing.ShoulderSurfingCameraMixin", - "compatibility.shouldersurfing.ShoulderSurfingImplMixin", + "compatibility.shouldersurfing.ShoulderSurfingMixin", "compatibility.vista.LODMixin", "compatibility.vista.ViewFinderAccessMixin", "compatibility.vista.ViewFinderControllerMixin", diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 64bbf9cb..d1cf22c0 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -48,6 +48,7 @@ "breaks": { "sodium": "<${sodium_version}", "scalablelux": "*", - "sablecompanion": "<${sable_companion_version}" + "sablecompanion": "<${sable_companion_version}", + "shouldersurfing": "<${shouldersurfing_companion_version}" } } diff --git a/gradle.properties b/gradle.properties index d7f3cf59..4f2b93e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -56,7 +56,7 @@ iris_version=1.8.12+1.21.1-neoforge distant_horizons_version=2.2.1-a-1.21.1 nml_version=1.4.3 sodiumextras_version=1.0.8 -shouldersurfing_version=4.22.10 +shouldersurfing_version=5.0.0 loom.ignoreDependencyLoomVersionValidation=true diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index eb12e467..2bee22e2 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -65,6 +65,12 @@ type = "incompatible" versionRange = "(,${sodium_version})" reason = "${mod_name} supports Sodium ${sodium_version} and above" +[[dependencies.sable]] +modId = "shouldersurfing" +type = "incompatible" +versionRange = "(,${minecraft_version}-${shouldersurfing_version})" +reason = "${mod_name} supports Shoulder Surfing Reloaded ${shouldersurfing_version} and above" + [[dependencies.sable]] modId = "scalablelux" type = "incompatible"