Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down Expand Up @@ -217,4 +218,4 @@ publishing {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,17 +45,17 @@ 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<Boolean> 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<Boolean> original) {
if ((Object) this == SablePerspectives.SUB_LEVEL_VIEW || (Object) this == SablePerspectives.SUB_LEVEL_VIEW_UNLOCKED) {
return false;
}
return original.call(instance);
}

@ModifyVariable(method = "next", at = @At(value = "STORE"), name = "next")
public Perspective next(final Perspective next, @Local(argsOnly = true) final IClientConfig config) {
if (config.replaceDefaultPerspective()) {
public Perspective next(final Perspective next, @Local(argsOnly = true) final IPerspectiveConfig config) {
if (config.isThirdPersonReplaced()) {
if ((Object) this == Perspective.SHOULDER_SURFING) {
return SablePerspectives.SUB_LEVEL_VIEW;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.Perspective;
import com.github.exopandora.shouldersurfing.client.ShoulderSurfingImpl;
import com.github.exopandora.shouldersurfing.api.client.Perspective;
import com.github.exopandora.shouldersurfing.api.config.IPerspectiveConfig;
import com.github.exopandora.shouldersurfing.client.ShoulderSurfing;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import dev.ryanhcode.sable.Sable;
Expand All @@ -12,11 +12,11 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(ShoulderSurfingImpl.class)
public class ShoulderSurfingImplMixin {
@Mixin(ShoulderSurfing.class)
public class ShoulderSurfingMixin {

@WrapOperation(method = "togglePerspective", at = @At(value = "INVOKE", target = "Lcom/github/exopandora/shouldersurfing/api/model/Perspective;next(Lcom/github/exopandora/shouldersurfing/api/client/IClientConfig;)Lcom/github/exopandora/shouldersurfing/api/model/Perspective;"))
public Perspective next(final Perspective instance, final IClientConfig config, final Operation<Perspective> 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<Perspective> original) {
final Entity cameraEntity = Minecraft.getInstance().cameraEntity;

Perspective next = original.call(instance, config);
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/sable.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"breaks": {
"sodium": "<${sodium_version}",
"scalablelux": "*",
"sablecompanion": "<${sable_companion_version}"
"sablecompanion": "<${sable_companion_version}",
"shouldersurfing": "<${shouldersurfing_companion_version}"
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down