forked from RepoMirrors/kami-blue
parent
4249cbc95f
commit
e736bc4442
|
@ -2,6 +2,7 @@ package me.zeroeightsix.kami.mixin.client;
|
|||
|
||||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.event.events.EntityEvent;
|
||||
import me.zeroeightsix.kami.module.modules.movement.SafeWalk;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -26,4 +27,9 @@ public class MixinEntity {
|
|||
entity.isAirBorne = true;
|
||||
}
|
||||
|
||||
@Redirect(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isSneaking()Z"))
|
||||
public boolean isSneaking(Entity entity) {
|
||||
return SafeWalk.shouldSafewalk() || entity.isSneaking();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package me.zeroeightsix.kami.module.modules.movement;
|
||||
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
|
||||
/**
|
||||
* Created by 086 on 11/10/2018.
|
||||
*/
|
||||
@Module.Info(name = "SafeWalk", category = Module.Category.MOVEMENT, description = "Keeps you from walking off edges")
|
||||
public class SafeWalk extends Module {
|
||||
|
||||
private static SafeWalk INSTANCE;
|
||||
|
||||
public SafeWalk() {
|
||||
INSTANCE = this;
|
||||
}
|
||||
|
||||
public static boolean shouldSafewalk() {
|
||||
return INSTANCE.isEnabled();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue