Начинающий
- Статус
- Оффлайн
- Регистрация
- 17 Апр 2025
- Сообщения
- 48
- Реакции
- 0
- Выберите загрузчик игры
- Прочие моды
давно со своей эйфории ничего не сливал, просто заметил что у меня начало крашить на спукитайме при открытие аукциона плюс там обход поставили и у меня перестал работать дефолтный аххелпер с экспы, так что я фиксанул вылет и сделал обход, код пизда простой сливаю просто что б вам быстрее было
вроде похожее сливали но хз есть ли в них обход под спуки
кстати мб не ток спуки ворк, а и фт не чекал
опять же говорю что код легкий, и типо если вы такие умные со своим "/del изи сделать за 1 строку" - идите делайте сами
вроде похожее сливали но хз есть ли в них обход под спуки
кстати мб не ток спуки ворк, а и фт не чекал
опять же говорю что код легкий, и типо если вы такие умные со своим "/del изи сделать за 1 строку" - идите делайте сами
Пожалуйста, авторизуйтесь для просмотра ссылки.
spookycat otsosi:
package eup.release.functions.impl.misc;
import com.google.common.eventbus.Subscribe;
import eup.release.events.EventUpdate;
import eup.release.functions.api.Category;
import eup.release.functions.api.Function;
import eup.release.functions.api.FunctionRegister;
import eup.release.functions.settings.impl.BooleanSetting;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.client.gui.screen.inventory.ChestScreen;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import com.google.gson.JsonParser;
import com.google.gson.JsonObject;
import com.google.gson.JsonArray;
@Getter
@Setter
@FunctionRegister(name = "AH Helper", type = Category.Player)
public class AhHelper extends Function {
public BooleanSetting three = new BooleanSetting("Подсвечивать 3 слота", true);
public BooleanSetting not_ships = new BooleanSetting("Подсвечивать безшиповку", true);
public BooleanSetting shipi = new BooleanSetting("Подсвечивать шиповку", true);
public AhHelper() {
addSettings(three, not_ships, shipi);
}
float x = 0;
float y = 0;
float x2 = 0;
float y2 = 0;
float x3 = 0;
float y3 = 0;
float x4 = 0;
float y4 = 0;
float x5 = 0;
float y5 = 0;
@Subscribe
public void onUpdate(EventUpdate update) {
if (mc.currentScreen instanceof ChestScreen e) {
if (e.getTitle().getString().contains("Аукцион") || e.getTitle().getString().contains("Поиск:")) {
Container container = e.getContainer();
Slot slot1 = null;
Slot slot2 = null;
Slot slot3 = null;
Slot slot4 = null;
Slot slot5 = null;
int fsPrice = Integer.MAX_VALUE;
int medPrice = Integer.MAX_VALUE;
int thPrice = Integer.MAX_VALUE;
for (Slot slot : container.inventorySlots) {
if (slot.slotNumber > 44) {
continue;
}
int currentPrice = extractPriceFromStack(slot.getStack());
boolean hasThorns = extractEnchantmentFromStack(slot.getStack());
if (currentPrice != -1 && currentPrice < fsPrice) {
fsPrice = currentPrice;
slot1 = slot;
}
if (three.get() && currentPrice != -1) {
if (currentPrice < medPrice && currentPrice > fsPrice) {
medPrice = currentPrice;
slot2 = slot;
}
if (currentPrice < thPrice && currentPrice > medPrice) {
thPrice = currentPrice;
slot3 = slot;
}
}
if (not_ships.get() && !hasThorns && slot.getStack().getItem() instanceof ArmorItem) {
slot4 = slot;
}
if (shipi.get() && hasThorns && slot.getStack().getItem() instanceof ArmorItem) {
slot5 = slot;
}
}
setX(slot1 != null ? slot1.xPos : 0);
setY(slot1 != null ? slot1.yPos : 0);
setX2(slot2 != null ? slot2.xPos : 0);
setY2(slot2 != null ? slot2.yPos : 0);
setX3(slot3 != null ? slot3.xPos : 0);
setY3(slot3 != null ? slot3.yPos : 0);
setX4(slot4 != null ? slot4.xPos : 0);
setY4(slot4 != null ? slot4.yPos : 0);
setX5(slot5 != null ? slot5.xPos : 0);
setY5(slot5 != null ? slot5.yPos : 0);
} else {
resetCoordinates();
}
} else {
resetCoordinates();
}
}
private void resetCoordinates() {
setX(0);
setY(0);
setX2(0);
setY2(0);
setX3(0);
setY3(0);
setX4(0);
setY4(0);
setX5(0);
setY5(0);
}
protected int extractPriceFromStack(ItemStack stack) {
CompoundNBT tag = stack.getTag();
if (tag != null && tag.contains("display", 10)) {
CompoundNBT display = tag.getCompound("display");
if (display.contains("Lore", 9)) {
ListNBT lore = display.getList("Lore", 8);
for (int j = 0; j < lore.size(); ++j) {
try {
JsonObject object = new JsonParser().parse(lore.getString(j)).getAsJsonObject();
if (object.has("extra")) {
JsonArray array = object.getAsJsonArray("extra");
if (array.size() > 2) {
JsonObject title = array.get(1).getAsJsonObject();
String textFT = title.get("text").getAsString().trim().toLowerCase();
if (textFT.contains("ценa") || textFT.contains("цена")) {
String line = array.get(2).getAsJsonObject().get("text").getAsString().trim()
.substring(1).replaceAll(",", "").replaceAll("\\.", "")
.replaceAll(" ", "").replaceAll("\\$", "");
return Integer.parseInt(line);
}
}
}
} catch (Exception ignored) {
}
}
}
}
return -1;
}
protected boolean extractEnchantmentFromStack(ItemStack stack) {
if (stack.getItem() instanceof ArmorItem) {
CompoundNBT tag = stack.getTag();
if (tag != null && tag.contains("Enchantments", 9)) {
ListNBT enchantments = tag.getList("Enchantments", 10);
for (int i = 0; i < enchantments.size(); i++) {
CompoundNBT enchant = enchantments.getCompound(i);
if (enchant.getString("id").equals("minecraft:thorns")) {
return true;
}
}
}
return false;
}
return false;
}
}