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

Commit

Permalink
Delay for one hit entities in KullAura
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekiplay committed Apr 22, 2024
1 parent 5e580ba commit 36b3023
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: "1.20.4_1.0.8.3"
prerelease: true
title: "1.20.4 | 1.0.8.4"
title: "1.20.4 | 1.0.8.5"
files: |
./build/libs/*.jar
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.20.4+build.2
loader_version=0.15.1

# Mod Properties
mod_version=1.0.8.4
mod_version=1.0.8.5
maven_group=nekiplay.meteorplus
archives_base_name=meteor-plus

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nekiplay.meteorplus.mixin.meteorclient.modules;

import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.IntSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Category;
Expand Down Expand Up @@ -76,6 +77,28 @@ public Entity getTarget() {
.build()
);

@Unique
private final Setting<Boolean> customDelay = sgTiming.add(new BoolSetting.Builder()
.name("custom-delay-for-one-hit-entities")
.defaultValue(true)
.visible(() -> entities.get().contains(EntityType.SHULKER_BULLET) || entities.get().contains(EntityType.FIREBALL))
.build()
);

@Unique
private final Setting<Integer> hitDelay = sgTiming.add(new IntSetting.Builder()
.name("delay-for-one-hit-entities")
.description("How fast you hit the entity in ticks.")
.defaultValue(2)
.min(0)
.sliderMax(60)
.visible(() -> customDelay.get())
.build()
);

@Unique
private int hitTimer;

public KillAuraMixin(Category category, String name, String description) {
super(category, name, description);
}
Expand All @@ -85,11 +108,31 @@ 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);

float delay = (customDelay.get()) ? hitDelay.get() : 0.5f;

if (oneHitEntity()) {
if (customDelay.get()) {
if (hitTimer < delay) {
hitTimer++;
cir.setReturnValue(false);
} else {
if (ignoreOnlyCritsForOneHitEntity.get()) {
cir.setReturnValue(true);
hitTimer = 0;
} else if (oneHitEntity() && ignoreSmartDelayForShulkerBulletAndGhastCharge.get() && !onlyCrits.get()) {
cir.setReturnValue(true);
hitTimer = 0;
}
}
}
else {
if (ignoreOnlyCritsForOneHitEntity.get()) {
cir.setReturnValue(true);
} else if (oneHitEntity() && ignoreSmartDelayForShulkerBulletAndGhastCharge.get() && !onlyCrits.get()) {
cir.setReturnValue(true);
}
}
}
}

Expand Down

0 comments on commit 36b3023

Please sign in to comment.