I am trying to make a mod that disables leawind’s third person when i am on a VS ship. however, i am having some difficulty has anyone enoucntered this error?
error: cannot access class_1297
Ship ship = VSGameUtilsKt.getShipManaging(client.player);
^
class file for net.minecraft.class_1297 not found
1 error
Here is the code
package notnv.ls_vs_compat.mixin;
import com.github.leawind.thirdperson.ThirdPerson;
import net.minecraft.client.MinecraftClient;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
@Mixin(ThirdPerson.class)
public class ThirdPersonAvailabilityMixin {
/**
* Inject into ThirdPerson.isAvailable(). If the player is on a ship, force the method to return false,
* disabling Third Person mode. Otherwise, let it return its normal value.
*/
@Inject(method = "isAvailable", at = @At("HEAD"), cancellable = true, remap = false)
private static void onIsAvailable(CallbackInfoReturnable<Boolean> cir) {
MinecraftClient client = MinecraftClient.getInstance();
if (client.player != null) {
// Use Valkyrien Skies utility to check if the player is on a ship.
Ship ship = VSGameUtilsKt.getShipManaging(client.player);
if (ship != null) {
// Player is on a ship; disable Third Person by returning false.
cir.setReturnValue(false);
}
}
}
}