Skip to content
Merged
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
4 changes: 4 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ dependencies {
// Simply Stacked Dimensions
implementation fg.deobf("curse.maven:simply-stacked-dimensions-523416:5562948") { transitive = false }

// Grappling Hook -- needless dependencies are dumb
implementation fg.deobf("curse.maven:cloth-config-348521:5729105")
implementation fg.deobf("curse.maven:grappling-hook-mod-reforged-1166811:6028357") { transitive = false }

// Hang Glider
implementation fg.deobf("maven.modrinth:puzzles-lib:${puzzleslib_version}")
implementation fg.deobf("maven.modrinth:hang-glider:${hangglider_version}")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* This file includes code from Grappling Hook - Reforged (https://www.curseforge.com/minecraft/mc-mods/grappling-hook-mod-reforged)
* Copyright (c) 2024 Chummycho
* Licensed under the GPLv3 License
*/
package su.terrafirmagreg.core.mixins.common.grappling_hook;


import com.llamalad7.mixinextras.sugar.Local;
import com.yyon.grapplinghook.controllers.AirfrictionController;
import com.yyon.grapplinghook.controllers.GrappleController;
import com.yyon.grapplinghook.utils.GrappleCustomization;
import com.yyon.grapplinghook.utils.Vec;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.Level;
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.CallbackInfo;

@Mixin(value = AirfrictionController.class, remap = false)
public class AirFrictionControllerMixin extends GrappleController {

public AirFrictionControllerMixin(int grapplehookEntityId, int entityId, Level world, Vec pos, int controllerid, GrappleCustomization custom) {
super(grapplehookEntityId, entityId, world, pos, controllerid, custom);
}

@Inject(method = "updatePlayerPos", at = @At(value = "NEW", target = "(DDD)Lcom/yyon/grapplinghook/utils/Vec;", ordinal = 0), cancellable = true)
private void tfg$injectLadderFix(CallbackInfo ci, @Local Entity entity) {
if (entity instanceof LivingEntity living && living.onClimbable()) {
this.unattach();
ci.cancel();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* This file includes code from Grappling Hook - Reforged (https://www.curseforge.com/minecraft/mc-mods/grappling-hook-mod-reforged)
* Copyright (c) 2024 Chummycho
* Licensed under the GPLv3 License
*/
package su.terrafirmagreg.core.mixins.common.grappling_hook;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.yyon.grapplinghook.controllers.GrappleController;
import com.yyon.grapplinghook.utils.Vec;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(value = GrappleController.class, remap = false)
public class GrappleControllerMixin {
@Shadow
public Vec motion;

@Shadow
public Entity entity;

@WrapOperation(method = "doubleJump", at = @At(value = "INVOKE", target = "Lcom/yyon/grapplinghook/utils/Vec;setMotion(Lnet/minecraft/world/entity/Entity;)V"))
private void tfg$resetFallDistanceOnDoubleJump(Vec instance, Entity e, Operation<Void> original) {
this.motion.setMotion(e);
e.resetFallDistance();
}
}
2 changes: 2 additions & 0 deletions src/main/resources/tfg.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"common.firmalife.HydroponicPlanterBlockEntityMixin",
"common.firmalife.MixinGreenhousePortBlock",
"common.flywheel.AnimatedBlazeBurnerMixin",
"common.grappling_hook.AirFrictionControllerMixin",
"common.grappling_hook.GrappleControllerMixin",
"common.greate.TieredCrushingCategoryMixin",
"common.greate.TieredCrushingRecipeMixin",
"common.greate.TieredMillingCategoryMixin",
Expand Down