Skip to content

Commit 1f98e95

Browse files
authored
Velocity prevent fishing rod pull (#4439)
1 parent fc1c83a commit 1f98e95

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3+
* Copyright (c) Meteor Development.
4+
*/
5+
6+
package meteordevelopment.meteorclient.mixin;
7+
8+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
9+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
10+
import meteordevelopment.meteorclient.systems.modules.Modules;
11+
import meteordevelopment.meteorclient.systems.modules.movement.Velocity;
12+
import net.minecraft.entity.Entity;
13+
import net.minecraft.entity.projectile.FishingBobberEntity;
14+
import org.spongepowered.asm.mixin.Mixin;
15+
import org.spongepowered.asm.mixin.injection.At;
16+
17+
import static meteordevelopment.meteorclient.MeteorClient.mc;
18+
19+
@Mixin(FishingBobberEntity.class)
20+
public class FishingBobberEntityMixin {
21+
@WrapOperation(method = "handleStatus", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/projectile/FishingBobberEntity;pullHookedEntity(Lnet/minecraft/entity/Entity;)V"))
22+
private void preventFishingRodPull(FishingBobberEntity instance, Entity entity, Operation<Void> original) {
23+
if (!instance.getWorld().isClient || entity != mc.player) original.call(instance, entity);
24+
25+
Velocity velocity = Modules.get().get(Velocity.class);
26+
if (!velocity.isActive() || !velocity.fishing.get()) original.call(instance, entity);
27+
}
28+
}

src/main/java/meteordevelopment/meteorclient/systems/modules/movement/Velocity.java

+7
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ public class Velocity extends Module {
126126
.build()
127127
);
128128

129+
public final Setting<Boolean> fishing = sgGeneral.add(new BoolSetting.Builder()
130+
.name("fishing")
131+
.description("Prevents you from being pulled by fishing rods.")
132+
.defaultValue(false)
133+
.build()
134+
);
135+
129136
public Velocity() {
130137
super(Categories.Movement, "velocity", "Prevents you from being moved by external forces.");
131138
}

src/main/resources/meteor-client.mixins.json

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"FireworkRocketEntityMixin",
9191
"FireworksSparkParticleMixin",
9292
"FireworksSparkParticleSubMixin",
93+
"FishingBobberEntityMixin",
9394
"FluidRendererMixin",
9495
"FoliageColorsMixin",
9596
"GameOptionsMixin",

0 commit comments

Comments
 (0)