Начинающий
- Статус
- Оффлайн
- Регистрация
- 30 Май 2025
- Сообщения
- 63
- Реакции
- 0
- Выберите загрузчик игры
- OptiFine
Пожалуйста, авторизуйтесь для просмотра ссылки.
- Можно настроить дистанцию и скорость взрыва.
Java:
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package ru.etc1337.client.modules.impl.combat;
import java.util.ArrayList;
import java.util.List;
import ru.kotopushka.compiler.sdk.annotations.Compile;
import ru.etc1337.api.events.Event;
import ru.etc1337.api.events.impl.game.EventUpdate;
import ru.etc1337.api.events.impl.render.EventRender2D;
import ru.etc1337.api.settings.impl.SliderSetting;
import ru.etc1337.api.timer.Timer;
import ru.etc1337.client.modules.Module;
import ru.etc1337.client.modules.api.ModuleCategory;
import ru.etc1337.client.modules.api.ModuleInfo;
import net.minecraft.entity.item.EnderCrystalEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
@ModuleInfo(
name = "Crystal Optimizer",
description = "Автоматически взрывает кристаллы",
category = ModuleCategory.COMBAT
)
public class CrystalOptimizer extends Module {
private final SliderSetting explodeSpeed = new SliderSetting("Скорость взрыва", this, 100.0F, 0.0F, 500.0F, 10.0F);
private final SliderSetting range = new SliderSetting("Дистанция", this, 5.0F, 3.0F, 6.0F, 0.5F);
private final Timer explodeTimer = new Timer();
private final List<Integer> toRemove = new ArrayList();
@Compile
public void onEvent(Event event) {
if (event instanceof EventUpdate) {
this.handleUpdate();
} else if (event instanceof EventRender2D) {
this.handleRender();
}
}
private void handleUpdate() {
if (mc.world != null && mc.player != null) {
if (this.explodeTimer.finished((long)this.explodeSpeed.getValue())) {
EnderCrystalEntity crystal = this.findNearestCrystal();
if (crystal != null) {
this.attackCrystal(crystal);
this.explodeTimer.reset();
}
}
}
}
private void handleRender() {
if (mc.world != null && !this.toRemove.isEmpty()) {
for(int entityId : this.toRemove) {
mc.world.removeEntityFromWorld(entityId);
}
this.toRemove.clear();
}
}
private EnderCrystalEntity findNearestCrystal() {
double searchRange = (double)this.range.getValue();
AxisAlignedBB searchBox = mc.player.getBoundingBox().grow(searchRange);
List<EnderCrystalEntity> crystals = mc.world.getEntitiesWithinAABB(EnderCrystalEntity.class, searchBox, (crystalx) -> crystalx != null && !crystalx.removed);
if (crystals.isEmpty()) {
return null;
} else {
EnderCrystalEntity nearest = null;
double minDistance = Double.MAX_VALUE;
for(EnderCrystalEntity crystal : crystals) {
double distance = (double)mc.player.getDistance(crystal);
if (distance < minDistance) {
minDistance = distance;
nearest = crystal;
}
}
return nearest;
}
}
private void attackCrystal(EnderCrystalEntity crystal) {
if (crystal != null && !crystal.removed) {
mc.playerController.attackEntity(mc.player, crystal);
mc.player.swingArm(Hand.MAIN_HAND);
this.toRemove.add(crystal.getEntityId());
}
}
public boolean onDisable() {
this.toRemove.clear();
super.onDisable();
return false;
}
}