Reinstated Compression sigil. (#1374)
* Reinstated Compression sigil. - does not compress wooden planks into crafting tables - searches for reversible 3x3/2x2 recipes with a single material type - probably has a lot of redundant stuff and looks silly - uses try/catch (might want to find a different approach, some people scoff at this) - should probably have spent the night sleeping, I'm taking exams tomorrow and will probably sleep the whole day through. * Learned how to properly handle the "NullPointerException"-situation. * Update BaseCompressionHandler.java * Update CompressionRegistry.java * Removed (almost) all code comments (only a one-liner remains that serves as pointer to a completly commented-out class (StorageBlockCraftingRecipeAssimilator)). Made methods and variables for long function calls to be more efficient. Fixed an oversight that resulted in a NullPointerException after removing redundant checks that were made to prevent exactly that. Rearranged and reformatted code. * corrected something that could be considered a typo but was an oversight * This should be it. An Array should be more efficient but you can correct me if I'm wrong. In either case it does what it is supposed to do. * Fixed. Needed a seperate inventory for the reversible check (or clear the previously used one, but then I'd had to repopulate again and that would just have been messy) * Forgot one of my lines. * Fix and cleanup. Could definitely clean more but that should suffice for now.
This commit is contained in:
parent
9440d3c0b9
commit
1f392721fa
7 changed files with 153 additions and 180 deletions
|
@ -85,6 +85,7 @@ public class ModRecipes
|
|||
addAlchemyTableRecipes();
|
||||
addPotionRecipes();
|
||||
addLivingArmourDowngradeRecipes();
|
||||
addCompressionHandlers();
|
||||
}
|
||||
|
||||
public static void initOreDict()
|
||||
|
@ -140,11 +141,11 @@ public class ModRecipes
|
|||
{
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
StorageBlockCraftingManager.getInstance().addStorageBlockRecipes();
|
||||
|
||||
CompressionRegistry.registerHandler(new BaseCompressionHandler(new ItemStack(Items.GLOWSTONE_DUST, 4, 0), new ItemStack(Blocks.GLOWSTONE), 64));
|
||||
CompressionRegistry.registerHandler(new BaseCompressionHandler(new ItemStack(Items.SNOWBALL, 4, 0), new ItemStack(Blocks.SNOW), 8));
|
||||
CompressionRegistry.registerHandler(new AdvancedCompressionHandler());
|
||||
|
||||
CompressionRegistry.registerItemThreshold(new ItemStack(Blocks.COBBLESTONE), 64);
|
||||
stopwatch.stop();
|
||||
|
||||
BMLog.DEBUG.info("Added compression recipes in {}", stopwatch);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue