/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/inventory/SlotNonRetarded.java
36 строк
1 KB
Bob
the part i forgot to push
11 апр 2025, 20:26
11 апр 2025, 20:26
1f6d4bf
Код
Авторство
О чём код?
package com.hbm.inventory; import com.hbm.interfaces.NotableComments; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; /** * Because vanilla slots have severe mental disabilities that prevent them from working as expected. * @author hbm */ @NotableComments public class SlotNonRetarded extends Slot { public SlotNonRetarded(IInventory inventory, int id, int x, int y) { super(inventory, id, x, y); } /** * Dear mojang: Why wasn't that the standard to begin with? What do IInventories have isItemValidForSlot for when by default nothing fucking uses it? */ @Override public boolean isItemValid(ItemStack stack) { return inventory.isItemValidForSlot(this.slotNumber, stack); } /** * Because if slots have higher stacksizes than the maximum allowed by the tile, the display just stops working. * Why was that necessary? Sure it's not intended but falsifying information isn't very cool. */ @Override public int getSlotStackLimit() { return Math.max(this.inventory.getInventoryStackLimit(), this.getHasStack() ? this.getStack().stackSize : 1); } }