Часть функционала AuctionHelper FunTime exp 3.1 ready

  • Автор темы Автор темы Ieo117
  • Дата начала Дата начала
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
помогите ах хелпер не подсвечивает товары
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Помогите пожалуйста, все ок запускается, но как только на сервер захожу (фт) сразу вылетает((((
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Функция очень даже прикольная, но не в одной фришке не видал, так что решил сделать
Пожалуйста, авторизуйтесь для просмотра ссылки.

Java:
Expand Collapse Copy
/**
*@author Ieo117
*@created 02.06.2024
*/
@ Getter
@ Setter
/* Ес чо вместо Util используйте Misc или что вам надо */
@FunctionRegister(name = "AuctionHelper", type = Category.Util)
public class AhHelper extends Function {

public BooleanSetting three = new BooleanSetting("Подсвечивать 3 слота", true );

public AhHelper(){
addSettings(three);
}
float x = 0;
float y = 0;
float x2 = 0;
float y2 = 0;
float x3 = 0;
float y3 = 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;
int fsPrice = Integer.MAX_VALUE;
int medPrice = Integer.MAX_VALUE;
int thPrice = Integer.MAX_VALUE;

boolean b = false;
for (Slot slot : container.inventorySlots) {
if (slot.slotNumber > 44) {
continue;
}
int currentPrice = extractPriceFromStack(slot.getStack());
if (currentPrice != - 1 && currentPrice < fsPrice) {
fsPrice = currentPrice;
slot1 = slot;

}
if(three.get()) {
if (currentPrice != - 1 && currentPrice < medPrice && currentPrice > fsPrice) {
medPrice = currentPrice;
slot2 = slot;
}
if (currentPrice != - 1 && currentPrice < thPrice && currentPrice > medPrice) {
thPrice = currentPrice;
slot3 = slot;
}
} else {
setX2(0);
setX3(0);
}

}

if (slot1 != null) {
setX(slot1.xPos);
setY(slot1.yPos);
}
if (slot2 != null) {
setX2(slot2.xPos);
setY2(slot2.yPos);
}
if (slot3 != null) {
setX3(slot3.xPos);
setY3(slot3.yPos);
}
}
else {
setX(0);
setX2(0);
setX3(0);
}
}
else{
setX(0);
setX2(0);
setX3(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) {
JsonObject object = JsonParser.parseString(lore.getString(j)).getAsJsonObject();

if (object.has("extra")) {
JsonArray array = object.getAsJsonArray("extra");

if (array.size() > 2) {
JsonObject title = array.get(1).getAsJsonObject();

if (title.get("text").getAsString().trim().toLowerCase().contains("ценa")) {
String line = array.get(2).getAsJsonObject().get("text").getAsString().trim().substring(1).replaceAll(" ", "");

return Integer.parseInt(line);
}
}
}
}
}
}

return -1;
}
}
потом идёте в класс ContainerScreen по директории net.minecraft.client.gui.screen.inventory

и на 297 строчке вставляете это
под конец войда moveItems
Java:
Expand Collapse Copy
/* Вместо FullMyst свой основной класс (к примеру Expensive)*/
FunctionRegistry functionRegistry = FullMyst.getInstance().getFunctionRegistry();
AhHelper helper = functionRegistry.getAhHelper();
if(helper.isState()) {
if (helper.getX() != 0) {
int x = (int) helper.getX();
int y = (int) helper.getY();
/* Самый дешёвый*/
fill(matrixStack, x, y, x + 16, y + 16, ColorUtils.rgba(64, 255, 64, (int)3.75f));
/* Второй по цене*/
if (helper.getX2() != 0) {
int x2 = (int) helper.getX2();
int y2 = (int) helper.getY2();
fill(matrixStack, x2, y2, x2 + 16, y2 + 16, ColorUtils.rgba(255, 255, 64, (int) 3.75f));
}
/* и ластовый красный */
if (helper.getX3() != 0) {
int x3 = (int) helper.getX3();
int y3 = (int) helper.getY3();
fill(matrixStack, x3, y3, x3 + 16, y3 + 16, ColorUtils.rgba(255, 64, 64, (int) 3.75f));
}
}
}
(перед Getter и Setter уберите пробелы:)
У меня почему-то не работает все без ошибок вставлено но эффекта 0 кто может помочь вот дс - waries1 или же вот тг - Golub1214
 
Помогите у кого оно работает вот дс - waries1
У меня просто оно тупо подсвечивает 1 вещь и то это постоянно первый слот
 
Назад
Сверху Снизу