Часть функционала | AutoLeave | Expensive | 3.1 | second job |

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
18 Апр 2025
Сообщения
112
Реакции
1
Выберите загрузчик игры
  1. Vanilla

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

Ctrl+C + Ctrl+V
without video

AutoLeave:
Expand Collapse Copy
package im.expensive.functions.impl.player;

import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.settings.impl.BooleanSetting;
import im.expensive.functions.settings.impl.ModeSetting;
import im.expensive.functions.settings.impl.SliderSetting;
import im.expensive.functions.settings.impl.StringSetting;
import im.expensive.utils.player.PlayerUtils;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.text.StringTextComponent;

import java.util.function.Supplier;

@FieldDefaults(level = AccessLevel.PRIVATE)
@FunctionRegister(name = "AutoLeave", type = Category.Player)
public class AutoLeave extends Function {

    final ModeSetting action = new ModeSetting("Action", "Kick", "Kick", "/hub", "/spawn", "/home");
    final SliderSetting distance = new SliderSetting("Distance", 50.0f, 1.0f, 100.0f, 1.0f);
    final SliderSetting rejoinDelay = new SliderSetting("Rejoin Delay (sec)", 5.0f, 1.0f, 60.0f, 1.0f)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final SliderSetting cooldown = new SliderSetting("Leave Cooldown (sec)", 30.0f, 5.0f, 300.0f, 1.0f)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final StringSetting anarchyName = new StringSetting(
            "Anarchy Name",
            "",
            "Specify the anarchy name for the /an command"
    ).setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final StringSetting homeName = new StringSetting(
            "Home Name",
            "",
            "Specify the home name for the /home command"
    ).setVisible(() -> action.get().equalsIgnoreCase("/home"));
    final BooleanSetting stayActive = new BooleanSetting("Stay Active", false)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));

    long lastLeaveTime = 0;
    boolean shouldLeave = false;
    boolean shouldRejoin = false;
    long leaveTime = 0;
    long rejoinTime = 0;

    public AutoLeave() {
        addSettings(action, distance, rejoinDelay, cooldown, anarchyName, homeName, stayActive);
    }

    [USER=1474073]@Subscribe[/USER]
    private void onUpdate(EventUpdate event) {
        if (mc.world == null || mc.player == null) return;

        if (shouldRejoin && System.currentTimeMillis() >= rejoinTime) {
            String anarchy = anarchyName.get().trim();
            if (!anarchy.isEmpty()) {
                String rejoinCommand = "/an" + anarchy;
                mc.player.sendChatMessage(rejoinCommand);
            }
            shouldRejoin = false;
            return;
        }

        if (shouldLeave && System.currentTimeMillis() >= leaveTime) {
            String actionValue = action.get();
            if (!actionValue.equalsIgnoreCase("Kick")) {
                if (actionValue.equalsIgnoreCase("/home") && !homeName.get().trim().isEmpty()) {
                    mc.player.sendChatMessage("/home " + homeName.get().trim());
                } else {
                    mc.player.sendChatMessage(actionValue);
                }
                if (actionValue.equalsIgnoreCase("/hub") && !anarchyName.get().trim().isEmpty()) {
                    shouldRejoin = true;
                    rejoinTime = System.currentTimeMillis() + (long)(rejoinDelay.get() * 1000);
                }
            } else {
                mc.player.connection.getNetworkManager().closeChannel(
                        new StringTextComponent("You have left the server!")
                );
            }
            shouldLeave = false;
            lastLeaveTime = System.currentTimeMillis();
            if (!stayActive.get() || actionValue.equalsIgnoreCase("Kick")) {
                toggle();
            }
            return;
        }

        if (System.currentTimeMillis() - lastLeaveTime < cooldown.get() * 1000) {
            return;
        }

        mc.world.getPlayers().stream()
                .filter(this::isValidPlayer)
                .findFirst()
                .ifPresent(player -> {
                    shouldLeave = true;
                    leaveTime = System.currentTimeMillis();
                });
    }

    private boolean isValidPlayer(PlayerEntity player) {
        return player.isAlive()
                && player.getHealth() > 0.0f
                && player.getDistance(mc.player) <= distance.get()
                && player != mc.player
                && PlayerUtils.isNameValid(player.getName().getString());
    }
}
 
/del фигня ты из експы взял
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Ctrl+C + Ctrl+V
without video

AutoLeave:
Expand Collapse Copy
package im.expensive.functions.impl.player;

import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.settings.impl.BooleanSetting;
import im.expensive.functions.settings.impl.ModeSetting;
import im.expensive.functions.settings.impl.SliderSetting;
import im.expensive.functions.settings.impl.StringSetting;
import im.expensive.utils.player.PlayerUtils;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.text.StringTextComponent;

import java.util.function.Supplier;

@FieldDefaults(level = AccessLevel.PRIVATE)
@FunctionRegister(name = "AutoLeave", type = Category.Player)
public class AutoLeave extends Function {

    final ModeSetting action = new ModeSetting("Action", "Kick", "Kick", "/hub", "/spawn", "/home");
    final SliderSetting distance = new SliderSetting("Distance", 50.0f, 1.0f, 100.0f, 1.0f);
    final SliderSetting rejoinDelay = new SliderSetting("Rejoin Delay (sec)", 5.0f, 1.0f, 60.0f, 1.0f)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final SliderSetting cooldown = new SliderSetting("Leave Cooldown (sec)", 30.0f, 5.0f, 300.0f, 1.0f)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final StringSetting anarchyName = new StringSetting(
            "Anarchy Name",
            "",
            "Specify the anarchy name for the /an command"
    ).setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final StringSetting homeName = new StringSetting(
            "Home Name",
            "",
            "Specify the home name for the /home command"
    ).setVisible(() -> action.get().equalsIgnoreCase("/home"));
    final BooleanSetting stayActive = new BooleanSetting("Stay Active", false)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));

    long lastLeaveTime = 0;
    boolean shouldLeave = false;
    boolean shouldRejoin = false;
    long leaveTime = 0;
    long rejoinTime = 0;

    public AutoLeave() {
        addSettings(action, distance, rejoinDelay, cooldown, anarchyName, homeName, stayActive);
    }

    [USER=1474073]@Subscribe[/USER]
    private void onUpdate(EventUpdate event) {
        if (mc.world == null || mc.player == null) return;

        if (shouldRejoin && System.currentTimeMillis() >= rejoinTime) {
            String anarchy = anarchyName.get().trim();
            if (!anarchy.isEmpty()) {
                String rejoinCommand = "/an" + anarchy;
                mc.player.sendChatMessage(rejoinCommand);
            }
            shouldRejoin = false;
            return;
        }

        if (shouldLeave && System.currentTimeMillis() >= leaveTime) {
            String actionValue = action.get();
            if (!actionValue.equalsIgnoreCase("Kick")) {
                if (actionValue.equalsIgnoreCase("/home") && !homeName.get().trim().isEmpty()) {
                    mc.player.sendChatMessage("/home " + homeName.get().trim());
                } else {
                    mc.player.sendChatMessage(actionValue);
                }
                if (actionValue.equalsIgnoreCase("/hub") && !anarchyName.get().trim().isEmpty()) {
                    shouldRejoin = true;
                    rejoinTime = System.currentTimeMillis() + (long)(rejoinDelay.get() * 1000);
                }
            } else {
                mc.player.connection.getNetworkManager().closeChannel(
                        new StringTextComponent("You have left the server!")
                );
            }
            shouldLeave = false;
            lastLeaveTime = System.currentTimeMillis();
            if (!stayActive.get() || actionValue.equalsIgnoreCase("Kick")) {
                toggle();
            }
            return;
        }

        if (System.currentTimeMillis() - lastLeaveTime < cooldown.get() * 1000) {
            return;
        }

        mc.world.getPlayers().stream()
                .filter(this::isValidPlayer)
                .findFirst()
                .ifPresent(player -> {
                    shouldLeave = true;
                    leaveTime = System.currentTimeMillis();
                });
    }

    private boolean isValidPlayer(PlayerEntity player) {
        return player.isAlive()
                && player.getHealth() > 0.0f
                && player.getDistance(mc.player) <= distance.get()
                && player != mc.player
                && PlayerUtils.isNameValid(player.getName().getString());
    }
}
От модеров сделай
 
Думаешь он на твоё сообщение ответит?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
ахуеть а мне за поеботину снесли тему а ему одобрили не справедливость
 
1745172241203.png

не правда
 
Ctrl+C + Ctrl+V
without video

AutoLeave:
Expand Collapse Copy
package im.expensive.functions.impl.player;

import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.settings.impl.BooleanSetting;
import im.expensive.functions.settings.impl.ModeSetting;
import im.expensive.functions.settings.impl.SliderSetting;
import im.expensive.functions.settings.impl.StringSetting;
import im.expensive.utils.player.PlayerUtils;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.text.StringTextComponent;

import java.util.function.Supplier;

@FieldDefaults(level = AccessLevel.PRIVATE)
@FunctionRegister(name = "AutoLeave", type = Category.Player)
public class AutoLeave extends Function {

    final ModeSetting action = new ModeSetting("Action", "Kick", "Kick", "/hub", "/spawn", "/home");
    final SliderSetting distance = new SliderSetting("Distance", 50.0f, 1.0f, 100.0f, 1.0f);
    final SliderSetting rejoinDelay = new SliderSetting("Rejoin Delay (sec)", 5.0f, 1.0f, 60.0f, 1.0f)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final SliderSetting cooldown = new SliderSetting("Leave Cooldown (sec)", 30.0f, 5.0f, 300.0f, 1.0f)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final StringSetting anarchyName = new StringSetting(
            "Anarchy Name",
            "",
            "Specify the anarchy name for the /an command"
    ).setVisible(() -> action.get().equalsIgnoreCase("/hub"));
    final StringSetting homeName = new StringSetting(
            "Home Name",
            "",
            "Specify the home name for the /home command"
    ).setVisible(() -> action.get().equalsIgnoreCase("/home"));
    final BooleanSetting stayActive = new BooleanSetting("Stay Active", false)
            .setVisible(() -> action.get().equalsIgnoreCase("/hub"));

    long lastLeaveTime = 0;
    boolean shouldLeave = false;
    boolean shouldRejoin = false;
    long leaveTime = 0;
    long rejoinTime = 0;

    public AutoLeave() {
        addSettings(action, distance, rejoinDelay, cooldown, anarchyName, homeName, stayActive);
    }

    [USER=1474073]@Subscribe[/USER]
    private void onUpdate(EventUpdate event) {
        if (mc.world == null || mc.player == null) return;

        if (shouldRejoin && System.currentTimeMillis() >= rejoinTime) {
            String anarchy = anarchyName.get().trim();
            if (!anarchy.isEmpty()) {
                String rejoinCommand = "/an" + anarchy;
                mc.player.sendChatMessage(rejoinCommand);
            }
            shouldRejoin = false;
            return;
        }

        if (shouldLeave && System.currentTimeMillis() >= leaveTime) {
            String actionValue = action.get();
            if (!actionValue.equalsIgnoreCase("Kick")) {
                if (actionValue.equalsIgnoreCase("/home") && !homeName.get().trim().isEmpty()) {
                    mc.player.sendChatMessage("/home " + homeName.get().trim());
                } else {
                    mc.player.sendChatMessage(actionValue);
                }
                if (actionValue.equalsIgnoreCase("/hub") && !anarchyName.get().trim().isEmpty()) {
                    shouldRejoin = true;
                    rejoinTime = System.currentTimeMillis() + (long)(rejoinDelay.get() * 1000);
                }
            } else {
                mc.player.connection.getNetworkManager().closeChannel(
                        new StringTextComponent("You have left the server!")
                );
            }
            shouldLeave = false;
            lastLeaveTime = System.currentTimeMillis();
            if (!stayActive.get() || actionValue.equalsIgnoreCase("Kick")) {
                toggle();
            }
            return;
        }

        if (System.currentTimeMillis() - lastLeaveTime < cooldown.get() * 1000) {
            return;
        }

        mc.world.getPlayers().stream()
                .filter(this::isValidPlayer)
                .findFirst()
                .ifPresent(player -> {
                    shouldLeave = true;
                    leaveTime = System.currentTimeMillis();
                });
    }

    private boolean isValidPlayer(PlayerEntity player) {
        return player.isAlive()
                && player.getHealth() > 0.0f
                && player.getDistance(mc.player) <= distance.get()
                && player != mc.player
                && PlayerUtils.isNameValid(player.getName().getString());
    }
}
Работа нужна ? Будешь закладки раскидывать?
 

Похожие темы

Назад
Сверху Снизу