Finishing up Compression sigil

This commit is contained in:
WayofTime 2014-11-20 10:19:45 -05:00
parent 107cc50b05
commit 174d56b8ff
11 changed files with 228 additions and 39 deletions

View file

@ -1,17 +1,14 @@
package WayofTime.alchemicalWizardry.api.compress;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public abstract class CompressionHandler
{
public abstract ItemStack getResultStack();
public abstract ItemStack getRequiredStack();
{
/**
* Called to look at the inventory and syphons the required stack. Returns getResultStack if successful, and null if not.
* Called to look at the inventory and syphons the required stack. Returns resultant stack if successful, and null if not.
* @param inv The inventory iterated through
* @return The result of the compression
*/
public abstract ItemStack compressInventory(ItemStack[] inv);
public abstract ItemStack compressInventory(ItemStack[] inv, World world);
}

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* A registry aimed to help compress items in an inventory into its compressible form.
@ -18,11 +19,11 @@ public class CompressionRegistry
compressionRegistry.add(handler);
}
public static ItemStack compressInventory(ItemStack[] inv)
public static ItemStack compressInventory(ItemStack[] inv, World world)
{
for(CompressionHandler handler : compressionRegistry)
{
ItemStack stack = handler.compressInventory(inv);
ItemStack stack = handler.compressInventory(inv, world);
if(stack != null)
{
return stack;