if (initialSlot !\= -1 && initialSlot !\= updatedSlot) {
context.getContainer().removeItem(initialSlot);
component.hide();
}
}
context.getContainer().renderItem(component.getPosition(), context.getItem());
component.setVisible(true);
return;
}
if (context.getItem() \=\= null) {
if (context.getContainer().getType().isResultSlot(component.getPosition())) {
component.setVisible(true);
return;
}
if (!component.isManagedExternally())
throw new IllegalStateException("At least one fallback item or render handler must be
provided");
return;
}
context.getContainer().renderItem(component.getPosition(), context.getItem());
component.setVisible(true);
if (initialSlot !\= -1 && initialSlot !\= updatedSlot) { context.getContainer().removeItem(initialSlot); component.hide(); } } context.getContainer().renderItem(component.getPosition(), context.getItem()); component.setVisible(true); return; } if (context.getItem() \=\= null) { if (context.getContainer().getType().isResultSlot(component.getPosition())) { component.setVisible(true); return; } if (!component.isManagedExternally()) throw new IllegalStateException("At least one fallback item or render handler must be provided"); return; } context.getContainer().renderItem(component.getPosition(), context.getItem()); component.setVisible(true);
https://github.com/DevNatan/inventory-framework/blob/3ed6725114663747359a77e2ffa1ca0fb68440d5/inventory-framework-platform-bukkit/src/main/java/me/devnatan/inventoryframework/component/BukkitItemComponentImplHandle.java#L29