Skip to content

Instantly share code, notes, and snippets.

View luiz-otavio's full-sized avatar
:electron:

Luiz Otávio luiz-otavio

:electron:
View GitHub Profile
@luiz-otavio
luiz-otavio / PlayerInvseeMenu.java
Last active January 13, 2024 15:29
Labeling loop in a necessary case
// Make it ordered
for (int index = 0; index < contents.length; index++) {
ItemStack current = contents[index];
if (current == null) {
// Search for the most closed
searchFirst: for (int newSlot = index + 1; newSlot < contents.length; newSlot++) {
current = contents[newSlot];
if (current != null && current.getType() != Material.AIR) {
contents[newSlot] = null;
break searchFirst;