Create Favorites Widget; More hotkeys; More Tooltips; (#617)

Co-authored-by: slprime <[email protected]>
Co-authored-by: Maya <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-04-24 17:48:40 +02:00
1 parent 19d8b42993
commit 0dc7bc1228
63 files changed
+8441 -3975

No files matched your search

@@ -22,6 +22,12 @@ public class ItemStackAmount {
}
}
public void addAll(Iterable<ItemStack> items) {
for (ItemStack stack : items) {
add(stack);
}
}
public void add(ItemStack item) {
add(item, (long) StackInfo.getAmount(item));
}
@@ -30,7 +36,9 @@ public class ItemStackAmount {
if (stack == null || stack.getItem() == null) return;
final NBTTagCompound key = StackInfo.itemStackToNBT(stack, false);
this.itemMap.put(key, value + this.itemMap.getOrDefault(key, 0L));
if (key != null) {
this.itemMap.put(key, value + this.itemMap.getOrDefault(key, 0L));
}
}
public Long get(ItemStack stack) {
@@ -44,7 +52,9 @@ public class ItemStackAmount {
if (stack == null || stack.getItem() == null) return;
final NBTTagCompound key = StackInfo.itemStackToNBT(stack, false);
this.itemMap.put(key, value);
if (key != null) {
this.itemMap.put(key, value);
}
}
public long getOrDefault(ItemStack stack, long defaultAmount) {
@@ -53,6 +63,10 @@ public class ItemStackAmount {
return e == null ? defaultAmount : e;
}
public boolean contains(ItemStack stack) {
return get(stack) != null;
}
public void clear() {
this.itemMap.clear();
}