Начинающий
- Статус
- Оффлайн
- Регистрация
- 1 Окт 2025
- Сообщения
- 19
- Реакции
- 0
- Выберите загрузчик игры
- Fabric
HitBubbles:
@FieldDefaults(level = AccessLevel.PRIVATE)
public class HitBubbles extends Module {
private final List<HitBubble> bubbles = new CopyOnWriteArrayList<>();
final Identifier bubbleTexture = Identifier.of("textures/bubble.png");
private boolean lastAttackKeyPressed = false;
public HitBubbles() {
super("HitBubbles", "Hit Bubbles", ModuleCategory.RENDER);
}
@EventHandler
public void onTick(TickEvent event) {
boolean currentAttack = mc.options.attackKey.isPressed();
if (currentAttack && !lastAttackKeyPressed && mc.player != null) {
LivingEntity target = getTarget();
if (target != null) {
Vec3d bubblePos = getHitPosition(target);
bubbles.add(new HitBubble(bubblePos, new Timer()));
}
}
lastAttackKeyPressed = currentAttack;
bubbles.removeIf(b -> b.timer().passedMs(3000));
}
private LivingEntity getTarget() {
if (mc.crosshairTarget != null && mc.crosshairTarget.getType() == HitResult.Type.ENTITY) {
EntityHitResult entityHit = (EntityHitResult) mc.crosshairTarget;
Entity entity = entityHit.getEntity();
if (entity instanceof LivingEntity livingEntity) {
return livingEntity;
}
}
return null;
}
private Vec3d getHitPosition(LivingEntity target) {
if (mc.crosshairTarget != null && mc.crosshairTarget.getType() == HitResult.Type.ENTITY) {
EntityHitResult entityHit = (EntityHitResult) mc.crosshairTarget;
return entityHit.getPos();
}
return new Vec3d(
target.getX(),
target.getY() + target.getHeight() / 2,
target.getZ()
);
}
@EventHandler
public void onWorldRender(WorldRenderEvent e) {
renderBubbles(e.getStack());
}
private void renderBubbles(MatrixStack stack) {
if (bubbles.isEmpty()) return;
for (HitBubble bubble : bubbles) {
renderSingleBubble(stack, bubble);
}
}
private void renderSingleBubble(MatrixStack stack, HitBubble bubble) {
float progress = (float) bubble.timer().getPassedTimeMs() / 3000f;
if (progress >= 1f) return;
float scale = progress * 2f;
float alpha = 1f - progress;
float rotation = bubble.timer().getPassedTimeMs() / 10f;
Camera camera = mc.getEntityRenderDispatcher().camera;
Vec3d vec = bubble.pos().subtract(camera.getPos());
MatrixStack matrix = new MatrixStack();
matrix.push();
matrix.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch()));
matrix.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(camera.getYaw() + 180.0F));
matrix.translate(vec.x, vec.y, vec.z);
matrix.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-camera.getYaw()));
matrix.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch()));
matrix.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(rotation));
MatrixStack.Entry entry = matrix.peek();
Vector4i colors = ColorUtil.multRedAndAlpha(new Vector4i(ColorUtil.fade(90), ColorUtil.fade(0), ColorUtil.fade(180), ColorUtil.fade(270)), 1, alpha);
Render3DUtil.drawTexture(entry, bubbleTexture, -scale / 2, -scale / 2, scale, scale, colors, true);
matrix.pop();
}
public record HitBubble(Vec3d pos, Timer timer) {}
}
JumpCircle:
@FieldDefaults(level = AccessLevel.PRIVATE)
public class JumpCircle extends Module {
private final List<Circle> circles = new ArrayList<>();
final Identifier circleTexture = Identifier.of("textures/circle.png");
boolean wasOnGround = true;
public JumpCircle() {
super("JumpCircle", "Jump Circle", ModuleCategory.RENDER);
}
@EventHandler
public void onUpdate(TickEvent event) {
if (mc.player == null) return;
boolean isOnGround = mc.player.isOnGround();
if (wasOnGround && !isOnGround) {
Vec3d pos = new Vec3d(
mc.player.getX(),
Math.floor(mc.player.getY()) + 0.001,
mc.player.getZ()
);
circles.add(new Circle(pos, new Counter()));
}
wasOnGround = isOnGround;
circles.removeIf(c -> c.timer.passedMs(3000));
}
@EventHandler
public void onWorldRender(WorldRenderEvent e) {
renderCircles();
}
private void renderCircles() {
if (circles.isEmpty()) return;
for (Circle circle : circles) {
renderSingleCircle(circle);
}
}
private void renderSingleCircle(Circle circle) {
float lifeTime = (float) circle.timer.getPassedTimeMs();
float maxTime = 3000f;
float progress = lifeTime / maxTime;
if (progress >= 1f) return;
float scale = progress * 2f;
float alpha = 1f - (progress * progress);
int baseColor = ColorUtil.fade((int)(progress * 360f));
int color = ColorUtil.multAlpha(baseColor, alpha);
Camera camera = mc.getEntityRenderDispatcher().camera;
Vec3d cameraPos = camera.getPos();
Vec3d circlePos = circle.pos();
MatrixStack matrixStack = new MatrixStack();
matrixStack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch()));
matrixStack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(camera.getYaw() + 180.0F));
matrixStack.translate(circlePos.x - cameraPos.x, circlePos.y - cameraPos.y, circlePos.z - cameraPos.z);
matrixStack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-camera.getYaw()));
matrixStack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90f));
MatrixStack.Entry entry = matrixStack.peek();
Vector4i colors = new Vector4i(color, color, color, color);
Render3DUtil.drawTexture(entry, circleTexture, -scale/2, -scale/2, scale, scale, colors, true);
}
public record Circle(Vec3d pos, Counter timer) {}
}
ОБНОВИТЬ COUNTER!!!:
package eating.eatinganimation.common.util.math;
import lombok.Getter;
@Getter
public class Counter {
public long lastMS = System.currentTimeMillis();
private long time;
public Counter() {
this.resetCounter();
reset();
}
public static Counter create() {
return new Counter();
}
public void resetCounter() {
lastMS = System.currentTimeMillis();
}
public void reset() {
this.time = System.nanoTime();
}
public boolean isReached(long time) {
return System.currentTimeMillis() - lastMS > time;
}
public void setLastMS(long newValue) {
lastMS = System.currentTimeMillis() + newValue;
}
public void setTime(long time) {
lastMS = time;
}
public long getPassedTimeMs() {
return getMs(System.nanoTime() - time);
}
public long getMs(long time) {
return time / 1000000L;
}
public long getTime() {
return System.currentTimeMillis() - lastMS;
}
public boolean passedMs(long ms) {
return getMs(System.nanoTime() - time) >= ms;
}
public boolean isRunning() {
return System.currentTimeMillis() - lastMS <= 0;
}
public boolean hasTimeElapsed() {
return lastMS < System.currentTimeMillis();
}
}

