Uh oh!
There was an error while loading. Please reload this page.
Implement kits placing items in specific slots - #5794
Conversation
JRoy
left a comment
There was a problem hiding this comment.
hi, sorry for the delay in review. overall, i think this pr is the wrong approach. we should be adding a slot:<number> into MetaItemStack where expandItems will attempt to add the item to that slot if it is not full.
TiagoFar78
commented
Nov 18, 2025
I like the idea of storing the item slot like that, but it should not live in if (kitItem.startsWith("@")) {
if (serializationProvider == null) {
ess.getLogger().log(Level.WARNING, AdventureUtil.miniToLegacy(tlLiteral("kitError3", kitName, user.getName())));
continue;
}
stack = serializationProvider.deserializeItem(Base64Coder.decodeLines(kitItem.substring(1)));
} else {
finalString[] parts = kitItem.split(" +");
finalItemStackparseStack = ess.getItemDb().get(parts[0], parts.length > 1 ? Integer.parseInt(parts[1]) : 1);
if (parseStack.getType() == Material.AIR) {
continue;
}
finalMetaItemStackmetaStack = newMetaItemStack(parseStack);
if (parts.length > 2) {
// We pass a null sender here because kits should not do perm checksmetaStack.parseStringMeta(null, allowUnsafe, parts, 2, ess);
}
stack = metaStack.getItemStack();
}
itemList.add(stack);
Should |
JRoy
commented
Dec 7, 2025
hmm you're right, it should stay in expandItems. Instead of an slotList tho, lets do a HashMap<Integer, ItemStack>, if during put() we get a return value (overlapping slot), add it to the regular itemList . then we should do the Inventories#hasSpace check with all items (both regular and slotted) (or isDropItemsIfFull) then we'll have a new method in Inventories that will check isSimilar and if the amount + new amount will be greater than the allowed max size. that method will return a boolean if it can be added to the slot or not. then finally add all the non-slotted items + ones that couldn't be added to the slot they asked for in one go via Inventories#addItem |
JRoy
commented
Feb 7, 2026
thank you! |
Uh oh!
There was an error while loading. Please reload this page.
EssentialsX@0bd4c24 Update dump url (EssentialsX#6283) EssentialsX@7775662 Show expiration on temporary IP ban kick message (EssentialsX#6407) EssentialsX@e5c9074 Fix preventing joins when server isn't actually full (EssentialsX#6426) EssentialsX@6ab56d2 Implement kits placing items in specific slots (EssentialsX#5794)
Closes#5535