use of meteordevelopment.meteorclient.mixin.StatusEffectInstanceAccessor in project meteor-client by MeteorDevelopment.
the class PotionSpoof method onTick.
@EventHandler
private void onTick(TickEvent.Post event) {
for (StatusEffect statusEffect : potions.get().keySet()) {
int level = potions.get().getInt(statusEffect);
if (level <= 0)
continue;
if (mc.player.hasStatusEffect(statusEffect)) {
StatusEffectInstance instance = mc.player.getStatusEffect(statusEffect);
((StatusEffectInstanceAccessor) instance).setAmplifier(level - 1);
if (instance.getDuration() < 20)
((StatusEffectInstanceAccessor) instance).setDuration(20);
} else {
mc.player.addStatusEffect(new StatusEffectInstance(statusEffect, 20, level - 1));
}
}
}
use of meteordevelopment.meteorclient.mixin.StatusEffectInstanceAccessor in project meteor-client by MeteorDevelopment.
the class SpeedMine method onTick.
@EventHandler
private void onTick(TickEvent.Post event) {
if (mode.get() == Mode.Normal)
return;
int amplifier = mode.get() == Mode.Haste2 ? 1 : 0;
if (!mc.player.hasStatusEffect(HASTE)) {
mc.player.addStatusEffect(new StatusEffectInstance(HASTE, 255, amplifier, false, false, false));
}
StatusEffectInstance effect = mc.player.getStatusEffect(HASTE);
((StatusEffectInstanceAccessor) effect).setAmplifier(amplifier);
if (effect.getDuration() < 20)
((StatusEffectInstanceAccessor) effect).setDuration(20);
}
Aggregations