Начинающий
- Статус
- Оффлайн
- Регистрация
- 22 Ноя 2025
- Сообщения
- 43
- Реакции
- 0
- Выберите загрузчик игры
- OptiFine
- Прочие моды
всем ку держите фикс itemscroller в exp 3.1 она не работает зафиксил держите
Код:
//Zalupo3001
package im.expensive.functions.impl.misc;
import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventScroll;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.inventory.container.Slot;
import java.lang.reflect.Field;
@FunctionRegister(name = "ItemScroller", type = Category.Misc)
public class ItemScroller extends Function {
@Subscribe
private void onScroll(EventScroll e) {
if (e.getDelta() == 0 || mc.player == null || !(mc.currentScreen instanceof ContainerScreen)) return;
ContainerScreen<?> screen = (ContainerScreen<?>) mc.currentScreen;
Slot slot = getSlotUnderMouse(screen);
if (slot != null && slot.getHasStack()) {
mc.playerController.windowClick(
screen.getContainer().windowId,
slot.slotNumber,
0,
ClickType.QUICK_MOVE,
mc.player
);
e.setCancelled(true);
}
}
private Slot getSlotUnderMouse(ContainerScreen<?> screen) {
try {
Field field = null;
try {
field = ContainerScreen.class.getDeclaredField("hoveredSlot");
} catch (NoSuchFieldException ex) {
field = ContainerScreen.class.getDeclaredField("field_147006_u");
}
if (field != null) {
field.setAccessible(true);
return (Slot) field.get(screen);
}
} catch (Exception ignored) {
}
return null;
}
}