mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the 2
This commit is contained in:
parent
e11087bee6
commit
3d345de4d5
@ -286,17 +286,19 @@ public class GUIAnvil extends GuiContainer {
|
|||||||
if(stack instanceof ComparableStack) {
|
if(stack instanceof ComparableStack) {
|
||||||
ItemStack input = ((ComparableStack) stack).toStack();
|
ItemStack input = ((ComparableStack) stack).toStack();
|
||||||
boolean hasItem = false;
|
boolean hasItem = false;
|
||||||
|
int amount =0;
|
||||||
for (int i = 0; i < inventory.mainInventory.length; i++) {
|
for (int i = 0; i < inventory.mainInventory.length; i++) {
|
||||||
ItemStack stackItem = inventory.mainInventory[i];
|
ItemStack stackItem = inventory.mainInventory[i];
|
||||||
if(stackItem == null)
|
if(stackItem == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stackItem.getItem() == input.getItem() && stackItem.stackSize >= stack.stacksize) {
|
if (stackItem.getItem() == input.getItem() && input.getItemDamage() == stackItem.getItemDamage()) {
|
||||||
hasItem = true;
|
hasItem = true;
|
||||||
|
amount +=stackItem.stackSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(hasItem) {
|
if(hasItem && amount >= stack.stacksize) {
|
||||||
list.add(">" + input.stackSize + "x " + input.getDisplayName());
|
list.add(">" + input.stackSize + "x " + input.getDisplayName());
|
||||||
}else {
|
}else {
|
||||||
list.add(EnumChatFormatting.RED + ">" + input.stackSize + "x " + input.getDisplayName());
|
list.add(EnumChatFormatting.RED + ">" + input.stackSize + "x " + input.getDisplayName());
|
||||||
@ -308,17 +310,19 @@ public class GUIAnvil extends GuiContainer {
|
|||||||
if(ores.size() > 0) {
|
if(ores.size() > 0) {
|
||||||
ItemStack inStack = ores.get((int) (Math.abs(System.currentTimeMillis() / 1000) % ores.size()));
|
ItemStack inStack = ores.get((int) (Math.abs(System.currentTimeMillis() / 1000) % ores.size()));
|
||||||
boolean hasItem = false;
|
boolean hasItem = false;
|
||||||
|
int amount =0;
|
||||||
for (int i = 0; i < inventory.mainInventory.length; i++) {
|
for (int i = 0; i < inventory.mainInventory.length; i++) {
|
||||||
ItemStack stackItem = inventory.mainInventory[i];
|
ItemStack stackItem = inventory.mainInventory[i];
|
||||||
if(stackItem == null)
|
if(stackItem == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stackItem.getItem() == inStack.getItem() && stackItem.stackSize >= stack.stacksize) {
|
if (stackItem.getItem() == inStack.getItem() && inStack.getItemDamage() == stackItem.getItemDamage()) {
|
||||||
hasItem = true;
|
hasItem = true;
|
||||||
|
amount += stackItem.stackSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasItem) {
|
if (hasItem && amount >= stack.stacksize) {
|
||||||
list.add(">" + input.stacksize + "x " + inStack.getDisplayName());
|
list.add(">" + input.stacksize + "x " + inStack.getDisplayName());
|
||||||
} else {
|
} else {
|
||||||
list.add(EnumChatFormatting.RED + ">" + input.stacksize + "x " + inStack.getDisplayName());
|
list.add(EnumChatFormatting.RED + ">" + input.stacksize + "x " + inStack.getDisplayName());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user