mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-19 19:49:51 +00:00
Adding CompressionHandler for superAwesomeSigilOfAwesome!
This commit is contained in:
1 parent
90aeaac6e2
commit
75dcf143d5
6 files changed
+330
-3
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package WayofTime.alchemicalWizardry.api.compress;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* A registry aimed to help compress items in an inventory into its compressible form.
|
||||
*
|
||||
*/
|
||||
public class CompressionRegistry
|
||||
{
|
||||
public static List<CompressionHandler> compressionRegistry = new ArrayList();
|
||||
|
||||
public static void registerHandler(CompressionHandler handler)
|
||||
{
|
||||
compressionRegistry.add(handler);
|
||||
}
|
||||
|
||||
public static ItemStack compressInventory(ItemStack[] inv)
|
||||
{
|
||||
for(CompressionHandler handler : compressionRegistry)
|
||||
{
|
||||
ItemStack stack = handler.compressInventory(inv);
|
||||
if(stack != null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user