Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
06ED committed Aug 18, 2024
2 parents f2382c3 + a1d35b5 commit 364fcd6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/thunder/hack/features/modules/misc/AntiAttack.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.ZombifiedPiglinEntity;
import net.minecraft.entity.passive.DonkeyEntity;
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
import org.jetbrains.annotations.NotNull;
import thunder.hack.ThunderHack;
import thunder.hack.core.Managers;
import thunder.hack.events.impl.PacketEvent;
import thunder.hack.features.modules.Module;
import thunder.hack.features.modules.combat.AutoAnchor;
import thunder.hack.setting.Setting;

import static thunder.hack.features.modules.combat.Criticals.getEntity;
Expand All @@ -18,6 +21,8 @@ public final class AntiAttack extends Module {
private final Setting<Boolean> friend = new Setting<>("Friend", true);
private final Setting<Boolean> zoglin = new Setting<>("Zoglin", true);
private final Setting<Boolean> villager = new Setting<>("Villager", false);
private final Setting<Boolean> oneHp = new Setting<>("OneHp", false);
private final Setting<Float> hp = new Setting<>("Hp", 1f, 0f, 20f, v -> oneHp.getValue());

public AntiAttack() {
super("AntiAttack", Category.PLAYER);
Expand All @@ -36,6 +41,11 @@ private void onPacketSend(PacketEvent.@NotNull Send e) {
if(entity instanceof VillagerEntity && villager.getValue()){
e.cancel();
}
else if(oneHp.getValue() && entity instanceof LivingEntity lent){
if(lent.getHealth() <= hp.getValue()){
e.cancel();
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public NoRender() {
public final Setting<Boolean> noWeather = new Setting<>("NoWeather", false);
public final Setting<Boolean> noArmorStands = new Setting<>("NoArmorStands", false);
public final Setting<Boolean> spawnerEntity = new Setting<>("SpawnerEntity", false);
public final Setting<Boolean> hotbarItemName = new Setting<>("HotbarItemName", false);

private int potionCouter, xpCounter, arrowCounter, itemsCounter;

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/thunder/hack/injection/MixinInGameHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public void renderHotbarCustom(DrawContext context, RenderTickCounter tickCounte
}
}


@Inject(at = @At(value = "HEAD"), method = "renderHeldItemTooltip", cancellable = true)
public void renderHeldItemTooltipHook(DrawContext context, CallbackInfo ci) {
if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.hotbarItemName.getValue())
ci.cancel();
}

@Inject(at = @At(value = "HEAD"), method = "renderStatusEffectOverlay", cancellable = true)
public void renderStatusEffectOverlayHook(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
if (ModuleManager.potionHud.isEnabled() || (ModuleManager.legacyHud.isEnabled() && ModuleManager.legacyHud.potions.getValue())) {
Expand Down

0 comments on commit 364fcd6

Please sign in to comment.