Removed the stat trackers for the downgrades and prevented downgrades from combining with each other in an anvil.
This commit is contained in:
parent
ed8427c04e
commit
f74f46ab4a
25 changed files with 122 additions and 742 deletions
|
@ -9,6 +9,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
|
||||
|
@ -132,4 +133,48 @@ public class LivingArmourDowngradeRecipe
|
|||
{
|
||||
return this.input;
|
||||
}
|
||||
|
||||
public void consumeInventory(IItemHandler inv)
|
||||
{
|
||||
for (int i = 0; i < inv.getSlots(); i++)
|
||||
{
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if (stack == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stack.getItem().hasContainerItem(stack))
|
||||
{
|
||||
inv.extractItem(i, stack.stackSize, false);
|
||||
inv.insertItem(i, stack.getItem().getContainerItem(stack), false);
|
||||
} else
|
||||
{
|
||||
inv.extractItem(i, 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ItemStack getContainerItem(ItemStack stack)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack copyStack = stack.copy();
|
||||
|
||||
if (copyStack.getItem().hasContainerItem(stack))
|
||||
{
|
||||
return copyStack.getItem().getContainerItem(copyStack);
|
||||
}
|
||||
|
||||
copyStack.stackSize--;
|
||||
if (copyStack.stackSize <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return copyStack;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue