mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
Create Favorites Widget; More hotkeys; More Tooltips;
This commit is contained in:
1 parent
64a747e4bd
commit
204c37fa36
60 files changed
+8365
-3938
No files matched your search
@@ -2,6 +2,10 @@ package codechicken.nei;
|
||||
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
public class ItemQuantityField extends TextField {
|
||||
|
||||
public ItemQuantityField(String ident) {
|
||||
@@ -22,6 +26,22 @@ public class ItemQuantityField extends TextField {
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack prepareStackWithQuantity(ItemStack stack, long amount) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (amount == 0) {
|
||||
amount = NEIClientConfig.showItemQuantityWidget() ? NEIClientConfig.getItemQuantity() : 0;
|
||||
|
||||
if (amount == 0) {
|
||||
amount = StackInfo.itemStackToNBT(stack).hasKey("gtFluidName") ? 144 : stack.getMaxStackSize();
|
||||
}
|
||||
}
|
||||
|
||||
return StackInfo.withAmount(stack, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void gainFocus() {
|
||||
if (text().equals("0")) {
|
||||
|
||||
Reference in new issue
Block a user