Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Now has best killaura for PvE
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekiplay committed Apr 22, 2024
1 parent 0e2f5f2 commit a6eec4e
Showing 1 changed file with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import nekiplay.meteorplus.features.modules.combat.Teams;
import nekiplay.meteorplus.features.modules.combat.criticals.CriticalsPlus;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.player.PlayerEntity;
import nekiplay.meteorplus.features.modules.combat.AntiBotPlus;
import org.spongepowered.asm.mixin.Final;
Expand All @@ -21,12 +22,35 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@Mixin(value = KillAura.class, remap = false, priority = 1001)
public class KillAuraMixin extends Module {
@Final
@Shadow
private final SettingGroup sgTiming = settings.getGroup("Timing");

@Final
@Shadow
private final SettingGroup sgTargeting = settings.getGroup("Targeting");

@Final
@Shadow
private final Setting<Set<EntityType<?>>> entities = (Setting<Set<EntityType<?>>>) sgTargeting.get("entities");

@Final
@Shadow
private final List<Entity> targets = new ArrayList<>();

@Shadow

public Entity getTarget() {
if (!targets.isEmpty()) return targets.get(0);
return null;
}

@Unique
private final Setting<Boolean> onlyCrits = sgTiming.add(new BoolSetting.Builder()
.name("only-crits")
Expand All @@ -35,6 +59,24 @@ public class KillAuraMixin extends Module {
.build()
);

@Unique
private final Setting<Boolean> ignoreSmartDelayForShulkerBulletAndGhastCharge = sgTiming.add(new BoolSetting.Builder()
.name("ignore-delay-for-one-hit-entities")
.description("Ignore attack delay for shulker bullet and fireball.")
.defaultValue(true)
.visible(() -> entities.get().contains(EntityType.SHULKER_BULLET) || entities.get().contains(EntityType.FIREBALL))
.build()
);

@Unique
private final Setting<Boolean> ignoreOnlyCritsForOneHitEntity = sgTiming.add(new BoolSetting.Builder()
.name("ignore-only-crits-for-one-hit-entityies")
.description("Ignore only crits delay for shulker bullet and fireball.")
.defaultValue(true)
.visible(() -> ignoreSmartDelayForShulkerBulletAndGhastCharge.get() && onlyCrits.get())
.build()
);

public KillAuraMixin(Category category, String name, String description) {
super(category, name, description);
}
Expand All @@ -44,8 +86,23 @@ private void delayCheck(CallbackInfoReturnable<Boolean> cir) {
if (onlyCrits.get() && !CriticalsPlus.allowCrit()) {
cir.setReturnValue(false);
}
else if (ignoreOnlyCritsForOneHitEntity.get() && oneHitEntity()) {
cir.setReturnValue(true);
}
else if (oneHitEntity() && ignoreSmartDelayForShulkerBulletAndGhastCharge.get() && !onlyCrits.get()) {
cir.setReturnValue(true);
}
}

@Unique
private boolean oneHitEntity() {
if (ignoreSmartDelayForShulkerBulletAndGhastCharge.get() && getTarget() != null && (getTarget().getType() == EntityType.FIREBALL || getTarget().getType() == EntityType.SHULKER_BULLET)) {
return true;
}
return false;
}


@Inject(method = "entityCheck", at = @At("RETURN"), cancellable = true)
protected void entityCheck(Entity entity, CallbackInfoReturnable<Boolean> cir) {
AntiBotPlus antiBotPlus = Modules.get().get(AntiBotPlus.class);
Expand Down

0 comments on commit a6eec4e

Please sign in to comment.