- 6
- 0
Почему всегда выводит Air? Если даже есть в сундуке предметы, всё равно Air
Java:
@SubscribeEvent
public void onChestOpen(GuiOpenEvent event) {
if (event.getGui() instanceof GuiChest) {
ContainerChest container = (ContainerChest) ((GuiChest) event.getGui()).inventorySlots;
for (int i = 0; i < container.getLowerChestInventory().getSizeInventory(); i++) {
System.out.println(container.getLowerChestInventory().getStackInSlot(i).getDisplayName());
}
}
}