From 5182fa8c4e88588831bba717df33f53a1ee14e81 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 27 Dec 2016 11:50:50 +0100 Subject: [PATCH] Make Laser Relay crafting use the Reconstructor --- .../mod/booklet/InitBooklet.java | 4 ++-- .../mod/booklet/page/PageReconstructor.java | 13 +++++++++++- .../mod/config/values/ConfigCrafting.java | 2 -- .../mod/crafting/BlockCrafting.java | 21 +------------------ .../mod/items/lens/LensRecipeHandler.java | 8 +++++++ 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 0b467013f..3e7e15ec2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -163,8 +163,8 @@ public final class InitBooklet{ //Laser Relays chaptersIntroduction[7] = new BookletChapter("laserIntro", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserWrench), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE), new PageCrafting(3, ItemCrafting.recipeLaserWrench).setNoText()).setImportant(); new BookletChapter("laserRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelayEnergy.CAP).addTextReplacement("", TileEntityLaserRelayEnergyAdvanced.CAP).addTextReplacement("", TileEntityLaserRelayEnergyExtreme.CAP), new PagePicture(3, "pageLaserRelay", 0).setNoText(), new PageCrafting(4, BlockCrafting.recipeLaserRelay).setWildcard().setNoText(), new PageCrafting(5, BlockCrafting.recipeLaserRelayAdvanced).setWildcard().setNoText(), new PageCrafting(6, BlockCrafting.recipeLaserRelayExtreme).setWildcard().setNoText()); - new BookletChapter("itemStorage", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new PageTextOnly(1), new PageTextOnly(2), new PagePicture(3, "pageItemLaserRelayBasic", 78), new PagePicture(4, "pageItemLaserRelayFail", 84), new PagePicture(5, "pageItemLaserRelayTransfer", 78), new PagePicture(6, "pageItemLaserRelayWhitelistChest", 76), new PagePicture(7, "pageItemLaserRelayWhitelistInterface", 75), new PagePicture(8, "pageItemLaserRelaySystem", 75), new PageTextOnly(9), new PageCrafting(10, BlockCrafting.recipeLaserRelayItem).setWildcard().setNoText(), new PageCrafting(11, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard().setNoText(), new PageCrafting(12, BlockCrafting.recipeItemInterface).setNoText()); - new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayFluids), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFluidLaser).setNoText()); + new BookletChapter("itemStorage", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new PageTextOnly(1), new PageTextOnly(2), new PagePicture(3, "page_item_laser_relay_basic", 78), new PagePicture(4, "page_item_laser_relay_fail", 84), new PagePicture(5, "page_item_laser_relay_transfer", 78), new PagePicture(6, "page_item_laser_relay_whitelist_chest", 76), new PagePicture(7, "page_item_laser_relay_whitelist_interface", 75), new PagePicture(8, "page_item_laser_relay_system", 75), new PageTextOnly(9), new PageReconstructor(10, LensRecipeHandler.recipeItemLaser).setWildcard().setNoText(), new PageCrafting(11, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard().setNoText(), new PageCrafting(12, BlockCrafting.recipeItemInterface).setNoText()); + new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayFluids), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeFluidLaser).setWildcard().setNoText()); //No RF Using Blocks new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockBreaker), new PageCrafting(1, BlockCrafting.recipeBreaker).setWildcard(), new PageCrafting(2, BlockCrafting.recipePlacer).setWildcard(), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer).setWildcard(), new PageCrafting(4, BlockCrafting.recipeLiquidCollector).setWildcard()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java index 53c7b0ff5..57cea1a78 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java @@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.booklet.page; import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase; import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.client.config.GuiUtils; @@ -21,6 +22,7 @@ import java.util.List; public class PageReconstructor extends BookletPage{ private final LensConversionRecipe recipe; + private boolean isWildcard; public PageReconstructor(int localizationKey, LensConversionRecipe recipe){ super(localizationKey); @@ -54,7 +56,16 @@ public class PageReconstructor extends BookletPage{ super.getItemStacksForPage(list); if(this.recipe != null){ - list.add(this.recipe.outputStack); + ItemStack copy = this.recipe.outputStack.copy(); + if(this.isWildcard){ + copy.setItemDamage(Util.WILDCARD); + } + list.add(copy); } } + + public BookletPage setWildcard(){ + this.isWildcard = true; + return this; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java index d8f74758a..73e0d4323 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java @@ -132,10 +132,8 @@ public enum ConfigCrafting{ DIRECTIONAL_BREAKER("Long-Range Breaker", ConfigCategories.BLOCKS_CRAFTING), RANGED_COLLECTOR("Ranged Collector", ConfigCategories.BLOCKS_CRAFTING), LASER_RELAY("Laser Relay", ConfigCategories.BLOCKS_CRAFTING), - LASER_RELAY_ITEM("Item Laser Relay", ConfigCategories.BLOCKS_CRAFTING), LASER_RELAY_ITEM_WHITELIST("Advanced Item Laser Relay", ConfigCategories.BLOCKS_CRAFTING), LASER_WRENCH("Laser Wrench", ConfigCategories.ITEMS_CRAFTING), - LASER_RELAY_FLUIDS("Fluid Laser Relay", ConfigCategories.BLOCKS_CRAFTING), CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_CRAFTING), DISENCHANTING_LENS("Disenchanting Lens", ConfigCategories.ITEMS_CRAFTING), MINING_LENS("Mining Lens", ConfigCategories.ITEMS_CRAFTING), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java index 41574002b..1c8c36871 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java @@ -87,7 +87,6 @@ public final class BlockCrafting{ public static IRecipe recipeMiner; public static IRecipe recipeFireworkBox; public static IRecipe recipePhantomRedstoneface; - public static IRecipe recipeLaserRelayItem; public static IRecipe recipeLaserRelayItemWhitelist; public static IRecipe recipeItemInterface; public static IRecipe recipePlayerInterface; @@ -95,8 +94,6 @@ public final class BlockCrafting{ public static IRecipe recipeShockSuppressor; public static IRecipe recipeEmpowerer; public static IRecipe[] recipesTinyTorch = new IRecipe[2]; - public static IRecipe recipeFluidLaser; - public static IRecipe recipeDistributorItem; public static IRecipe recipeBioReactor; public static IRecipe recipeFarmer; @@ -245,7 +242,7 @@ public final class BlockCrafting{ //Laser Relay if(ConfigCrafting.LASER_RELAY.isEnabled()){ - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLaserRelay, 2), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLaserRelay, 4), "OBO", "RCR", "OBO", 'B', new ItemStack(Blocks.REDSTONE_BLOCK), 'O', new ItemStack(Blocks.OBSIDIAN), @@ -268,14 +265,6 @@ public final class BlockCrafting{ recipeLaserRelayExtreme = RecipeUtil.lastIRecipe(); } - //Item Laser Relay - if(ConfigCrafting.LASER_RELAY_ITEM.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockLaserRelayItem), - new ItemStack(InitBlocks.blockLaserRelay), - new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeLaserRelayItem = RecipeUtil.lastIRecipe(); - } - //Whitelist Item Laser Relay if(ConfigCrafting.LASER_RELAY_ITEM_WHITELIST.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), @@ -286,14 +275,6 @@ public final class BlockCrafting{ recipeLaserRelayItemWhitelist = RecipeUtil.lastIRecipe(); } - //Fluid Laser Relay - if(ConfigCrafting.LASER_RELAY_FLUIDS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockLaserRelayFluids), - new ItemStack(InitBlocks.blockLaserRelay), - new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()))); - recipeFluidLaser = RecipeUtil.lastIRecipe(); - } - //Item Interface if(ConfigCrafting.ITEM_INTERFACE.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockItemViewer), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java index 75b4406a5..ccf17236b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java @@ -41,6 +41,8 @@ public final class LensRecipeHandler{ public static LensConversionRecipe recipeNetherWart; public static LensConversionRecipe recipePrismarine; public static LensConversionRecipe recipeCrystallizedCanolaSeed; + public static LensConversionRecipe recipeItemLaser; + public static LensConversionRecipe recipeFluidLaser; public static void init(){ //Crystal Blocks @@ -87,6 +89,12 @@ public final class LensRecipeHandler{ ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelay), new ItemStack(InitBlocks.blockLaserRelayFluids), 2000); + recipeFluidLaser = RecipeUtil.lastReconstructorRecipe(); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayFluids), new ItemStack(InitBlocks.blockLaserRelayItem), 2000); + recipeItemLaser = RecipeUtil.lastReconstructorRecipe(); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitBlocks.blockLaserRelayItem), new ItemStack(InitBlocks.blockLaserRelay), 2000); + //Misc if(ConfigCrafting.RECONSTRUCTOR_MISC.isEnabled()){ ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), 20000);