|
| 1 | +/* |
| 2 | + * Copyright 2025 Lambda |
| 3 | + * |
| 4 | + * This program is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +package com.lambda.module.modules.debug |
| 19 | + |
| 20 | +import com.lambda.config.groups.RotationSettings |
| 21 | +import com.lambda.event.events.TickEvent |
| 22 | +import com.lambda.event.listener.SafeListener.Companion.listen |
| 23 | +import com.lambda.interaction.request.rotating.visibilty.lookAtHit |
| 24 | +import com.lambda.module.Module |
| 25 | +import com.lambda.module.tag.ModuleTag |
| 26 | +import com.lambda.util.Communication.info |
| 27 | +import com.lambda.util.combat.DamageUtils.fallDamage |
| 28 | +import com.lambda.util.combat.DamageUtils.isFallDeadly |
| 29 | +import net.minecraft.util.hit.HitResult |
| 30 | +import net.minecraft.util.math.Vec3d |
| 31 | + |
| 32 | +object RotationTest : Module( |
| 33 | + name = "RotationTest", |
| 34 | + tag = ModuleTag.DEBUG, |
| 35 | +) { |
| 36 | + var rotation = RotationSettings(this) |
| 37 | + var hitPos: HitResult? = null |
| 38 | + |
| 39 | + init { |
| 40 | + onEnable { |
| 41 | + hitPos = mc.crosshairTarget |
| 42 | + } |
| 43 | + |
| 44 | + listen<TickEvent.Pre> { |
| 45 | + hitPos?.let { lookAtHit(it)?.requestBy(rotation) } |
| 46 | + } |
| 47 | + } |
| 48 | +} |
0 commit comments