From 381fbfb46339081f3cb270566b6eef15e5235638 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 14 Jan 2019 14:04:22 +0300 Subject: [PATCH 01/86] Fix JEI info for sawmill energy usage. Some work for #1654 --- .../jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java index 821090780..bb91acc8f 100644 --- a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java @@ -33,6 +33,7 @@ import mezz.jei.api.ingredients.VanillaTypes; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; +import reborncore.common.powerSystem.PowerSystem; import techreborn.api.recipe.machines.IndustrialSawmillRecipe; import techreborn.compat.jei.BaseRecipeWrapper; @@ -90,7 +91,7 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper Date: Mon, 14 Jan 2019 14:04:58 +0300 Subject: [PATCH 02/86] More on #1654 --- .../jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java index bb91acc8f..ba66fe703 100644 --- a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java @@ -91,7 +91,7 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper Date: Mon, 14 Jan 2019 14:10:26 +0300 Subject: [PATCH 03/86] Plasma generator got its icon in JEI. Closes #1653 --- src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java index 3811573f3..ea3194a4e 100644 --- a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java +++ b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java @@ -360,6 +360,7 @@ public class TechRebornJeiPlugin implements IModPlugin { registry.addRecipeCatalyst(new ItemStack(ModBlocks.GAS_TURBINE), EFluidGenerator.GAS.getRecipeID()); registry.addRecipeCatalyst(new ItemStack(ModBlocks.DIESEL_GENERATOR), EFluidGenerator.DIESEL.getRecipeID()); registry.addRecipeCatalyst(new ItemStack(ModBlocks.THERMAL_GENERATOR), EFluidGenerator.THERMAL.getRecipeID()); + registry.addRecipeCatalyst(new ItemStack(ModBlocks.PLASMA_GENERATOR), EFluidGenerator.PLASMA.getRecipeID()); registry.addRecipeCatalyst(new ItemStack(ModBlocks.COMPRESSOR), RecipeCategoryUids.COMPRESSOR); registry.addRecipeCatalyst(new ItemStack(ModBlocks.EXTRACTOR), RecipeCategoryUids.EXTRACTOR); registry.addRecipeCatalyst(new ItemStack(ModBlocks.GRINDER), RecipeCategoryUids.GRINDER); From 7cc0c472f9d752b6918a2a9d4af7768bc294a7ac Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 14 Jan 2019 15:11:26 +0300 Subject: [PATCH 04/86] Adjustments for updated power output icon. --- src/main/java/techreborn/client/gui/GuiAESU.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index f4bec93e9..cafc7c395 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -53,7 +53,7 @@ public class GuiAESU extends GuiBase { drawSlot(62, 45, layer); drawSlot(98, 45, layer); drawArmourSlots(8, 18, layer); - builder.drawEnergyOutput(this, 155, 61, tile.getCurrentOutput(), layer); + builder.drawEnergyOutput(this, 153, 61, tile.getCurrentOutput(), layer); builder.drawUpDownButtons(this, 121, 79, layer); } From ecda412b461b60d579c34cd0177e2b64a175c743 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 14 Jan 2019 16:07:06 +0300 Subject: [PATCH 05/86] Bumped forge to 14.23.5.2796 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2bd55bc39..a96857c1e 100644 --- a/build.gradle +++ b/build.gradle @@ -62,7 +62,7 @@ if (ENV.BUILD_NUMBER) { } minecraft { - version = "1.12.2-14.23.5.2768" + version = "1.12.2-14.23.5.2796" mappings = "snapshot_20171003" replace "@MODVERSION@", project.version useDepAts = true From 292664b8e1273590bc293a1fe49a7166531e4e73 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Wed, 16 Jan 2019 18:07:48 +0300 Subject: [PATCH 06/86] Fixed i18n usage on server. Closes #1655 --- src/main/java/techreborn/tiles/TileAlarm.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/techreborn/tiles/TileAlarm.java b/src/main/java/techreborn/tiles/TileAlarm.java index fecd3d009..a909b4cb8 100644 --- a/src/main/java/techreborn/tiles/TileAlarm.java +++ b/src/main/java/techreborn/tiles/TileAlarm.java @@ -25,7 +25,6 @@ package techreborn.tiles; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -38,6 +37,7 @@ import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import reborncore.api.IToolDrop; import reborncore.common.util.ChatUtils; +import reborncore.common.util.StringUtils; import techreborn.blocks.BlockAlarm; import techreborn.init.ModBlocks; import techreborn.init.ModSounds; @@ -54,7 +54,8 @@ public class TileAlarm extends TileEntity } else { selectedSound = 1; } - ChatUtils.sendNoSpamMessages(MessageIDs.alarmID, new TextComponentString(TextFormatting.GRAY + I18n.format("techreborn.message.alarm") + " " + "Alarm " + selectedSound)); + ChatUtils.sendNoSpamMessages(MessageIDs.alarmID, new TextComponentString( + TextFormatting.GRAY + StringUtils.t("techreborn.message.alarm") + " " + "Alarm " + selectedSound)); } } From 498d675f30957e5ebca6f3bda54d243830c0203f Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 18 Jan 2019 16:20:34 +0000 Subject: [PATCH 07/86] Remove Refined Iron from ic2 duplicates --- src/main/java/techreborn/init/IC2Duplicates.java | 1 - src/main/java/techreborn/init/ModRecipes.java | 2 +- src/main/java/techreborn/init/recipes/CraftingTableRecipes.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index eae2db8f8..3703bd395 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -59,7 +59,6 @@ public enum IC2Duplicates { CABLE_IHV(EnumCableType.IHV.getStack()), CABLE_IIHV(EnumCableType.TIN.getStack()), MIXED_METAL(ItemIngots.getIngotByName("mixed_metal")), - REFINED_IRON(ItemIngots.getIngotByName("refined_iron")), CARBON_FIBER(ItemParts.getPartByName("carbon_fiber")), CARBON_MESH(ItemParts.getPartByName("carbon_mesh")), NEUTRON_REFLECTOR(ItemParts.getPartByName("neutron_reflector")), diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 615a36962..81b99d184 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -395,7 +395,7 @@ public class ModRecipes { } static void addIc2Recipes() { - RebornCraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.MANUAL), IC2Duplicates.REFINED_IRON.getStackBasedOnConfig(), + RebornCraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.MANUAL), "ingotRefinedIron", Items.BOOK); // RebornCraftingHelper diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index 0c04d1fec..27d2f2de1 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -393,7 +393,7 @@ public class CraftingTableRecipes extends RecipeMethods { return; } if (top.equals("ingotRefinedIron") && IC2Duplicates.deduplicate()) { - registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', getStack(IC2Duplicates.REFINED_IRON), 'M', middle, 'B', bottom); + registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', "ingotRefinedIron", 'M', middle, 'B', bottom); } else { registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', top, 'M', middle, 'B', bottom); } From 132aefd81ec6a21c15150f4bb9ca3db99403da2d Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 18 Jan 2019 16:26:01 +0000 Subject: [PATCH 08/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a96857c1e..3dd07f35c 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.1" +version = "2.20.2" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From bc4deb44ef9460f55dc139e5478ebb2474895ca6 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 18 Jan 2019 16:45:31 +0000 Subject: [PATCH 09/86] Update --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3dd07f35c..0022798c6 100644 --- a/build.gradle +++ b/build.gradle @@ -448,4 +448,4 @@ String humanizeArg(String arg){ task copyToLib(type: Copy) { into "$buildDir/output/lib" from configurations.runtime -} +} \ No newline at end of file From 7415c33ac82895637ece9225b6a7733e5fec5d88 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 18 Jan 2019 16:51:08 +0000 Subject: [PATCH 10/86] #releaseBuild Fix startup crash --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0022798c6..7c80f8abb 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.2" +version = "2.20.3" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 0bd22f1a55bc012c222d47b31d0190e1288303d3 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Sat, 19 Jan 2019 23:58:38 +0000 Subject: [PATCH 11/86] Added pack count to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17251e185..1e0e9c4ff 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![](https://i.imgur.com/evHOtQl.png "Tech Reborn") -[![](http://cf.way2muchnoise.eu/full_233564_downloads.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](http://cf.way2muchnoise.eu/versions/233564.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](https://img.shields.io/badge/Discord-TeamReborn-738bd7.svg)](https://discord.gg/teamreborn) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/techreborn/localized.svg)](https://translate.techreborn.ovh/project/techreborn) +[![](http://cf.way2muchnoise.eu/full_233564_downloads.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](http://cf.way2muchnoise.eu/packs/233564.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](http://cf.way2muchnoise.eu/versions/233564.svg)](https://minecraft.curseforge.com/projects/techreborn) [![](https://img.shields.io/badge/Discord-TeamReborn-738bd7.svg)](https://discord.gg/teamreborn) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/techreborn/localized.svg)](https://translate.techreborn.ovh/project/techreborn) # Tech Reborn for 1.12 [![Build Status](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/badge/icon)](https://jenkins.modmuss50.me/job/Team%20Reborn/job/TechReborn/job/1.12/) From bc1e2ca7ebebca1f58c400091cc3b8da0acc44d3 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Sun, 20 Jan 2019 21:14:15 +0000 Subject: [PATCH 12/86] Thermal Generator now outputs 32 eu/tick --- .../java/techreborn/tiles/generator/TileThermalGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java index b88746c9b..738f7e98c 100644 --- a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java @@ -45,7 +45,7 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon @ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorTankCapacity", comment = "Thermal Generator Tank Capacity") public static int tankCapacity = 10_000; @ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorEnergyPerTick", comment = "Thermal Generator Energy Per Tick (Value in EU)") - public static int energyPerTick = 10; + public static int energyPerTick = 32; public TileThermalGenerator() { super(EFluidGenerator.THERMAL, "TileThermalGenerator", tankCapacity, energyPerTick); From 5a9349ced4706f566402e423ba5ceb06bb20093f Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 24 Jan 2019 21:26:56 +0000 Subject: [PATCH 13/86] Pull back power output on Thermal gen as I made it a bit too much last commit. Now 16 --- .../java/techreborn/tiles/generator/TileThermalGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java index 738f7e98c..bcc540a13 100644 --- a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java @@ -45,7 +45,7 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon @ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorTankCapacity", comment = "Thermal Generator Tank Capacity") public static int tankCapacity = 10_000; @ConfigRegistry(config = "generators", category = "thermal_generator", key = "ThermalGeneratorEnergyPerTick", comment = "Thermal Generator Energy Per Tick (Value in EU)") - public static int energyPerTick = 32; + public static int energyPerTick = 16; public TileThermalGenerator() { super(EFluidGenerator.THERMAL, "TileThermalGenerator", tankCapacity, energyPerTick); From f4a24d7c2533614e7afaddf3ec2fccef059966b5 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 24 Jan 2019 21:35:39 +0000 Subject: [PATCH 14/86] Fixes to retro gen --- .../java/techreborn/command/TechRebornDevCommand.java | 1 + src/main/java/techreborn/world/TechRebornRetroGen.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/command/TechRebornDevCommand.java b/src/main/java/techreborn/command/TechRebornDevCommand.java index 238c730f0..7301bd59d 100644 --- a/src/main/java/techreborn/command/TechRebornDevCommand.java +++ b/src/main/java/techreborn/command/TechRebornDevCommand.java @@ -74,6 +74,7 @@ public class TechRebornDevCommand extends CommandBase { blocksToRemove.add(Blocks.DIRT); blocksToRemove.add(Blocks.STONE); blocksToRemove.add(Blocks.END_STONE); + blocksToRemove.add(Blocks.NETHERRACK); for (int x = 0; x < 25; x++) { for (int z = 0; z < 25; z++) { for (int y = 0; y < playerMP.posY; y++) { diff --git a/src/main/java/techreborn/world/TechRebornRetroGen.java b/src/main/java/techreborn/world/TechRebornRetroGen.java index 00c13ee9f..aa4f4364d 100644 --- a/src/main/java/techreborn/world/TechRebornRetroGen.java +++ b/src/main/java/techreborn/world/TechRebornRetroGen.java @@ -48,7 +48,7 @@ public class TechRebornRetroGen { private final Deque chunksToRetroGen = new ArrayDeque<>(64); private boolean isChunkEligibleForRetroGen(ChunkDataEvent.Load event) { - return Core.worldGen.config.retroGenOres && event.getWorld().provider.getDimension() == 0 + return Core.worldGen.config.retroGenOres && event.getData().getString(RETROGEN_TAG).isEmpty(); } @@ -57,7 +57,7 @@ public class TechRebornRetroGen { } private boolean isTickEligibleForRetroGen(TickEvent.WorldTickEvent event) { - return event.phase == TickEvent.Phase.END || event.side == Side.SERVER; + return event.phase == TickEvent.Phase.END && event.side == Side.SERVER; } @SubscribeEvent @@ -72,7 +72,7 @@ public class TechRebornRetroGen { final Random rng = new Random(seed); final long xSeed = rng.nextLong() >> 2 + 1L; final long zSeed = rng.nextLong() >> 2 + 1L; - final long chunkSeed = (xSeed * coord.getX() + zSeed * coord.getZ()) * seed; + final long chunkSeed = (xSeed * coord.getX() + zSeed * coord.getZ()) ^ seed; rng.setSeed(chunkSeed); Core.worldGen.generate(rng, coord.getX(), coord.getZ(), world, null, null); } @@ -84,7 +84,7 @@ public class TechRebornRetroGen { public void onChunkLoad(ChunkDataEvent.Load event) { if (isChunkEligibleForRetroGen(event)) { final ChunkCoord coord = ChunkCoord.of(event); - Core.logHelper.info("Queueing retro ore gen for " + coord + '.'); + Core.logHelper.debug("Queueing retro gen for " + coord + '.'); chunksToRetroGen.addLast(coord); } } From 0228d721792e00259594bfd680ed4a0ab120d972 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 24 Jan 2019 21:38:21 +0000 Subject: [PATCH 15/86] Always add refined iron ingot to smelting, I forgot to remove it --- src/main/java/techreborn/init/recipes/SmeltingRecipes.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java index 62b0fe45b..cc6c991ed 100644 --- a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java +++ b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java @@ -38,9 +38,7 @@ public class SmeltingRecipes extends RecipeMethods { public static void init() { register(getMaterial("sap", Type.PART), getMaterial("rubber", Type.PART)); - if (!IC2Duplicates.deduplicate()) { - register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT)); - } + register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT)); register(BlockOre2.getOreByName("copper"), getMaterial("copper", Type.INGOT)); register(BlockOre2.getOreByName("tin"), getMaterial("tin", Type.INGOT)); register(BlockOre.getOreByName("silver"), getMaterial("silver", Type.INGOT)); From 199fa63041bfdea73a0fb27fba366712c1e769db Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 24 Jan 2019 22:51:39 +0000 Subject: [PATCH 16/86] #releaseBuild - New IF and Baubles integration --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7c80f8abb..1e81633c1 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.3" +version = "2.20.4" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 85056166518ea04a05f04356adb39ded823b53a7 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 26 Jan 2019 19:06:51 +0000 Subject: [PATCH 17/86] Fix fusion coil not being crafted with ic2 de-dupe --- src/main/java/techreborn/init/recipes/CraftingTableRecipes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index 27d2f2de1..587b72e3a 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -151,7 +151,7 @@ public class CraftingTableRecipes extends RecipeMethods { registerShaped(getStack(ModBlocks.LSU_STORAGE), "LLL", "LCL", "LLL", 'L', "blockLapis", 'C', "circuitBasic"); registerShaped(getStack(ModBlocks.SCRAPBOXINATOR), "ICI", "DSD", "ICI", 'S', getStack(ModItems.SCRAP_BOX), 'C', "circuitBasic", 'I', "plateIron", 'D', "dirt"); registerShaped(getStack(ModBlocks.FUSION_CONTROL_COMPUTER), "CCC", "PTP", "CCC", 'P', "energyCrystal", 'T', getStack(ModBlocks.FUSION_COIL), 'C', "circuitMaster"); - registerShaped(getStack(ModBlocks.FUSION_COIL), "CSC", "NAN", "CRC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'N', getMaterial("nichromeHeatingCoil", Type.PART), 'C', "circuitMaster", 'S', "craftingSuperconductor", 'R', getMaterial("iridiumNeutronReflector", Type.PART)); + registerShaped(getStack(ModBlocks.FUSION_COIL), "CSC", "NAN", "CRC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'N', getMaterial("nichromeHeatingCoil", Type.PART), 'C', "circuitMaster", 'S', "craftingSuperconductor", 'R', IC2Duplicates.IRIDIUM_NEUTRON_REFLECTOR.getStackBasedOnConfig()); registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateAluminum", 'D', getMaterial("data_orb", Type.PART), 'C', getMaterial("computer_monitor", Type.PART)); registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateSteel", 'D', getMaterial("data_orb", Type.PART), 'C', getMaterial("computer_monitor", Type.PART)); registerShaped(getStack(ModBlocks.MATTER_FABRICATOR), "ETE", "AOA", "ETE", 'E', "circuitMaster", 'T', getStack(IC2Duplicates.EXTRACTOR), 'A', "machineBlockElite", 'O', getStack(ModItems.LAPOTRONIC_ORB)); From 039537fcdbbcb926751003f4131cf3f7257ca62d Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 26 Jan 2019 19:24:39 +0000 Subject: [PATCH 18/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 1e81633c1..45ead58ec 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.4" +version = "2.20.5" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 12b892f0dcbf35dbca97df4cd9e2220c675010c8 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 27 Jan 2019 01:42:52 +0000 Subject: [PATCH 19/86] Fix Alarm recipe with IC2 Dedupe --- src/main/java/techreborn/init/recipes/CraftingTableRecipes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index 587b72e3a..0bea7ae8f 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -168,7 +168,7 @@ public class CraftingTableRecipes extends RecipeMethods { registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 3), "DLD", "LDL", "CPC", 'D', "dustDiamond", 'L', "glassReinforced", 'C', "circuitAdvanced", 'P', "machineBlockAdvanced"); registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 4), "DLD", "LDL", "CPC", 'D', "dustDiamond", 'L', "glassReinforced", 'C', "circuitMaster", 'P', getStack(ModBlocks.SOLAR_PANEL, 1, 3)); registerShaped(getStack(ModBlocks.SOLAR_PANEL, 1, 4), "DLD", "LDL", "CPC", 'D', "dustDiamond", 'L', "glassReinforced", 'C', "circuitMaster", 'P', "machineBlockElite"); - registerShaped(getStack(ModBlocks.ALARM, 1, 0), "ICI", "SRS", "ICI", 'I', "ingotIron", 'C', getMaterial("copper", Type.CABLE), 'S', getMaterial("insulatedcopper", Type.CABLE), 'R', "blockRedstone" ); + registerShaped(getStack(ModBlocks.ALARM, 1, 0), "ICI", "SRS", "ICI", 'I', "ingotIron", 'C', getMaterial("copper", Type.CABLE), 'S', IC2Duplicates.CABLE_ICOPPER.getStackBasedOnConfig(), 'R', "blockRedstone" ); registerShaped(getStack(ModBlocks.FLUID_REPLICATOR), "PCP", "CFC", "ESR", 'P', "plateTungstensteel", 'F', "machineBlockElite", 'C', "circuitMaster", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'S', "craftingSuperconductor",'R', getStack(ModBlocks.CHEMICAL_REACTOR)); if (!IC2Duplicates.deduplicate()) { From 3e44fc369f8fc040e41aae30ed6429cf3f5e617e Mon Sep 17 00:00:00 2001 From: coderbot Date: Mon, 28 Jan 2019 17:38:02 -0800 Subject: [PATCH 20/86] Transformers now declare that they can output multiple packets per tick --- .../java/techreborn/tiles/transformers/TileTransformer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/techreborn/tiles/transformers/TileTransformer.java b/src/main/java/techreborn/tiles/transformers/TileTransformer.java index 0ac4b00f4..bf7c2c379 100644 --- a/src/main/java/techreborn/tiles/transformers/TileTransformer.java +++ b/src/main/java/techreborn/tiles/transformers/TileTransformer.java @@ -73,6 +73,9 @@ public class TileTransformer extends TilePowerAcceptor this.maxInput = tier.getMaxInput(); this.maxOutput = tier.getMaxOutput(); this.maxStorage = tier.getMaxInput() * 2; + + // Should always be 4, except if we're tier MICRO, in which it will be 1. + super.setMaxPacketsPerTick(tier.getMaxOutput() / ouputTier.getMaxInput()); } // TilePowerAcceptor From 72a09d2368e40c18747dc1a3858241aeac85481a Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 1 Feb 2019 13:42:21 +0000 Subject: [PATCH 21/86] Fixes some possible NPE locations --- .../tiles/multiblock/TileImplosionCompressor.java | 13 ++++--------- .../multiblock/TileIndustrialBlastFurnace.java | 3 +++ .../tiles/multiblock/TileVacuumFreezer.java | 13 ++++++------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/java/techreborn/tiles/multiblock/TileImplosionCompressor.java b/src/main/java/techreborn/tiles/multiblock/TileImplosionCompressor.java index 5946f3e8d..9eac04524 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileImplosionCompressor.java +++ b/src/main/java/techreborn/tiles/multiblock/TileImplosionCompressor.java @@ -57,6 +57,9 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont } public boolean getMutliBlock() { + if(multiblockChecker == null){ + return false; + } final boolean down = multiblockChecker.checkRectY(1, 1, MultiblockChecker.REINFORCED_CASING, MultiblockChecker.ZERO_OFFSET); final boolean up = multiblockChecker.checkRectY(1, 1, MultiblockChecker.REINFORCED_CASING, new BlockPos(0, 2, 0)); final boolean chamber = multiblockChecker.checkRingYHollow(1, 1, MultiblockChecker.REINFORCED_CASING, new BlockPos(0, 1, 0)); @@ -67,21 +70,13 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont @Override public void update() { if (multiblockChecker == null) { - final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2); - multiblockChecker = new MultiblockChecker(world, downCenter); + multiblockChecker = new MultiblockChecker(world, pos.down(3)); } if (!world.isRemote && getMutliBlock()){ super.update(); } } - - // TileEntity - @Override - public void validate() { - super.validate(); - multiblockChecker = new MultiblockChecker(world, pos.down(3)); - } // IContainerProvider @Override diff --git a/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java b/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java index 4d44d2636..7f3a1634e 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java +++ b/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java @@ -107,6 +107,9 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC } public boolean getMutliBlock() { + if(multiblockChecker == null){ + return false; + } final boolean layer0 = multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_ANY, MultiblockChecker.ZERO_OFFSET); final boolean layer1 = multiblockChecker.checkRingY(1, 1, MultiblockChecker.CASING_ANY, new BlockPos(0, 1, 0)); final boolean layer2 = multiblockChecker.checkRingY(1, 1, MultiblockChecker.CASING_ANY, new BlockPos(0, 2, 0)); diff --git a/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java b/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java index 9ae5c5346..4a112bacf 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java +++ b/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java @@ -56,24 +56,23 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP } public boolean getMultiBlock() { + if(multiblockChecker == null){ + return false; + } return multiblockChecker.checkRectY(1, 1, MultiblockChecker.REINFORCED_CASING, MultiblockChecker.ZERO_OFFSET); } // TileGenericMachine @Override public void update() { + if(multiblockChecker == null){ + multiblockChecker = new MultiblockChecker(world, pos.down()); + } if (!world.isRemote && getMultiBlock()) { super.update(); } } - // TileEntity - @Override - public void validate() { - super.validate(); - multiblockChecker = new MultiblockChecker(world, pos.down()); - } - // IContainerProvider @Override public BuiltContainer createContainer(final EntityPlayer player) { From 9301cfbc90e2be00d9375e31924aa145254c1c3c Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 1 Feb 2019 14:46:18 +0000 Subject: [PATCH 22/86] Improve rolling machine item balancing, it will no longer move items around when there isnt a better distribution --- .../tiles/tier1/TileRollingMachine.java | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java index 6e1433289..748a3ef73 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java +++ b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java @@ -48,9 +48,8 @@ import techreborn.init.ModBlocks; import techreborn.lib.ModInfo; import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; +import java.util.*; +import java.util.stream.Collectors; //TODO add tick and power bars. @@ -212,6 +211,41 @@ public class TileRollingMachine extends TilePowerAcceptor } } + int totalItems = possibleSlots.stream() + .mapToInt(value -> inventory.getStackInSlot(value).getCount()).sum(); + int slots = possibleSlots.size(); + + //This makes an array of ints with the best possible slot distribution + int[] split = new int[slots]; + int remainder = totalItems % slots; + Arrays.fill(split, totalItems / slots); + while (remainder > 0){ + for (int i = 0; i < split.length; i++) { + if(remainder > 0){ + split[i] +=1; + remainder --; + } + } + } + + List slotDistrubution = possibleSlots.stream() + .mapToInt(value -> inventory.getStackInSlot(value).getCount()) + .boxed().collect(Collectors.toList()); + + boolean needsBalance = false; + for (int i = 0; i < split.length; i++) { + int required = split[i]; + if(slotDistrubution.contains(required)){ + //We need to remove the int, not at the int, this seems to work around that + slotDistrubution.remove(new Integer(required)); + } else { + needsBalance = true; + } + } + if (!needsBalance) { + return Optional.empty(); + } + //Slot, count Pair bestSlot = null; for (Integer slot : possibleSlots) { From 094f2fc05058b7380012b96833700c1d3785e86c Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 1 Feb 2019 15:32:05 +0000 Subject: [PATCH 23/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 45ead58ec..876db8847 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.5" +version = "2.20.6" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From bccfe14d7ce1094dec41902a1dc13c4e89664442 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Sat, 2 Feb 2019 06:35:29 +0000 Subject: [PATCH 24/86] #releaseBuild fixes issues with transformers --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 876db8847..15f2fb6af 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.6" +version = "2.20.7" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { @@ -448,4 +448,4 @@ String humanizeArg(String arg){ task copyToLib(type: Copy) { into "$buildDir/output/lib" from configurations.runtime -} \ No newline at end of file +} From 6916de2ad7a3d5ddba34a3f280616a1b008ba7b7 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 4 Feb 2019 20:19:51 +0000 Subject: [PATCH 25/86] Added support for ic2 exp classic profile --- .../java/techreborn/init/IC2Duplicates.java | 49 ++++++++++++++++++- src/main/java/techreborn/init/ModRecipes.java | 2 +- .../init/recipes/CraftingTableRecipes.java | 12 +++-- src/main/java/techreborn/lib/ModInfo.java | 3 ++ 4 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 3703bd395..41262c932 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -25,11 +25,16 @@ package techreborn.init; import net.minecraft.item.ItemStack; +import org.apache.commons.lang3.Validate; import techreborn.api.TechRebornAPI; +import techreborn.blocks.BlockMachineFrames; import techreborn.blocks.cable.EnumCableType; import techreborn.config.ConfigTechReborn; +import techreborn.itemblocks.ItemBlockMachineFrames; import techreborn.items.ingredients.ItemIngots; import techreborn.items.ingredients.ItemParts; +import techreborn.items.ingredients.ItemPlates; +import techreborn.lib.ModInfo; /** * Created by Mark on 18/12/2016. @@ -65,19 +70,45 @@ public enum IC2Duplicates { THICK_NEUTRON_REFLECTOR(ItemParts.getPartByName("thick_neutron_reflector")), IRIDIUM_NEUTRON_REFLECTOR(ItemParts.getPartByName("iridium_neutron_reflector")), SCRAP(ItemParts.getPartByName("scrap")), - FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER)); + FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER)), + + //Classical dedupes + ENERGY_CRYSTAL(new ItemStack(ModItems.ENERGY_CRYSTAL), true), + LAPATRON_CRYSTAL(new ItemStack(ModItems.LAPOTRONIC_CRYSTAL), true), + RE_BATTERY(new ItemStack(ModItems.RE_BATTERY), true), + REFINED_IRON(ItemIngots.getIngotByName("refined_iron"), true), + BASIC_MACHINE_FRAME(BlockMachineFrames.getFrameByName("basic"), true), + ADVANCED_MACHINE_FRAME(BlockMachineFrames.getFrameByName("advanced"), true), + CARBON_PLATE(ItemPlates.getPlateByName("carbon"), true); ItemStack ic2Stack; ItemStack trStack; + boolean classicOnly; IC2Duplicates(ItemStack trStack) { - this.trStack = trStack; + this(trStack, false); } IC2Duplicates(ItemStack ic2Stack, ItemStack trStack) { + this(ic2Stack, trStack, false); + } + + IC2Duplicates(ItemStack ic2Stack, ItemStack trStack, boolean classicOnly) { + Validate.notNull(trStack); + Validate.isTrue(!trStack.isEmpty()); + Validate.notNull(ic2Stack); + Validate.isTrue(!ic2Stack.isEmpty()); this.ic2Stack = ic2Stack; this.trStack = trStack; + this.classicOnly = classicOnly; + } + + IC2Duplicates(ItemStack trStack, boolean classicOnly) { + Validate.notNull(trStack); + Validate.isTrue(!trStack.isEmpty()); + this.trStack = trStack; + this.classicOnly = classicOnly; } public static boolean deduplicate() { @@ -98,6 +129,8 @@ public enum IC2Duplicates { } public void setIc2Stack(ItemStack ic2Stack) { + Validate.notNull(ic2Stack); + Validate.isTrue(!ic2Stack.isEmpty()); this.ic2Stack = ic2Stack; } @@ -113,10 +146,22 @@ public enum IC2Duplicates { } public ItemStack getStackBasedOnConfig() { + //Used only for when de-duping classic only items + if(!classicOnly){ + return getTrStack(); + } if (deduplicate()) { return getIc2Stack(); } return getTrStack(); } + public static boolean isClassicMode(){ + return ModInfo.IC2_PROFILE.equals("Classic"); + } + + public static boolean isClassicalDedupe(){ + return deduplicate() && isClassicMode(); + } + } diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 81b99d184..bd4bd4c73 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -137,7 +137,7 @@ public class ModRecipes { ItemPlates.getPlateByName("RedGarnet"), 300, 4)); RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("blockRedGarnet", 1), ItemPlates.getPlateByName("RedGarnet", 9), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("ingotRefinedIron", 1), + RecipeHandler.addRecipe(new CompressorRecipe("ingotRefinedIron", ItemPlates.getPlateByName("RefinedIron"), 300, 4)); ItemStack plate; diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index 0bea7ae8f..d9360f25e 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -202,11 +202,15 @@ public class CraftingTableRecipes extends RecipeMethods { //Parts registerShaped(getMaterial("iridium_alloy", Type.INGOT), "IAI", "ADA", "IAI", 'I', "ingotIridium", 'D', "dustDiamond", 'A', "plateAdvancedAlloy"); - registerShaped(getStack(ModItems.RE_BATTERY), " W ", "TRT", "TRT", 'T', "ingotTin", 'R', "dustRedstone", 'W', getStack(IC2Duplicates.CABLE_ICOPPER)); registerShaped(getStack(ModItems.LITHIUM_BATTERY), " C ", "PFP", "PFP", 'F', getCell("lithium"), 'P', "plateAluminum", 'C', getStack(IC2Duplicates.CABLE_IGOLD)); - registerShaped(getStack(ModItems.LITHIUM_BATTERY_PACK), "BCB", "BPB", "B B", 'B', getStack(ModItems.LITHIUM_BATTERY), 'P', "plateAluminum", 'C', "circuitAdvanced"); - registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond"); - registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic"); + + if(!IC2Duplicates.isClassicalDedupe()){ + registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond"); + registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic"); + registerShaped(getStack(ModItems.RE_BATTERY), " W ", "TRT", "TRT", 'T', "ingotTin", 'R', "dustRedstone", 'W', getStack(IC2Duplicates.CABLE_ICOPPER)); + } + + registerShaped(getStack(ModItems.LITHIUM_BATTERY_PACK), "BCB", "BPB", "B B", 'B', getStack(ModItems.LITHIUM_BATTERY), 'P', "plateAluminum", 'C', "circuitAdvanced"); registerShaped(getStack(ModItems.LAPOTRONIC_ORB), "LLL", "LPL", "LLL", 'L', "lapotronCrystal", 'P', "plateIridiumAlloy"); registerShaped(getStack(ModItems.SCRAP_BOX), "SSS", "SSS", "SSS", 'S', getMaterial("scrap", Type.PART)); registerShaped(getMaterial("machine", Type.MACHINE_FRAME), "AAA", "A A", "AAA", 'A', "ingotRefinedIron"); diff --git a/src/main/java/techreborn/lib/ModInfo.java b/src/main/java/techreborn/lib/ModInfo.java index cb726c84b..f152d88ab 100644 --- a/src/main/java/techreborn/lib/ModInfo.java +++ b/src/main/java/techreborn/lib/ModInfo.java @@ -35,6 +35,9 @@ public class ModInfo implements IModInfo { public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy"; public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory"; + //This is in here as the ic2 event get called soo early it fucks the class loading order up :) weee + public static String IC2_PROFILE = "UNKNOWN"; + @Override public String MOD_NAME() { return MOD_NAME; From f836fb84c70b9dae54e3c4be7a8d6a12fd6e4b76 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 4 Feb 2019 20:53:33 +0000 Subject: [PATCH 26/86] Move IC2_PROFILE to a config, the event is fired too early to be used. --- src/main/java/techreborn/config/ConfigTechReborn.java | 3 +++ src/main/java/techreborn/init/IC2Duplicates.java | 2 +- src/main/java/techreborn/lib/ModInfo.java | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/config/ConfigTechReborn.java b/src/main/java/techreborn/config/ConfigTechReborn.java index dae03730e..90d74d0eb 100644 --- a/src/main/java/techreborn/config/ConfigTechReborn.java +++ b/src/main/java/techreborn/config/ConfigTechReborn.java @@ -36,6 +36,9 @@ public class ConfigTechReborn { @ConfigRegistry(config = "recipes", category = "ic2", key = "deduplicate", comment = "Changes a lot of recipes and hides blocks to integrate TechReborn into IC2") public static boolean REMOVE_DUPLICATES = false; + @ConfigRegistry(config = "recipes", category = "ic2", key = "ic2_profile", comment = "Enter the ic2 profile name here (Experimental or Classic)") + public static String IC2_PROFILE = "Experimental"; + @ConfigRegistry(config = "misc", category = "general", key = "enableGemTools", comment = "Enable Gem armor and tools") public static boolean enableGemArmorAndTools = true; diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 41262c932..d1c079e95 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -157,7 +157,7 @@ public enum IC2Duplicates { } public static boolean isClassicMode(){ - return ModInfo.IC2_PROFILE.equals("Classic"); + return ConfigTechReborn.IC2_PROFILE.equals("Classic"); } public static boolean isClassicalDedupe(){ diff --git a/src/main/java/techreborn/lib/ModInfo.java b/src/main/java/techreborn/lib/ModInfo.java index f152d88ab..cb726c84b 100644 --- a/src/main/java/techreborn/lib/ModInfo.java +++ b/src/main/java/techreborn/lib/ModInfo.java @@ -35,9 +35,6 @@ public class ModInfo implements IModInfo { public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy"; public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory"; - //This is in here as the ic2 event get called soo early it fucks the class loading order up :) weee - public static String IC2_PROFILE = "UNKNOWN"; - @Override public String MOD_NAME() { return MOD_NAME; From 85491298705835998a5e280c9425132fdf81965c Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 4 Feb 2019 21:27:49 +0000 Subject: [PATCH 27/86] Dont register refined iron smelting recipe with classic dedupe enabled --- src/main/java/techreborn/init/recipes/SmeltingRecipes.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java index cc6c991ed..8304eabd4 100644 --- a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java +++ b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java @@ -38,7 +38,9 @@ public class SmeltingRecipes extends RecipeMethods { public static void init() { register(getMaterial("sap", Type.PART), getMaterial("rubber", Type.PART)); - register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT)); + if(!IC2Duplicates.isClassicalDedupe()){ + register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT)); + } register(BlockOre2.getOreByName("copper"), getMaterial("copper", Type.INGOT)); register(BlockOre2.getOreByName("tin"), getMaterial("tin", Type.INGOT)); register(BlockOre.getOreByName("silver"), getMaterial("silver", Type.INGOT)); From 6595bb80c537fe85695cecac4017c442d790ab4c Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 4 Feb 2019 21:51:21 +0000 Subject: [PATCH 28/86] Move type registry to before the ic2 dict, add advanced alloy to classic dedupe. --- .../java/techreborn/init/IC2Duplicates.java | 3 +- src/main/java/techreborn/init/OreDict.java | 49 ++++++++++--------- .../init/recipes/SmeltingRecipes.java | 3 +- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index d1c079e95..be4b0168f 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -79,7 +79,8 @@ public enum IC2Duplicates { REFINED_IRON(ItemIngots.getIngotByName("refined_iron"), true), BASIC_MACHINE_FRAME(BlockMachineFrames.getFrameByName("basic"), true), ADVANCED_MACHINE_FRAME(BlockMachineFrames.getFrameByName("advanced"), true), - CARBON_PLATE(ItemPlates.getPlateByName("carbon"), true); + CARBON_PLATE(ItemPlates.getPlateByName("carbon"), true), + ADVANCED_ALLOY(ItemPlates.getPlateByName("advanced_alloy"), true); ItemStack ic2Stack; diff --git a/src/main/java/techreborn/init/OreDict.java b/src/main/java/techreborn/init/OreDict.java index ecd46ca88..f26879538 100644 --- a/src/main/java/techreborn/init/OreDict.java +++ b/src/main/java/techreborn/init/OreDict.java @@ -51,6 +51,31 @@ public class OreDict { ); public static void init() { + + for (String type : ItemGems.types) { + if (type.equals(ModItems.META_PLACEHOLDER)) + continue; //Aware of placeholders! + OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type)); + boolean ignoreIt = false; + for (String ignore : plateGenIgnores) + if (type.startsWith(ignore)) + ignoreIt = true; + if (!ignoreIt) + ItemPlates.registerType(type); + } + + for (String type : ItemIngots.types) { + if (type.equals(ModItems.META_PLACEHOLDER)) + continue; //Aware of placeholders! + OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type)); + boolean ignoreIt = false; + for (String ignore : plateGenIgnores) + if (type.startsWith(ignore)) + ignoreIt = true; + if (!ignoreIt) + ItemPlates.registerType(type); + } + if(TechRebornAPI.ic2Helper != null){ TechRebornAPI.ic2Helper.initDuplicates(); } @@ -108,30 +133,6 @@ public class OreDict { OreUtil.registerOre("pulpWood", ItemDusts.getDustByName("saw_dust")); OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes")); - for (String type : ItemGems.types) { - if (type.equals(ModItems.META_PLACEHOLDER)) - continue; //Aware of placeholders! - OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "gem_" + type), ItemGems.getGemByName(type)); - boolean ignoreIt = false; - for (String ignore : plateGenIgnores) - if (type.startsWith(ignore)) - ignoreIt = true; - if (!ignoreIt) - ItemPlates.registerType(type); - } - - for (String type : ItemIngots.types) { - if (type.equals(ModItems.META_PLACEHOLDER)) - continue; //Aware of placeholders! - OreUtil.registerOre(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "ingot_" + type), ItemIngots.getIngotByName(type)); - boolean ignoreIt = false; - for (String ignore : plateGenIgnores) - if (type.startsWith(ignore)) - ignoreIt = true; - if (!ignoreIt) - ItemPlates.registerType(type); - } - for (String type : ItemPlates.types) { if (type.equals(ModItems.META_PLACEHOLDER)) continue; //Aware of placeholders! diff --git a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java index 8304eabd4..4f0094c66 100644 --- a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java +++ b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java @@ -40,13 +40,14 @@ public class SmeltingRecipes extends RecipeMethods { register(getMaterial("sap", Type.PART), getMaterial("rubber", Type.PART)); if(!IC2Duplicates.isClassicalDedupe()){ register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT)); + register(IC2Duplicates.MIXED_METAL.getStackBasedOnConfig(), getMaterial("advanced_alloy", Type.INGOT)); } register(BlockOre2.getOreByName("copper"), getMaterial("copper", Type.INGOT)); register(BlockOre2.getOreByName("tin"), getMaterial("tin", Type.INGOT)); register(BlockOre.getOreByName("silver"), getMaterial("silver", Type.INGOT)); register(BlockOre.getOreByName("lead"), getMaterial("lead", Type.INGOT)); register(BlockOre.getOreByName("sheldonite"), getMaterial("platinum", Type.INGOT)); - register(IC2Duplicates.MIXED_METAL.getStackBasedOnConfig(), getMaterial("advanced_alloy", Type.INGOT)); + // Dust smelting register(getMaterial("iron", Type.DUST), getStack(Items.IRON_INGOT)); From 16ec10dcd3fd0ef9bd23f28399ebd88059761990 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 4 Feb 2019 21:59:22 +0000 Subject: [PATCH 29/86] Added config for classic dedupe, #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 15f2fb6af..315f648aa 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.7" +version = "2.20.8" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 4797d64f5b9fb1d98ed2ff1ae1fc783655c9150e Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Tue, 5 Feb 2019 00:15:43 +0000 Subject: [PATCH 30/86] #releaseBuild fix Advanced alloy --- build.gradle | 2 +- src/main/java/techreborn/init/IC2Duplicates.java | 2 +- src/main/java/techreborn/init/recipes/SmeltingRecipes.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 315f648aa..c0c7aa6f4 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.8" +version = "2.20.9" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index be4b0168f..b26329bb3 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -148,7 +148,7 @@ public enum IC2Duplicates { public ItemStack getStackBasedOnConfig() { //Used only for when de-duping classic only items - if(!classicOnly){ + if(!isClassicMode() && classicOnly){ return getTrStack(); } if (deduplicate()) { diff --git a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java index 4f0094c66..3103cdba1 100644 --- a/src/main/java/techreborn/init/recipes/SmeltingRecipes.java +++ b/src/main/java/techreborn/init/recipes/SmeltingRecipes.java @@ -40,13 +40,13 @@ public class SmeltingRecipes extends RecipeMethods { register(getMaterial("sap", Type.PART), getMaterial("rubber", Type.PART)); if(!IC2Duplicates.isClassicalDedupe()){ register(getStack(Items.IRON_INGOT), getMaterial("refined_iron", Type.INGOT)); - register(IC2Duplicates.MIXED_METAL.getStackBasedOnConfig(), getMaterial("advanced_alloy", Type.INGOT)); } register(BlockOre2.getOreByName("copper"), getMaterial("copper", Type.INGOT)); register(BlockOre2.getOreByName("tin"), getMaterial("tin", Type.INGOT)); register(BlockOre.getOreByName("silver"), getMaterial("silver", Type.INGOT)); register(BlockOre.getOreByName("lead"), getMaterial("lead", Type.INGOT)); register(BlockOre.getOreByName("sheldonite"), getMaterial("platinum", Type.INGOT)); + register(IC2Duplicates.MIXED_METAL.getStackBasedOnConfig(), getMaterial("advanced_alloy", Type.INGOT)); // Dust smelting From c4fff1bf56374171b6649f84f5d08552a32171d0 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 7 Feb 2019 20:26:41 +0000 Subject: [PATCH 31/86] Should fix #1666 --- .../tiles/tier1/TileRollingMachine.java | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java index 748a3ef73..db9f007c5 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java +++ b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java @@ -211,38 +211,42 @@ public class TileRollingMachine extends TilePowerAcceptor } } - int totalItems = possibleSlots.stream() - .mapToInt(value -> inventory.getStackInSlot(value).getCount()).sum(); - int slots = possibleSlots.size(); + if(!possibleSlots.isEmpty()){ + int totalItems = possibleSlots.stream() + .mapToInt(value -> inventory.getStackInSlot(value).getCount()).sum(); + int slots = possibleSlots.size(); - //This makes an array of ints with the best possible slot distribution - int[] split = new int[slots]; - int remainder = totalItems % slots; - Arrays.fill(split, totalItems / slots); - while (remainder > 0){ - for (int i = 0; i < split.length; i++) { - if(remainder > 0){ - split[i] +=1; - remainder --; + //This makes an array of ints with the best possible slot distribution + int[] split = new int[slots]; + int remainder = totalItems % slots; + Arrays.fill(split, totalItems / slots); + while (remainder > 0){ + for (int i = 0; i < split.length; i++) { + if(remainder > 0){ + split[i] +=1; + remainder --; + } } } - } - List slotDistrubution = possibleSlots.stream() - .mapToInt(value -> inventory.getStackInSlot(value).getCount()) - .boxed().collect(Collectors.toList()); + List slotDistrubution = possibleSlots.stream() + .mapToInt(value -> inventory.getStackInSlot(value).getCount()) + .boxed().collect(Collectors.toList()); - boolean needsBalance = false; - for (int i = 0; i < split.length; i++) { - int required = split[i]; - if(slotDistrubution.contains(required)){ - //We need to remove the int, not at the int, this seems to work around that - slotDistrubution.remove(new Integer(required)); - } else { - needsBalance = true; + boolean needsBalance = false; + for (int i = 0; i < split.length; i++) { + int required = split[i]; + if(slotDistrubution.contains(required)){ + //We need to remove the int, not at the int, this seems to work around that + slotDistrubution.remove(new Integer(required)); + } else { + needsBalance = true; + } } - } - if (!needsBalance) { + if (!needsBalance) { + return Optional.empty(); + } + } else { return Optional.empty(); } From 3610535169cbcf0150ddbe1784c92d86c5b4ebd1 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 7 Feb 2019 21:26:37 +0000 Subject: [PATCH 32/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c0c7aa6f4..37b86e660 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.9" +version = "2.20.10" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 0fa72c4fc318ba18c37d3a13ef5f8b75a4d5ac64 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 11 Feb 2019 15:32:24 +0300 Subject: [PATCH 33/86] More efficient diamond grinding and armor recycling --- src/main/java/techreborn/init/ModRecipes.java | 28 ++++++++----------- .../recipes/IndustrialGrinderRecipes.java | 6 ++-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index bd4bd4c73..719f28fea 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -392,6 +392,18 @@ public class ModRecipes { RecipeHandler.addRecipe( new BlastFurnaceRecipe(BlockOre.getOreByName("Pyrite"), ItemDusts.getDustByName("calcite"), new ItemStack(Items.IRON_INGOT, 2), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); + RecipeHandler.addRecipe( + new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_HELMET), new ItemStack(Blocks.SAND), + new ItemStack(Items.DIAMOND, 5), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); + RecipeHandler.addRecipe( + new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_CHESTPLATE), new ItemStack(Blocks.SAND), + new ItemStack(Items.DIAMOND, 8), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); + RecipeHandler.addRecipe( + new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_LEGGINGS), new ItemStack(Blocks.SAND), + new ItemStack(Items.DIAMOND, 7), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); + RecipeHandler.addRecipe( + new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_BOOTS), new ItemStack(Blocks.SAND), + new ItemStack(Items.DIAMOND, 4), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); } static void addIc2Recipes() { @@ -420,22 +432,6 @@ public class ModRecipes { // 'L', "lapotronCrystal", // 'T', TechRebornAPI.recipeCompact.getItem("teleporter")); - // RebornCraftingHelper.addShapedOreRecipe(new - // ItemStack(ModBlocks.electricCraftingTable), - // "ITI", "IBI", "ICI", - // 'I', "plateIron", - // 'C', "circuitAdvanced", - // 'T', "crafterWood", - // 'B', "machineBlockBasic"); - - // RebornCraftingHelper.addShapedOreRecipe(new - // ItemStack(ModBlocks.electricCraftingTable), - // "ATA", "ABA", "ACA", - // 'A', "plateAluminum", - // 'C', "circuitAdvanced", - // 'T', "crafterWood", - // 'B', "machineBlockBasic"); - // RebornCraftingHelper.addShapedOreRecipe(new // ItemStack(ModBlocks.chunkLoader), // "SCS", "CMC", "SCS", diff --git a/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java index 282985a58..85638645e 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialGrinderRecipes.java @@ -65,9 +65,11 @@ public class IndustrialGrinderRecipes extends RecipeMethods { register(getOre("oreRedstone"), WATER, 100, 64, getStack(Items.REDSTONE, 10), getMaterial("glowstone", 2, Type.SMALL_DUST)); register(getOre("oreDiamond"), WATER, 100, 64, getStack(Items.DIAMOND), getMaterial("diamond", 6, Type.SMALL_DUST), getMaterial("coal", Type.DUST)); - - register(getOre("oreEmerald"), WATER, 100, 64, getStack(Items.EMERALD), getMaterial("emerald", 6, Type.SMALL_DUST)); + register(getOre("oreDiamond"), MERCURY, 100, 64, getStack(Items.DIAMOND, 2), getMaterial("diamond", 3, Type.SMALL_DUST)); + register(getOre("oreEmerald"), WATER, 100, 64, getStack(Items.EMERALD), getMaterial("emerald", 6, Type.SMALL_DUST)); + register(getOre("oreEmerald"), MERCURY, 100, 64, getStack(Items.EMERALD, 2), getMaterial("emerald", 3, Type.SMALL_DUST)); + //TR ores register(getOre("oreCopper"), WATER, 100, 64, getMaterial("copper", 2, Type.DUST), getMaterial("gold", Type.SMALL_DUST), getMaterial("nickel", Type.SMALL_DUST)); register(getOre("oreCopper"), SODIUM_PERSULFATE, 100, 64, getMaterial("copper", 3, Type.DUST), getMaterial("gold", Type.SMALL_DUST), getMaterial("nickel", Type.SMALL_DUST)); From 3fb799e544c0933204e8d058a059429338f53018 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 11 Feb 2019 15:35:37 +0300 Subject: [PATCH 34/86] Removed unused imports --- src/main/java/techreborn/init/IC2Duplicates.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index b26329bb3..78422e973 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -30,11 +30,9 @@ import techreborn.api.TechRebornAPI; import techreborn.blocks.BlockMachineFrames; import techreborn.blocks.cable.EnumCableType; import techreborn.config.ConfigTechReborn; -import techreborn.itemblocks.ItemBlockMachineFrames; import techreborn.items.ingredients.ItemIngots; import techreborn.items.ingredients.ItemParts; import techreborn.items.ingredients.ItemPlates; -import techreborn.lib.ModInfo; /** * Created by Mark on 18/12/2016. From 008358b39c375074ca2b77cf5e1ef39af96f5670 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 11 Feb 2019 23:50:48 +0000 Subject: [PATCH 35/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 37b86e660..6c65ccd65 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.10" +version = "2.20.11" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From fbcab3bf2dcf23809352cc3458fe829bb9215653 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Wed, 13 Feb 2019 11:20:52 +0300 Subject: [PATCH 36/86] DRY for IronAlloySmelter fuel burn time --- .../tiles/tier0/TileIronAlloyFurnace.java | 53 ++----------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java index 2b0130819..2f75357d1 100644 --- a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java @@ -30,6 +30,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.*; +import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.EnumFacing; import reborncore.api.IToolDrop; import reborncore.api.recipe.IBaseRecipeType; @@ -68,63 +69,15 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase /** * Returns the number of ticks that the supplied fuel item will keep the - * furnace burning, or 0 if the item isn't fuel + * alloy furnace burning, or 0 if the item isn't fuel * @param stack Itemstack of fuel * @return Integer Number of ticks */ public static int getItemBurnTime(ItemStack stack) { if (stack.isEmpty()) { return 0; - } else { - int burnTime = net.minecraftforge.event.ForgeEventFactory.getItemBurnTime(stack); - if (burnTime >= 0) - return burnTime; - Item item = stack.getItem(); - - if (item == Item.getItemFromBlock(Blocks.WOODEN_SLAB)) { - return 150; - } else if (item == Item.getItemFromBlock(Blocks.WOOL)) { - return 100; - } else if (item == Item.getItemFromBlock(Blocks.CARPET)) { - return 67; - } else if (item == Item.getItemFromBlock(Blocks.LADDER)) { - return 300; - } else if (item == Item.getItemFromBlock(Blocks.WOODEN_BUTTON)) { - return 100; - } else if (Block.getBlockFromItem(item).getDefaultState().getMaterial() == Material.WOOD) { - return 300; - } else if (item == Item.getItemFromBlock(Blocks.COAL_BLOCK)) { - return 16000; - } else if (item instanceof ItemTool && "WOOD".equals(((ItemTool) item).getToolMaterialName())) { - return 200; - } else if (item instanceof ItemSword && "WOOD".equals(((ItemSword) item).getToolMaterialName())) { - return 200; - } else if (item instanceof ItemHoe && "WOOD".equals(((ItemHoe) item).getMaterialName())) { - return 200; - } else if (item == Items.STICK) { - return 100; - } else if (item != Items.BOW && item != Items.FISHING_ROD) { - if (item == Items.SIGN) { - return 200; - } else if (item == Items.COAL) { - return 1600; - } else if (item == Items.LAVA_BUCKET) { - return 20000; - } else if (item != Item.getItemFromBlock(Blocks.SAPLING) && item != Items.BOWL) { - if (item == Items.BLAZE_ROD) { - return 2400; - } else if (item instanceof ItemDoor && item != Items.IRON_DOOR) { - return 200; - } else { - return item instanceof ItemBoat ? 400 : 0; - } - } else { - return 100; - } - } else { - return 300; - } } + return (int) (TileEntityFurnace.getItemBurnTime(stack) * 1.25); } @Override From 8e34062f6e68224786839cc8f10174ed668dbc9a Mon Sep 17 00:00:00 2001 From: drcrazy Date: Wed, 13 Feb 2019 14:56:49 +0300 Subject: [PATCH 37/86] Iron alloy smelter should consume right amount of inputs. Closes #1667 --- .../tiles/tier0/TileIronAlloyFurnace.java | 318 +++++++++--------- 1 file changed, 153 insertions(+), 165 deletions(-) diff --git a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java index 2f75357d1..7c2aaec85 100644 --- a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java @@ -24,14 +24,9 @@ package techreborn.tiles.tier0; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.*; import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraft.util.EnumFacing; import reborncore.api.IToolDrop; import reborncore.api.recipe.IBaseRecipeType; import reborncore.api.recipe.RecipeHandler; @@ -60,7 +55,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase public int cookTime; int input1 = 0; int input2 = 1; - int output = 2; + int outputSlot = 2; int fuel = 3; public TileIronAlloyFurnace() { @@ -79,47 +74,12 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase } return (int) (TileEntityFurnace.getItemBurnTime(stack) * 1.25); } - - @Override - public void update() { - super.update(); - final boolean flag = this.burnTime > 0; - boolean flag1 = false; - if (this.burnTime > 0) { - --this.burnTime; - } - if (!this.world.isRemote) { - if (this.burnTime != 0 || !this.getStackInSlot(this.input1).isEmpty()&& !this.getStackInSlot(this.fuel).isEmpty()) { - if (this.burnTime == 0 && this.canSmelt()) { - this.currentItemBurnTime = this.burnTime = TileIronAlloyFurnace.getItemBurnTime(this.getStackInSlot(this.fuel)); - if (this.burnTime > 0) { - flag1 = true; - if (!this.getStackInSlot(this.fuel).isEmpty()) { - this.decrStackSize(this.fuel, 1); - } - } - } - if (this.isBurning() && this.canSmelt()) { - ++this.cookTime; - if (this.cookTime == 200) { - this.cookTime = 0; - this.smeltItem(); - flag1 = true; - } - } else { - this.cookTime = 0; - } - } - if (flag != this.burnTime > 0) { - flag1 = true; - // TODO sync on/off - } - } - if (flag1) { - this.markDirty(); - } - } - + + /** + * Checks if alloy furnace has all inputs for recipe + * @param recipeType IBaseRecipeType Alloy Smelter Recipe + * @return boolean True if we have all inputs necessery for recipe + */ public boolean hasAllInputs(final IBaseRecipeType recipeType) { if (recipeType == null) { return false; @@ -129,140 +89,190 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase boolean useOreDict = input instanceof String || recipeType.useOreDic(); boolean checkSize = input instanceof ItemStack; for (int inputslot = 0; inputslot < 2; inputslot++) { - if (ItemUtils.isInputEqual(input, inventory.getStackInSlot(inputslot), true, true, - useOreDict)) { - ItemStack stack = RecipeTranslator.getStackFromObject(input); - if (!checkSize || inventory.getStackInSlot(inputslot).getCount() >= stack.getCount()) { + if (ItemUtils.isInputEqual(input, inventory.getStackInSlot(inputslot), true, true, useOreDict)) { + ItemStack inputStack = RecipeTranslator.getStackFromObject(input); + if (!checkSize || inventory.getStackInSlot(inputslot).getCount() >= inputStack.getCount()) { hasItem = true; } } } - if (!hasItem) + if (!hasItem) { return false; + } } return true; } - - private boolean canSmelt() { - if (this.getStackInSlot(this.input1).isEmpty() || this.getStackInSlot(this.input2).isEmpty()) { - return false; - } else { - ItemStack itemstack = null; - for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) { - if (this.hasAllInputs(recipeType)) { - itemstack = recipeType.getOutput(0); - break; - } - } - - if (itemstack == null) - return false; - if (this.getStackInSlot(this.output).isEmpty()) - return true; - if (!this.getStackInSlot(this.output).isItemEqual(itemstack)) - return false; - final int result = this.getStackInSlot(this.output).getCount() + itemstack.getCount(); - return result <= this.getInventoryStackLimit() && result <= this.getStackInSlot(this.output).getMaxStackSize(); // Forge - // BugFix: - // Make - // it - // respect - // stack - // sizes - // properly. - } - } - + /** - * Turn one item from the furnace source stack into the appropriate smelted - * item in the furnace result stack + * Checks if it has inputs and can fit recipe outputSlot to outputSlot slot + * @return boolean True if it can fit outputSlot itemstack into outputSlot slot */ - public void smeltItem() { - if (this.canSmelt()) { - ItemStack itemstack = ItemStack.EMPTY; - for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) { - if (this.hasAllInputs(recipeType)) { - itemstack = recipeType.getOutput(0); - break; - } - if (!itemstack.isEmpty()) { - break; - } + private boolean canSmelt() { + if (getStackInSlot(input1).isEmpty() || getStackInSlot(input2).isEmpty()) { + return false; + } + ItemStack outputStack = null; + for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) { + if (hasAllInputs(recipeType)) { + outputStack = recipeType.getOutput(0); + break; } - - if (this.getStackInSlot(this.output).isEmpty()) { - this.setInventorySlotContents(this.output, itemstack.copy()); - } else if (this.getStackInSlot(this.output).getItem() == itemstack.getItem()) { - this.decrStackSize(this.output, -itemstack.getCount()); - } - - for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) { - boolean hasAllRecipes = true; - if (this.hasAllInputs(recipeType)) { - - } else { - hasAllRecipes = false; - } - if (hasAllRecipes) { - for (Object input : recipeType.getInputs()) { - boolean useOreDict = input instanceof String || recipeType.useOreDic(); - for (int inputSlot = 0; inputSlot < 2; inputSlot++) { - if (ItemUtils.isInputEqual(input, this.inventory.getStackInSlot(inputSlot), true, true, useOreDict)) { - int count = 1; - if (input instanceof ItemStack) { - count = RecipeTranslator.getStackFromObject(input).getCount(); - } - inventory.decrStackSize(inputSlot, count); - break; - } - } - } - } - } - } - } + if (outputStack == null) { + return false; + } + ItemStack outputSlotStack = getStackInSlot(outputSlot); + if (outputSlotStack.isEmpty()) { + return true; + } + if (!outputSlotStack.isItemEqual(outputStack)) { + return false; + } + + final int result = outputSlotStack.getCount() + outputStack.getCount(); + return result <= getInventoryStackLimit() && result <= outputSlotStack.getMaxStackSize(); + } + /** - * Furnace isBurning - * @return Boolean True if furnace is burning + * Alloy Furnace isBurning + * @return Boolean True if alloy furnace is burning */ public boolean isBurning() { - return this.burnTime > 0; + return burnTime > 0; } public int getBurnTimeRemainingScaled(final int scale) { - if (this.currentItemBurnTime == 0) { - this.currentItemBurnTime = 200; + if (currentItemBurnTime == 0) { + currentItemBurnTime = 200; } - return this.burnTime * scale / this.currentItemBurnTime; + return burnTime * scale / currentItemBurnTime; } public int getCookProgressScaled(final int scale) { - return this.cookTime * scale / 200; + return cookTime * scale / 200; + } + + /** + * Turn inputs into the appropriate smelted item in the alloy furnace result stack + */ + public void smeltItem() { + if (!canSmelt()) { + return; + } + ItemStack outputStack = ItemStack.EMPTY; + IBaseRecipeType alloySmelterRecipe = null; + + for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) { + if (hasAllInputs(recipeType)) { + alloySmelterRecipe = recipeType; + outputStack = recipeType.getOutput(0); + break; + } + } + + if (alloySmelterRecipe == null || outputStack.isEmpty()) { + return; + } + + // Add recipe results + ItemStack outputSlotStack = getStackInSlot(outputSlot); + if (outputSlotStack.isEmpty()) { + setInventorySlotContents(outputSlot, outputStack.copy()); + } else if (getStackInSlot(outputSlot).getItem() == outputStack.getItem()) { + decrStackSize(outputSlot, -outputStack.getCount()); + } + + // Remove recipe ingredients + for (Object input : alloySmelterRecipe.getInputs()) { + boolean useOreDict = input instanceof String || alloySmelterRecipe.useOreDic(); + for (int inputSlot = 0; inputSlot < 2; inputSlot++) { + if (ItemUtils.isInputEqual(input, inventory.getStackInSlot(inputSlot), true, true, useOreDict)) { + int count = RecipeTranslator.getStackFromObject(input).getCount(); + inventory.decrStackSize(inputSlot, count); + } + } + } } + // TileLegacyMachineBase @Override - public EnumFacing getFacing() { - return this.getFacingEnum(); + public void update() { + super.update(); + final boolean burning = isBurning(); + boolean updateInventory = false; + if (burning) { + --burnTime; + } + if (world.isRemote) { + return; + } + ItemStack fuelStack = getStackInSlot(fuel); + if (burnTime != 0 || !getStackInSlot(input1).isEmpty() && !fuelStack.isEmpty()) { + if (burnTime == 0 && canSmelt()) { + currentItemBurnTime = burnTime = TileIronAlloyFurnace.getItemBurnTime(fuelStack); + if (burnTime > 0) { + updateInventory = true; + if (!fuelStack.isEmpty()) { + decrStackSize(fuel, 1); + } + } + } + if (isBurning() && canSmelt()) { + ++cookTime; + if (cookTime == 200) { + cookTime = 0; + smeltItem(); + updateInventory = true; + } + } else { + cookTime = 0; + } + } + if (burning != isBurning()) { + updateInventory = true; + } + if (updateInventory) { + markDirty(); + } + } + + @Override + public boolean canBeUpgraded() { + return false; } + // IToolDrop @Override public ItemStack getToolDrop(final EntityPlayer entityPlayer) { return new ItemStack(ModBlocks.IRON_ALLOY_FURNACE, 1); } - public boolean isComplete() { - return false; - } - + // IInventoryProvider @Override public Inventory getInventory() { - return this.inventory; + return inventory; } - + // IContainerProvider + @Override + public BuiltContainer createContainer(final EntityPlayer player) { + return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142) + .addInventory().tile(this) + .filterSlot(0, 47, 17, + stack -> RecipeHandler.recipeList.stream() + .anyMatch(recipe -> recipe instanceof AlloySmelterRecipe + && ItemUtils.isInputEqual(recipe.getInputs().get(0), stack, true, true, true))) + .filterSlot(1, 65, 17, + stack -> RecipeHandler.recipeList.stream() + .anyMatch(recipe -> recipe instanceof AlloySmelterRecipe + && ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true, true))) + .outputSlot(2, 116, 35).fuelSlot(3, 56, 53).syncIntegerValue(this::getBurnTime, this::setBurnTime) + .syncIntegerValue(this::getCookTime, this::setCookTime) + .syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create(this); + } + public int getBurnTime() { return this.burnTime; } @@ -286,26 +296,4 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase public void setCookTime(final int cookTime) { this.cookTime = cookTime; } - - @Override - public BuiltContainer createContainer(final EntityPlayer player) { - return new ContainerBuilder("alloyfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this) - .filterSlot(0, 47, 17, - stack -> RecipeHandler.recipeList.stream() - .anyMatch(recipe -> recipe instanceof AlloySmelterRecipe - && ItemUtils.isInputEqual(recipe.getInputs().get(0), stack, true, true, true))) - .filterSlot(1, 65, 17, - stack -> RecipeHandler.recipeList.stream() - .anyMatch(recipe -> recipe instanceof AlloySmelterRecipe - && ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true, true))) - .outputSlot(2, 116, 35).fuelSlot(3, 56, 53).syncIntegerValue(this::getBurnTime, this::setBurnTime) - .syncIntegerValue(this::getCookTime, this::setCookTime) - .syncIntegerValue(this::getCurrentItemBurnTime, this::setCurrentItemBurnTime).addInventory().create(this); - } - - @Override - public boolean canBeUpgraded() { - return false; - } } From 4addff892b892fc62c35f4b50e78ac9ccb7383b3 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 14 Feb 2019 15:58:33 +0000 Subject: [PATCH 38/86] Create a WrenchContext to allow for ic2 mod compat to register support for using ic2's wrench --- .../java/techreborn/items/tools/ItemWrench.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/techreborn/items/tools/ItemWrench.java b/src/main/java/techreborn/items/tools/ItemWrench.java index 83314f883..e99655c40 100644 --- a/src/main/java/techreborn/items/tools/ItemWrench.java +++ b/src/main/java/techreborn/items/tools/ItemWrench.java @@ -44,6 +44,9 @@ import techreborn.items.ItemTR; */ public class ItemWrench extends ItemTR implements IToolHandler { + //Set by TR mod compat + public static WrenchContext ic2WrenchContext; + public ItemWrench() { setUnlocalizedName("techreborn.wrench"); setMaxStackSize(1); @@ -52,6 +55,12 @@ public class ItemWrench extends ItemTR implements IToolHandler { @Override public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + if(ic2WrenchContext != null){ + EnumActionResult actionResult = ic2WrenchContext.onItemUse(player, world, pos, hand, facing, hitX, hitY, hitZ); + if(actionResult != EnumActionResult.FAIL){ + return actionResult; + } + } if (!world.isRemote && !PermissionAPI.hasPermission(player.getGameProfile(), RebornPermissions.WRENCH_BLOCK, new BlockPosContext(player, pos, world.getBlockState(pos), facing))) { return EnumActionResult.PASS; } @@ -71,4 +80,10 @@ public class ItemWrench extends ItemTR implements IToolHandler { } return true; } + + @FunctionalInterface + public interface WrenchContext { + EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ); + } } From 8b8225987129e50118dd7fe668174e8927f66ae7 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Fri, 15 Feb 2019 14:19:48 +0300 Subject: [PATCH 39/86] Iron and gold armor recycling in blast furnace. --- src/main/java/techreborn/init/ModRecipes.java | 62 +---------- .../init/recipes/BlastFurnaceRecipes.java | 105 ++++++++++++++++++ 2 files changed, 107 insertions(+), 60 deletions(-) create mode 100644 src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 719f28fea..75448d75d 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -39,17 +39,14 @@ import reborncore.common.util.ItemUtils; import reborncore.common.util.OreUtil; import reborncore.common.util.RebornCraftingHelper; import techreborn.Core; -import techreborn.api.recipe.machines.BlastFurnaceRecipe; import techreborn.api.recipe.machines.CompressorRecipe; import techreborn.api.recipe.machines.GrinderRecipe; import techreborn.api.recipe.machines.VacuumFreezerRecipe; -import techreborn.blocks.BlockOre; import techreborn.compat.CompatManager; import techreborn.config.ConfigTechReborn; import techreborn.init.recipes.*; import techreborn.items.*; import techreborn.items.ingredients.ItemDusts; -import techreborn.items.ingredients.ItemDustsSmall; import techreborn.items.ingredients.ItemIngots; import techreborn.items.ingredients.ItemPlates; import techreborn.lib.ModInfo; @@ -88,8 +85,9 @@ public class ModRecipes { DistillationTowerRecipes.init(); AlloySmelterRecipes.init(); FluidReplicatorRecipes.init(); + BlastFurnaceRecipes.init(); + - addBlastFurnaceRecipes(); addVacuumFreezerRecipes(); addIc2Recipes(); addGrinderRecipes(); @@ -350,62 +348,6 @@ public class ModRecipes { } - static void addBlastFurnaceRecipes() { - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemDusts.getDustByName("titanium"), null, ItemIngots.getIngotByName("titanium"), - null, 3600, 120, 1500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("titanium", 4), null, - ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemDusts.getDustByName("aluminum"), null, ItemIngots.getIngotByName("aluminum"), - null, 2200, 120, 1700)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("aluminum", 4), null, - ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemDusts.getDustByName("tungsten"), null, ItemIngots.getIngotByName("tungsten"), - null, 1800, 120, 2500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("tungsten", 4), null, - ItemIngots.getIngotByName("tungsten"), null, 1800, 120, 2500)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemDusts.getDustByName("chrome"), null, ItemIngots.getIngotByName("chrome"), - null, 4420, 120, 1700)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("chrome", 4), null, - ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemDusts.getDustByName("steel"), null, ItemIngots.getIngotByName("steel"), null, - 2800, 120, 1000)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("steel", 4), null, - ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemDusts.getDustByName("galena", 2), null, ItemIngots.getIngotByName("silver"), - ItemIngots.getIngotByName("lead"), 80, 120, 1500)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(new ItemStack(Items.IRON_INGOT), ItemDusts.getDustByName("coal", 2), - ItemIngots.getIngotByName("steel"), ItemDusts.getDustByName("dark_ashes", 2), 500, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(ItemIngots.getIngotByName("tungsten"), ItemIngots.getIngotByName("steel"), - ItemIngots.getIngotByName("hot_tungstensteel"), ItemDusts.getDustByName("dark_ashes", 4), 500, - 128, 3000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(new ItemStack(Blocks.IRON_ORE), ItemDusts.getDustByName("calcite"), - new ItemStack(Items.IRON_INGOT, 3), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(BlockOre.getOreByName("Pyrite"), ItemDusts.getDustByName("calcite"), - new ItemStack(Items.IRON_INGOT, 2), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_HELMET), new ItemStack(Blocks.SAND), - new ItemStack(Items.DIAMOND, 5), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_CHESTPLATE), new ItemStack(Blocks.SAND), - new ItemStack(Items.DIAMOND, 8), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_LEGGINGS), new ItemStack(Blocks.SAND), - new ItemStack(Items.DIAMOND, 7), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); - RecipeHandler.addRecipe( - new BlastFurnaceRecipe(new ItemStack(Items.DIAMOND_BOOTS), new ItemStack(Blocks.SAND), - new ItemStack(Items.DIAMOND, 4), ItemDusts.getDustByName("dark_ashes"), 140, 120, 1000)); - } - static void addIc2Recipes() { RebornCraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.MANUAL), "ingotRefinedIron", Items.BOOK); diff --git a/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java b/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java new file mode 100644 index 000000000..9527af133 --- /dev/null +++ b/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java @@ -0,0 +1,105 @@ +/* + * This file is part of TechReborn, licensed under the MIT License (MIT). + * + * Copyright (c) 2018 TechReborn + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package techreborn.init.recipes; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import reborncore.api.recipe.RecipeHandler; +import techreborn.api.recipe.machines.BlastFurnaceRecipe; +import techreborn.blocks.BlockOre; +import techreborn.items.ingredients.ItemDusts; +import techreborn.items.ingredients.ItemDustsSmall; +import techreborn.items.ingredients.ItemIngots; + +/** + * @author drcrazy + * + */ +public class BlastFurnaceRecipes extends RecipeMethods { + + public static void init() { + register(ItemDusts.getDustByName("titanium"), null, ItemIngots.getIngotByName("titanium"), null, 3600, 1500); + register(ItemDustsSmall.getSmallDustByName("titanium", 4), null, ItemIngots.getIngotByName("titanium"), null, + 3600, 1500); + register(ItemDusts.getDustByName("aluminum"), null, ItemIngots.getIngotByName("aluminum"), null, 2200, 1700); + register(ItemDustsSmall.getSmallDustByName("aluminum", 4), null, ItemIngots.getIngotByName("aluminum"), null, + 2200, 1700); + register(ItemDusts.getDustByName("tungsten"), null, ItemIngots.getIngotByName("tungsten"), null, 1800, 2500); + register(ItemDustsSmall.getSmallDustByName("tungsten", 4), null, ItemIngots.getIngotByName("tungsten"), null, + 1800, 2500); + register(ItemDusts.getDustByName("chrome"), null, ItemIngots.getIngotByName("chrome"), null, 4420, 1700); + register(ItemDustsSmall.getSmallDustByName("chrome", 4), null, ItemIngots.getIngotByName("chrome"), null, 4420, + 1700); + register(ItemDusts.getDustByName("steel"), null, ItemIngots.getIngotByName("steel"), null, 2800, 1000); + register(ItemDustsSmall.getSmallDustByName("steel", 4), null, ItemIngots.getIngotByName("steel"), null, 2800, + 1000); + register(ItemDusts.getDustByName("galena", 2), null, ItemIngots.getIngotByName("silver"), + ItemIngots.getIngotByName("lead"), 80, 1500); + register(new ItemStack(Items.IRON_INGOT), ItemDusts.getDustByName("coal", 2), + ItemIngots.getIngotByName("steel"), ItemDusts.getDustByName("dark_ashes", 2), 500, 1000); + register(ItemIngots.getIngotByName("tungsten"), ItemIngots.getIngotByName("steel"), + ItemIngots.getIngotByName("hot_tungstensteel"), ItemDusts.getDustByName("dark_ashes", 4), 500, 128, + 3000); + register(new ItemStack(Blocks.IRON_ORE), ItemDusts.getDustByName("calcite"), new ItemStack(Items.IRON_INGOT, 3), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(BlockOre.getOreByName("Pyrite"), ItemDusts.getDustByName("calcite"), + new ItemStack(Items.IRON_INGOT, 2), ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.DIAMOND_HELMET), new ItemStack(Blocks.SAND), new ItemStack(Items.DIAMOND, 5), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.DIAMOND_CHESTPLATE), new ItemStack(Blocks.SAND), new ItemStack(Items.DIAMOND, 8), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.DIAMOND_LEGGINGS), new ItemStack(Blocks.SAND), new ItemStack(Items.DIAMOND, 7), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.DIAMOND_BOOTS), new ItemStack(Blocks.SAND), new ItemStack(Items.DIAMOND, 4), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.GOLDEN_HELMET), new ItemStack(Blocks.SAND), new ItemStack(Items.GOLD_INGOT, 5), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.GOLDEN_CHESTPLATE), new ItemStack(Blocks.SAND), new ItemStack(Items.GOLD_INGOT, 8), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.GOLDEN_LEGGINGS), new ItemStack(Blocks.SAND), new ItemStack(Items.GOLD_INGOT, 7), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.GOLDEN_BOOTS), new ItemStack(Blocks.SAND), new ItemStack(Items.GOLD_INGOT, 4), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.IRON_HELMET), new ItemStack(Blocks.SAND), new ItemStack(Items.IRON_INGOT, 5), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.IRON_CHESTPLATE), new ItemStack(Blocks.SAND), new ItemStack(Items.IRON_INGOT, 8), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.IRON_LEGGINGS), new ItemStack(Blocks.SAND), new ItemStack(Items.IRON_INGOT, 7), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + register(new ItemStack(Items.IRON_BOOTS), new ItemStack(Blocks.SAND), new ItemStack(Items.IRON_INGOT, 4), + ItemDusts.getDustByName("dark_ashes"), 140, 1000); + } + + private static void register(ItemStack in1, ItemStack in2, ItemStack out1, ItemStack out2, int tickTime, + int euPerTick, int neededHeat) { + RecipeHandler.addRecipe(new BlastFurnaceRecipe(in1, in2, out1, out2, tickTime, euPerTick, neededHeat)); + } + + private static void register(ItemStack in1, ItemStack in2, ItemStack out1, ItemStack out2, int tickTime, + int neededHeat) { + register(in1, in2, out1, out2, tickTime, 120, neededHeat); + } + +} \ No newline at end of file From 65b95afed83aa7dd087be8e41acb489347e84b4d Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 15 Feb 2019 18:33:45 +0000 Subject: [PATCH 40/86] After complaints that the manual is a scam, you can now refund it back into its ingredients. Can be disabled in config --- src/main/java/techreborn/Core.java | 1 + .../java/techreborn/client/gui/GuiManual.java | 27 +++++-- .../java/techreborn/packets/PacketRefund.java | 73 +++++++++++++++++++ .../assets/techreborn/lang/en_us.lang | 2 + 4 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 src/main/java/techreborn/packets/PacketRefund.java diff --git a/src/main/java/techreborn/Core.java b/src/main/java/techreborn/Core.java index 730ea982b..5eab5943e 100644 --- a/src/main/java/techreborn/Core.java +++ b/src/main/java/techreborn/Core.java @@ -216,6 +216,7 @@ public class Core { event.registerPacket(PacketRollingMachineLock.class, Side.SERVER); event.registerPacket(PacketFusionControlSize.class, Side.SERVER); event.registerPacket(PacketAutoCraftingTableLock.class, Side.SERVER); + event.registerPacket(PacketRefund.class, Side.SERVER); } @Mod.EventHandler diff --git a/src/main/java/techreborn/client/gui/GuiManual.java b/src/main/java/techreborn/client/gui/GuiManual.java index 629cf9f05..f4ff2d868 100644 --- a/src/main/java/techreborn/client/gui/GuiManual.java +++ b/src/main/java/techreborn/client/gui/GuiManual.java @@ -30,10 +30,13 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; +import reborncore.common.network.NetworkManager; import techreborn.items.ItemTechManual; +import techreborn.packets.PacketRefund; import java.awt.*; + public class GuiManual extends GuiScreen { ItemTechManual manual; @@ -44,7 +47,7 @@ public class GuiManual extends GuiScreen { int guiHeight = 195; private static final String text1 = I18n.format("techreborn.manual.wiki"); private static final String text2 = I18n.format("techreborn.manual.discord"); - + private static final String text3 = I18n.format("techreborn.manual.refund"); public GuiManual(EntityPlayer player) { this.player = player; @@ -57,8 +60,12 @@ public class GuiManual extends GuiScreen { @Override public void initGui() { - buttonList.add(new GuiButton(1, (width / 2 - 30), (height / 2 - (guiHeight / 4)) + 17, 60, 20, I18n.format("techreborn.manual.wikibtn"))); - buttonList.add(new GuiButton(2, (width / 2 - 30), (height / 2) + 22, 60, 20, I18n.format("techreborn.manual.discordbtn"))); + int y = height / 4; + buttonList.add(new GuiButton(1, (width / 2 - 30), y + 10, 60, 20, I18n.format("techreborn.manual.wikibtn"))); + buttonList.add(new GuiButton(2, (width / 2 - 30), y + 60, 60, 20, I18n.format("techreborn.manual.discordbtn"))); + if(PacketRefund.allowRefund){ + buttonList.add(new GuiButton(3, (width / 2 - 30), y + 110, 60, 20, I18n.format("techreborn.manual.refundbtn"))); + } } @Override @@ -68,8 +75,12 @@ public class GuiManual extends GuiScreen { int centerX = (width / 2) - guiWidth / 2; int centerY = (height / 2) - guiHeight / 2; drawTexturedModalRect(centerX, centerY, 0, 0, guiWidth, guiHeight); - fontRenderer.drawString(text1, ((width / 2) - fontRenderer.getStringWidth(text1) / 2), height / 2 - (guiHeight / 4), 4210752); - fontRenderer.drawString(text2, ((width / 2) - fontRenderer.getStringWidth(text2) / 2), height / 2 + 5, 4210752); + int y = height / 4; + fontRenderer.drawString(text1, ((width / 2) - fontRenderer.getStringWidth(text1) / 2), y, 4210752); + fontRenderer.drawString(text2, ((width / 2) - fontRenderer.getStringWidth(text2) / 2), y + 50, 4210752); + if(PacketRefund.allowRefund){ + fontRenderer.drawString(text3, ((width / 2) - fontRenderer.getStringWidth(text3) / 2), y + 100, 4210752); + } super.drawScreen(mouseX, mouseY, partialTicks); } @@ -80,7 +91,11 @@ public class GuiManual extends GuiScreen { mc.displayGuiScreen(new GuiConfirmOpenLink(this, "http://wiki.techreborn.ovh", 1, false)); break; case 2: - mc.displayGuiScreen(new GuiConfirmOpenLink(this, "http://discord.gg/0tCDWb77cvetwm0e", 2, false)); + mc.displayGuiScreen(new GuiConfirmOpenLink(this, "https://discord.gg/teamreborn", 2, false)); + break; + case 3: + mc.displayGuiScreen(null); + NetworkManager.sendToServer(new PacketRefund()); break; } } diff --git a/src/main/java/techreborn/packets/PacketRefund.java b/src/main/java/techreborn/packets/PacketRefund.java new file mode 100644 index 000000000..1d4cb39cc --- /dev/null +++ b/src/main/java/techreborn/packets/PacketRefund.java @@ -0,0 +1,73 @@ +/* + * This file is part of TechReborn, licensed under the MIT License (MIT). + * + * Copyright (c) 2018 TechReborn + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package techreborn.packets; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import reborncore.common.network.ExtendedPacketBuffer; +import reborncore.common.network.INetworkPacket; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; +import reborncore.common.util.OreUtil; +import techreborn.init.ModItems; +import techreborn.lib.ModInfo; + +import java.io.IOException; + +@RebornRegistry(modID = ModInfo.MOD_ID) +public class PacketRefund implements INetworkPacket { + + @ConfigRegistry(config = "misc", category = "general", key = "manualRefund", comment = "Allow refunding items used to craft the manual") + public static boolean allowRefund = true; + + @Override + public void writeData(ExtendedPacketBuffer buffer) throws IOException { + + } + + @Override + public void readData(ExtendedPacketBuffer buffer) throws IOException { + + } + + @Override + public void processData(PacketRefund message, MessageContext context) { + if (allowRefund) { + EntityPlayerMP playerMP = context.getServerHandler().player; + for (int i = 0; i < playerMP.inventory.getSizeInventory(); i++) { + ItemStack stack = playerMP.inventory.getStackInSlot(i); + if (stack.getItem() == ModItems.MANUAL) { + playerMP.inventory.removeStackFromSlot(i); + playerMP.inventory.addItemStackToInventory(new ItemStack(Items.BOOK)); + playerMP.inventory.addItemStackToInventory(OreUtil.getStackFromName("ingotRefinedIron")); + return; + } + } + } + + } +} diff --git a/src/main/resources/assets/techreborn/lang/en_us.lang b/src/main/resources/assets/techreborn/lang/en_us.lang index 9d3a0ea7a..3835fb467 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.lang +++ b/src/main/resources/assets/techreborn/lang/en_us.lang @@ -627,8 +627,10 @@ techreborn.tooltip.alarm=Shift rightclick to change sound #ManualUI techreborn.manual.wiki=Online wiki techreborn.manual.discord=Our discord +techreborn.manual.refund=I want a refund techreborn.manual.wikibtn=Open techreborn.manual.discordbtn=Join +techreborn.manual.refundbtn=Refund #Advancements advancements.techreborn.root.desc=Now that you have acquired Tech Reborn ore, you might find a tree tap usefull. From 4aae2422fa13e1e9f2dd788b9152415dfc852a11 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 15 Feb 2019 19:12:11 +0000 Subject: [PATCH 41/86] Fix LED lights not using correct cables --- src/main/java/techreborn/init/IC2Duplicates.java | 1 + .../java/techreborn/init/recipes/CraftingTableRecipes.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 78422e973..73a6b3e72 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -61,6 +61,7 @@ public enum IC2Duplicates { CABLE_IGOLD(EnumCableType.IGOLD.getStack()), CABLE_IHV(EnumCableType.IHV.getStack()), CABLE_IIHV(EnumCableType.TIN.getStack()), + CABLE_TIN(EnumCableType.TIN.getStack()), MIXED_METAL(ItemIngots.getIngotByName("mixed_metal")), CARBON_FIBER(ItemParts.getPartByName("carbon_fiber")), CARBON_MESH(ItemParts.getPartByName("carbon_mesh")), diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index d9360f25e..dabf86273 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -197,8 +197,8 @@ public class CraftingTableRecipes extends RecipeMethods { } //Lighting - registerShaped(getStack(ModBlocks.LAMP_INCANDESCENT), "GGG", "TCT", "GGG", 'G', "paneGlass", 'T', getMaterial("copper", Type.CABLE), 'C', getMaterial("carbon_fiber", Type.PART)); - registerShaped(getStack(ModBlocks.LAMP_LED), "GGG", "TLT", "GGG", 'G', "paneGlass", 'T', getMaterial("tin", Type.CABLE), 'L', "dustGlowstone"); + registerShaped(getStack(ModBlocks.LAMP_INCANDESCENT), "GGG", "TCT", "GGG", 'G', "paneGlass", 'T', getStack(IC2Duplicates.CABLE_COPPER), 'C', getMaterial("carbon_fiber", Type.PART)); + registerShaped(getStack(ModBlocks.LAMP_LED), "GGG", "TLT", "GGG", 'G', "paneGlass", 'T', getStack(IC2Duplicates.CABLE_TIN), 'L', "dustGlowstone"); //Parts registerShaped(getMaterial("iridium_alloy", Type.INGOT), "IAI", "ADA", "IAI", 'I', "ingotIridium", 'D', "dustDiamond", 'A', "plateAdvancedAlloy"); From 0086d88e1d422bebac8b84067134b39108ef7d0d Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 17 Feb 2019 19:00:30 +0000 Subject: [PATCH 42/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6c65ccd65..84ef45bbc 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.11" +version = "2.20.12" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From e03734e66d0cb03ae23540325541f2879c6809ea Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 20 Feb 2019 19:39:23 +0000 Subject: [PATCH 43/86] Fix #1669 --- .../tiles/tier0/TileIronAlloyFurnace.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java index 7c2aaec85..226423b0f 100644 --- a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java @@ -24,6 +24,7 @@ package techreborn.tiles.tier0; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.*; import net.minecraft.tileentity.TileEntityFurnace; @@ -31,6 +32,7 @@ import reborncore.api.IToolDrop; import reborncore.api.recipe.IBaseRecipeType; import reborncore.api.recipe.RecipeHandler; import reborncore.api.tile.IInventoryProvider; +import reborncore.common.blocks.BlockMachineBase; import reborncore.common.recipes.RecipeTranslator; import reborncore.common.registration.RebornRegistry; import reborncore.common.tile.TileLegacyMachineBase; @@ -220,14 +222,19 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase } } if (isBurning() && canSmelt()) { + if(!isActive()){ + setActive(true); + } ++cookTime; if (cookTime == 200) { cookTime = 0; smeltItem(); updateInventory = true; + setActive(false); } } else { cookTime = 0; + setActive(false); } } if (burning != isBurning()) { @@ -237,7 +244,14 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase markDirty(); } } - + + public void setActive(boolean active) { + Block block = world.getBlockState(pos).getBlock(); + if (block instanceof BlockMachineBase) { + world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, active)); + } + } + @Override public boolean canBeUpgraded() { return false; From 5397b26cf26732d8d77683e6b1a3cf476de436ad Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 25 Feb 2019 17:25:06 +0000 Subject: [PATCH 44/86] Machine cases drop them selves to fix https://github.com/FTBTeam/FTB-Ultimate-Reloaded/issues/90 --- .../techreborn/blocks/BlockMachineCasing.java | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/main/java/techreborn/blocks/BlockMachineCasing.java b/src/main/java/techreborn/blocks/BlockMachineCasing.java index 5b9a136f2..34554a8dc 100644 --- a/src/main/java/techreborn/blocks/BlockMachineCasing.java +++ b/src/main/java/techreborn/blocks/BlockMachineCasing.java @@ -107,25 +107,7 @@ public class BlockMachineCasing extends BlockMultiblockBase { } return 0; } - - @Override - public void getDrops(NonNullList drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - if (RebornCoreConfig.wrenchRequired){ - if (state.getValue(TYPE) == "reinforced") { - drops.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1)); - } - else if (state.getValue(TYPE) == "advanced") { - drops.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 2)); - } - else { - drops.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0)); - } - } - else { - super.getDrops(drops, world, pos, state, fortune); - } - } - + @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { From c1343cdc2665cc871ccf31f003f23d0851fd17da Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 25 Feb 2019 17:28:15 +0000 Subject: [PATCH 45/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 84ef45bbc..ca3bbfef9 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.12" +version = "2.20.13" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 3ca93472121322d9401020a003d87fc90106dd0d Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:06:02 +0000 Subject: [PATCH 46/86] Update Auto crafting table to use the better code from the rolling machine, should fix some issues. --- .../client/gui/GuiAutoCrafting.java | 2 +- .../tiles/tier1/TileAutoCraftingTable.java | 365 +++++++++--------- 2 files changed, 180 insertions(+), 187 deletions(-) diff --git a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java index 8d803d276..c3684e96a 100644 --- a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java +++ b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java @@ -82,7 +82,7 @@ public class GuiAutoCrafting extends GuiBase { @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); - IRecipe recipe = tileAutoCraftingTable.getIRecipe(); + IRecipe recipe = tileAutoCraftingTable.findMatchingRecipe(tileAutoCraftingTable.getCraftingInventory()); if (recipe != null) { renderItemStack(recipe.getRecipeOutput(), 95, 42); } diff --git a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java index 1fd4e9b1a..024f2a02c 100644 --- a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java +++ b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java @@ -34,7 +34,6 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; -import net.minecraft.util.SoundCategory; import org.apache.commons.lang3.tuple.Pair; import reborncore.api.IToolDrop; import reborncore.api.tile.IInventoryProvider; @@ -47,12 +46,13 @@ import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; import techreborn.init.ModBlocks; -import techreborn.init.ModSounds; import techreborn.lib.ModInfo; -import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; /** * Created by modmuss50 on 20/06/2017. @@ -66,14 +66,17 @@ public class TileAutoCraftingTable extends TilePowerAcceptor @ConfigRegistry(config = "machines", category = "autocrafter", key = "AutoCrafterMaxEnergy", comment = "AutoCrafting Table Max Energy (Value in EU)") public static int maxEnergy = 10_000; + public int[] craftingSlots = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; + private int outputSlot = 9; public Inventory inventory = new Inventory(11, "TileAutoCraftingTable", 64, this); - public int progress; + public IRecipe currentRecipe; + public ItemStack currentRecipeOutput; + public int tickTime; public int maxProgress = 120; public int euTick = 10; + public int balanceSlot = 0; InventoryCrafting inventoryCrafting = null; - IRecipe lastCustomRecipe = null; - IRecipe lastRecipe = null; public boolean locked = true; @@ -81,25 +84,6 @@ public class TileAutoCraftingTable extends TilePowerAcceptor super(); } - @Nullable - public IRecipe getIRecipe() { - InventoryCrafting crafting = getCraftingInventory(); - if (!crafting.isEmpty()) { - if (lastRecipe != null) { - if (lastRecipe.matches(crafting, world)) { - return lastRecipe; - } - } - for (IRecipe testRecipe : CraftingManager.REGISTRY) { - if (testRecipe.matches(crafting, world)) { - lastRecipe = testRecipe; - return testRecipe; - } - } - } - return null; - } - public InventoryCrafting getCraftingInventory() { if (inventoryCrafting == null) { inventoryCrafting = new InventoryCrafting(new Container() { @@ -115,48 +99,24 @@ public class TileAutoCraftingTable extends TilePowerAcceptor return inventoryCrafting; } - public boolean canMake(IRecipe recipe) { - if (recipe != null && recipe.canFit(3, 3)) { - boolean missingOutput = false; - int[] stacksInSlots = new int[9]; - for (int i = 0; i < 9; i++) { - stacksInSlots[i] = inventory.getStackInSlot(i).getCount(); - } - for (Ingredient ingredient : recipe.getIngredients()) { - if (ingredient != Ingredient.EMPTY) { - boolean foundIngredient = false; - for (int i = 0; i < 9; i++) { - ItemStack stack = inventory.getStackInSlot(i); - int requiredSize = locked ? 1 : 0; - if (stack.getMaxStackSize() == 1) { - requiredSize = 0; - } - if (stacksInSlots[i] > requiredSize) { - if (ingredient.apply(stack)) { - if (stack.getItem().getContainerItem() != null) { - if (!hasRoomForExtraItem(stack.getItem().getContainerItem(stack))) { - continue; - } - } - foundIngredient = true; - stacksInSlots[i]--; - break; - } - } - } - if (!foundIngredient) { - missingOutput = true; - } - } - } - if (!missingOutput) { - if (hasOutputSpace(recipe.getRecipeOutput(), 9)) { - return true; + public boolean canMake(InventoryCrafting craftMatrix) { + ItemStack stack = findMatchingRecipeOutput(craftMatrix); + if (locked) { + for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { + ItemStack stack1 = craftMatrix.getStackInSlot(i); + if (!stack1.isEmpty() && stack1.getCount() < 2) { + return false; } } + } + if (stack.isEmpty()) { return false; } - return false; + ItemStack output = getStackInSlot(outputSlot); + if (output.isEmpty()) { + return true; + } + return ItemUtils.isItemEqual(stack, output, true, true); } boolean hasRoomForExtraItem(ItemStack stack) { @@ -180,41 +140,6 @@ public class TileAutoCraftingTable extends TilePowerAcceptor return false; } - public boolean make(IRecipe recipe) { - if (recipe == null || !canMake(recipe)) { - return false; - } - for (int i = 0; i < recipe.getIngredients().size(); i++) { - Ingredient ingredient = recipe.getIngredients().get(i); - // Looks for the best slot to take it from - ItemStack bestSlot = inventory.getStackInSlot(i); - if (ingredient.apply(bestSlot)) { - handleContainerItem(bestSlot); - bestSlot.shrink(1); - } else { - for (int j = 0; j < 9; j++) { - ItemStack stack = inventory.getStackInSlot(j); - if (ingredient.apply(stack)) { - handleContainerItem(stack); - stack.shrink(1); // TODO is this right? or do I need - // to use it as an actull - // crafting grid - break; - } - } - } - } - ItemStack output = inventory.getStackInSlot(9); - // TODO fire forge recipe event - ItemStack ouputStack = recipe.getCraftingResult(getCraftingInventory()); - if (output.isEmpty()) { - inventory.setInventorySlotContents(9, ouputStack.copy()); - } else { - // TODO use ouputStack in someway? - output.grow(recipe.getRecipeOutput().getCount()); - } - return true; - } private void handleContainerItem(ItemStack stack) { if (stack.getItem().hasContainerItem(stack)) { @@ -241,61 +166,113 @@ public class TileAutoCraftingTable extends TilePowerAcceptor return false; } - public boolean isItemValidForRecipeSlot(IRecipe recipe, ItemStack stack, int slotID) { - if (recipe == null) { - return true; + public Optional balanceRecipe(InventoryCrafting craftCache) { + if (currentRecipe == null) { + return Optional.empty(); } - int bestSlot = findBestSlotForStack(recipe, stack); - if (bestSlot != -1) { - return bestSlot == slotID; + if (world.isRemote) { + return Optional.empty(); } - return true; - } - - public int findBestSlotForStack(IRecipe recipe, ItemStack stack) { - if (recipe == null) { - return -1; + if (!locked) { + return Optional.empty(); + } + if (craftCache.isEmpty()) { + return Optional.empty(); + } + balanceSlot++; + if (balanceSlot > craftCache.getSizeInventory()) { + balanceSlot = 0; + } + //Find the best slot for each item in a recipe, and move it if needed + ItemStack sourceStack = inventory.getStackInSlot(balanceSlot); + if (sourceStack.isEmpty()) { + return Optional.empty(); } List possibleSlots = new ArrayList<>(); - for (int i = 0; i < recipe.getIngredients().size(); i++) { - ItemStack stackInSlot = inventory.getStackInSlot(i); - Ingredient ingredient = recipe.getIngredients().get(i); - if (ingredient != Ingredient.EMPTY && ingredient.apply(stack)) { + for (int s = 0; s < currentRecipe.getIngredients().size(); s++) { + ItemStack stackInSlot = inventory.getStackInSlot(s); + Ingredient ingredient = currentRecipe.getIngredients().get(s); + if (ingredient != Ingredient.EMPTY && ingredient.apply(sourceStack)) { if (stackInSlot.isEmpty()) { - possibleSlots.add(i); - } else if (stackInSlot.getItem() == stack.getItem() - && stackInSlot.getItemDamage() == stack.getItemDamage()) { - if (stackInSlot.getMaxStackSize() >= stackInSlot.getCount() + stack.getCount()) { - possibleSlots.add(i); - } + possibleSlots.add(s); + } else if (stackInSlot.getItem() == sourceStack.getItem() && stackInSlot.getItemDamage() == sourceStack.getItemDamage()) { + possibleSlots.add(s); } } } - // Slot, count - Pair smallestCount = null; + + if(!possibleSlots.isEmpty()){ + int totalItems = possibleSlots.stream() + .mapToInt(value -> inventory.getStackInSlot(value).getCount()).sum(); + int slots = possibleSlots.size(); + + //This makes an array of ints with the best possible slot distribution + int[] split = new int[slots]; + int remainder = totalItems % slots; + Arrays.fill(split, totalItems / slots); + while (remainder > 0){ + for (int i = 0; i < split.length; i++) { + if(remainder > 0){ + split[i] +=1; + remainder --; + } + } + } + + List slotDistrubution = possibleSlots.stream() + .mapToInt(value -> inventory.getStackInSlot(value).getCount()) + .boxed().collect(Collectors.toList()); + + boolean needsBalance = false; + for (int i = 0; i < split.length; i++) { + int required = split[i]; + if(slotDistrubution.contains(required)){ + //We need to remove the int, not at the int, this seems to work around that + slotDistrubution.remove(new Integer(required)); + } else { + needsBalance = true; + } + } + if (!needsBalance) { + return Optional.empty(); + } + } else { + return Optional.empty(); + } + + //Slot, count + Pair bestSlot = null; for (Integer slot : possibleSlots) { ItemStack slotStack = inventory.getStackInSlot(slot); if (slotStack.isEmpty()) { - return slot; + bestSlot = Pair.of(slot, 0); } - if (smallestCount == null) { - smallestCount = Pair.of(slot, slotStack.getCount()); - } else if (smallestCount.getRight() >= slotStack.getCount()) { - smallestCount = Pair.of(slot, slotStack.getCount()); + if (bestSlot == null) { + bestSlot = Pair.of(slot, slotStack.getCount()); + } else if (bestSlot.getRight() >= slotStack.getCount()) { + bestSlot = Pair.of(slot, slotStack.getCount()); } } - if (smallestCount != null) { - return smallestCount.getLeft(); + if (bestSlot == null + || bestSlot.getLeft() == balanceSlot + || bestSlot.getRight() == sourceStack.getCount() + || inventory.getStackInSlot(bestSlot.getLeft()).isEmpty() + || !ItemUtils.isItemEqual(sourceStack, inventory.getStackInSlot(bestSlot.getLeft()), true, true, true)) { + return Optional.empty(); } - return -1; + sourceStack.shrink(1); + inventory.getStackInSlot(bestSlot.getLeft()).grow(1); + inventory.hasChanged = true; + + return Optional.of(getCraftingInventory()); } public int getProgress() { - return progress; + return tickTime; } public void setProgress(int progress) { - this.progress = progress; + this.tickTime = progress; } public int getMaxProgress() { @@ -309,6 +286,19 @@ public class TileAutoCraftingTable extends TilePowerAcceptor this.maxProgress = maxProgress; } + public IRecipe findMatchingRecipe(InventoryCrafting crafting){ + for (IRecipe testRecipe : CraftingManager.REGISTRY) { + if (testRecipe.matches(crafting, world)) { + return testRecipe; + } + } + return null; + } + + public ItemStack findMatchingRecipeOutput(InventoryCrafting crafting){ + return findMatchingRecipe(crafting).getRecipeOutput(); + } + // TilePowerAcceptor @Override public void update() { @@ -316,29 +306,64 @@ public class TileAutoCraftingTable extends TilePowerAcceptor if (world.isRemote) { return; } - IRecipe recipe = getIRecipe(); - if (recipe != null) { - if (progress >= maxProgress) { - if (make(recipe)) { - progress = 0; - } - } else { - if (canMake(recipe)) { - if (canUseEnergy(euTick)) { - progress++; - if (progress == 1) { - world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.AUTO_CRAFTING, - SoundCategory.BLOCKS, 0.3F, 0.8F); - } - useEnergy(euTick); - } - } else { - progress = 0; + charge(10); + + InventoryCrafting craftMatrix = getCraftingInventory(); + currentRecipe = findMatchingRecipe(craftMatrix); + if (currentRecipe != null) { + if (world.getTotalWorldTime() % 2 == 0) { + Optional balanceResult = balanceRecipe(craftMatrix); + if (balanceResult.isPresent()) { + craftMatrix = balanceResult.get(); } } + currentRecipeOutput = currentRecipe.getCraftingResult(craftMatrix); + } else { + currentRecipeOutput = ItemStack.EMPTY; } - if (recipe == null) { - progress = 0; + + if (!currentRecipeOutput.isEmpty() && canMake(craftMatrix)) { + if (tickTime >= Math.max((int) (maxProgress * (1.0 - getSpeedMultiplier())), 1)) { + currentRecipeOutput = findMatchingRecipeOutput(craftMatrix); + if (!currentRecipeOutput.isEmpty()) { + boolean hasCrafted = false; + if (inventory.getStackInSlot(outputSlot).isEmpty()) { + inventory.setInventorySlotContents(outputSlot, currentRecipeOutput); + tickTime = 0; + hasCrafted = true; + } else { + if (inventory.getStackInSlot(outputSlot).getCount() + + currentRecipeOutput.getCount() <= currentRecipeOutput.getMaxStackSize()) { + final ItemStack stack = inventory.getStackInSlot(outputSlot); + stack.setCount(stack.getCount() + currentRecipeOutput.getCount()); + inventory.setInventorySlotContents(outputSlot, stack); + tickTime = 0; + hasCrafted = true; + } + } + if (hasCrafted) { + for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { + inventory.decrStackSize(i, 1); + } + currentRecipeOutput = ItemStack.EMPTY; + currentRecipe = null; + } + } + } + } else { + tickTime = 0; + } + if (!currentRecipeOutput.isEmpty()) { + if (canUseEnergy(getEuPerTick(euTick)) + && tickTime < Math.max((int) (maxProgress * (1.0 - getSpeedMultiplier())), 1) + && canMake(craftMatrix)) { + useEnergy(getEuPerTick(euTick)); + tickTime++; + } + } + if (currentRecipeOutput.isEmpty()) { + tickTime = 0; + currentRecipe = null; } } @@ -393,42 +418,9 @@ public class TileAutoCraftingTable extends TilePowerAcceptor // TileLegacyMachineBase @Override public boolean canBeUpgraded() { - return false; - } - - @Override - public boolean isItemValidForSlot(int index, ItemStack stack) { - int bestSlot = findBestSlotForStack(getIRecipe(), stack); - if (bestSlot != -1) { - return index == bestSlot; - } - return super.isItemValidForSlot(index, stack); - } - - @Override - public int[] getSlotsForFace(EnumFacing side) { - return new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; - } - - @Override - public boolean canInsertItem(int index, ItemStack stack, EnumFacing direction) { - if (index > 8) { - return false; - } - int bestSlot = findBestSlotForStack(getIRecipe(), stack); - if (bestSlot != -1) { - return index == bestSlot; - } return true; } - @Override - public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) { - if (index > 8) { - return true; - } - return false; - } // This machine doesnt have a facing @Override @@ -454,6 +446,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor return new ContainerBuilder("autocraftingtable").player(player.inventory).inventory().hotbar().addInventory() .tile(this).slot(0, 28, 25).slot(1, 46, 25).slot(2, 64, 25).slot(3, 28, 43).slot(4, 46, 43) .slot(5, 64, 43).slot(6, 28, 61).slot(7, 46, 61).slot(8, 64, 61).outputSlot(9, 145, 42) + .onCraft(inv -> this.inventory.setInventorySlotContents(1, findMatchingRecipeOutput(getCraftingInventory()))) .outputSlot(10, 145, 70).syncEnergyValue().syncIntegerValue(this::getProgress, this::setProgress) .syncIntegerValue(this::getMaxProgress, this::setMaxProgress) .syncIntegerValue(this::getLockedInt, this::setLockedInt).addInventory().create(this); @@ -461,6 +454,6 @@ public class TileAutoCraftingTable extends TilePowerAcceptor @Override public boolean hasSlotConfig() { - return false; + return true; } } From e7715937cf22f2b77e4aefaebef4c90bfde23d83 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:28:50 +0000 Subject: [PATCH 47/86] Increase the AESU max power to 16192 --- src/main/java/techreborn/tiles/storage/TileAdjustableSU.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java index b8fb14955..f7a7796a9 100644 --- a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java +++ b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java @@ -41,9 +41,9 @@ import techreborn.lib.ModInfo; public class TileAdjustableSU extends TileEnergyStorage implements IContainerProvider { @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxInput", comment = "AESU Max Input (Value in EU)") - public static int maxInput = 8192; + public static int maxInput = 16192; @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxOutput", comment = "AESU Max Output (Value in EU)") - public static int maxOutput = 8192; + public static int maxOutput = 16192; @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxEnergy", comment = "AESU Max Energy (Value in EU)") public static int maxEnergy = 100_000_000; From 8b2c098b273cc4a8ecc25cb053c75a68682714d7 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:29:22 +0000 Subject: [PATCH 48/86] Add some bad code to stop the creative solar panel from exploding when FE is disabled. --- .../generator/TileCreativeSolarPanel.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java index cec09cef8..d2f5970fc 100644 --- a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java @@ -26,9 +26,11 @@ package techreborn.tiles.generator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import reborncore.api.IToolDrop; import reborncore.api.power.EnumPowerTier; +import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.init.ModBlocks; @@ -46,7 +48,24 @@ public class TileCreativeSolarPanel extends TilePowerAcceptor implements IToolDr @Override public void update() { - super.update(); + //If FE power is disabled we handle the power this way. + if(!PowerSystem.EnergySystem.FE.enabled.get()){ + boolean added = false; + for (EnumFacing facing : EnumFacing.VALUES){ + TileEntity tileEntity = world.getTileEntity(getPos().offset(facing)); + if(tileEntity instanceof TilePowerAcceptor){ + ((TilePowerAcceptor) tileEntity).addEnergy(100000); + added = true; + } + } + if(!added){ + //If nothing happened then go back to to ic2 power + super.update(); + } + } else { + super.update(); + } + setEnergy(getMaxPower()); } From b62b8cc248efa523ab1ac97654fbecd73a7b2d13 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:34:16 +0000 Subject: [PATCH 49/86] Fix #1678 --- .../techreborn/items/tools/ItemAdvancedDrill.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java index 504fb5a62..e1385386d 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java @@ -101,13 +101,14 @@ public class ItemAdvancedDrill extends ItemDrill { IBlockState blockState = world.getBlockState(pos); ForgePowerItemManager capEnergy = new ForgePowerItemManager(drill); + if(capEnergy.getEnergyStored() > cost){ + capEnergy.extractEnergy(cost, false); + ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn); - capEnergy.extractEnergy(cost, false); - ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn); - - blockState.getBlock().harvestBlock(world, playerIn, pos, blockState, world.getTileEntity(pos), drill); - world.setBlockToAir(pos); - world.removeTileEntity(pos); + blockState.getBlock().harvestBlock(world, playerIn, pos, blockState, world.getTileEntity(pos), drill); + world.setBlockToAir(pos); + world.removeTileEntity(pos); + } } private boolean shouldBreak(EntityPlayer playerIn, World worldIn, BlockPos originalPos, BlockPos pos) { From b560a5483d7c9cf5aaefc3b64e779674616123a9 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:41:06 +0000 Subject: [PATCH 50/86] Dont allow recycling of upgrades --- src/main/java/techreborn/tiles/tier1/TileRecycler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileRecycler.java b/src/main/java/techreborn/tiles/tier1/TileRecycler.java index 3b040710a..feb70f448 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRecycler.java +++ b/src/main/java/techreborn/tiles/tier1/TileRecycler.java @@ -39,6 +39,7 @@ import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.init.ModItems; import techreborn.items.ingredients.ItemParts; import techreborn.lib.ModInfo; @@ -201,7 +202,7 @@ public class TileRecycler extends TilePowerAcceptor @Override public BuiltContainer createContainer(EntityPlayer player) { return new ContainerBuilder("recycler").player(player.inventory).inventory().hotbar().addInventory() - .tile(this).slot(0, 55, 45).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue() + .tile(this).slot(0, 55, 45, itemStack -> itemStack.getItem() != ModItems.UPGRADES).outputSlot(1, 101, 45).energySlot(2, 8, 72).syncEnergyValue() .syncIntegerValue(this::getProgress, this::setProgress).addInventory().create(this); } } From 8270f57e6f6e9d11302b16ce8344b530e85a8aae Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:48:53 +0000 Subject: [PATCH 51/86] Fix #1674 --- src/main/java/techreborn/items/tools/ItemAdvancedDrill.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java index e1385386d..11b13d392 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java @@ -105,6 +105,7 @@ public class ItemAdvancedDrill extends ItemDrill { capEnergy.extractEnergy(cost, false); ExternalPowerSystems.requestEnergyFromArmor(capEnergy, playerIn); + blockState.getBlock().removedByPlayer(blockState, world, pos, playerIn, true); blockState.getBlock().harvestBlock(world, playerIn, pos, blockState, world.getTileEntity(pos), drill); world.setBlockToAir(pos); world.removeTileEntity(pos); From 76c81c9e9044a823850c8db53254d342cada0ce5 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 14:53:50 +0000 Subject: [PATCH 52/86] Fix #1679 --- src/main/java/techreborn/items/tools/ItemChainsaw.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/techreborn/items/tools/ItemChainsaw.java b/src/main/java/techreborn/items/tools/ItemChainsaw.java index 445f9e394..602844879 100644 --- a/src/main/java/techreborn/items/tools/ItemChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemChainsaw.java @@ -168,4 +168,8 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo { return transferLimit; } + @Override + public int getItemEnchantability() { + return 20; + } } From 99d43504284d001c740b02b3d51a05847a3e86ae Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 15:11:19 +0000 Subject: [PATCH 53/86] Much better wood searching, should now handle large and complex trees well, closes #1680 --- .../items/tools/ItemAdvancedChainsaw.java | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java b/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java index 554525aaf..f521d7e34 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java @@ -30,6 +30,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -40,8 +41,14 @@ import reborncore.common.powerSystem.forge.ForgePowerItemManager; import techreborn.config.ConfigTechReborn; import techreborn.init.ModItems; +import java.util.ArrayList; +import java.util.List; + public class ItemAdvancedChainsaw extends ItemChainsaw { + //Done to search for blocks in this order + private static final EnumFacing[] SEARCH_ORDER = new EnumFacing[]{EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.WEST, EnumFacing.UP}; + public ItemAdvancedChainsaw() { super(ToolMaterial.DIAMOND, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, 1.0F); @@ -66,16 +73,37 @@ public class ItemAdvancedChainsaw extends ItemChainsaw { @Override public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) { - for (int i = 1; i < 10; i++) { - BlockPos nextPos = pos.up(i); - IBlockState nextState = worldIn.getBlockState(nextPos); - if(nextState.getBlock().isWood(worldIn, nextPos)){ - breakBlock(nextPos, stack, worldIn, entityLiving, pos); - } - } + List wood = new ArrayList<>(); + findWood(worldIn, pos, wood, new ArrayList<>()); + wood.forEach(pos1 -> breakBlock(pos1, stack, worldIn, entityLiving, pos)); return super.onBlockDestroyed(stack, worldIn, blockIn, pos, entityLiving); } + private void findWood(World world, BlockPos pos, List wood, List leaves){ + //Limit the amount of wood to be broken to 64 blocks. + if(wood.size() >= 64){ + return; + } + //Search 150 leaves for wood + if(leaves.size() >= 150){ + return; + } + for(EnumFacing facing : SEARCH_ORDER){ + BlockPos checkPos = pos.offset(facing); + if(!wood.contains(checkPos) && !leaves.contains(checkPos)){ + IBlockState state = world.getBlockState(checkPos); + if( state.getBlock().isWood(world, checkPos)){ + wood.add(checkPos); + findWood(world, checkPos, wood, leaves); + } else if(state.getBlock().isLeaves(state, world, checkPos)){ + leaves.add(checkPos); + findWood(world, checkPos, wood, leaves); + } + } + + } + } + @Override public boolean canHarvestBlock(IBlockState blockIn) { return Items.DIAMOND_AXE.canHarvestBlock(blockIn); From 73465f4b38ccb334bcb326537bfb2cd2a507f1ea Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 15:18:44 +0000 Subject: [PATCH 54/86] Add toggle for drill AOE effect, shift click to enable/disable. Fixes #1670 --- .../items/tools/ItemAdvancedDrill.java | 78 ++++++++++++++++++- 1 file changed, 74 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java index 11b13d392..555485a15 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java @@ -26,26 +26,35 @@ package techreborn.items.tools; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.NonNullList; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.forge.ForgePowerItemManager; +import reborncore.common.util.ChatUtils; +import reborncore.common.util.ItemUtils; import techreborn.config.ConfigTechReborn; import techreborn.init.ModItems; +import techreborn.lib.MessageIDs; import javax.annotation.Nullable; import java.util.Collections; import java.util.HashSet; +import java.util.List; import java.util.Set; public class ItemAdvancedDrill extends ItemDrill { @@ -142,12 +151,73 @@ public class ItemAdvancedDrill extends ItemDrill { if ((entityLiving instanceof EntityPlayer)) { playerIn = (EntityPlayer) entityLiving; } - for (BlockPos additionalPos : getTargetBlocks(worldIn, pos, playerIn)) { - breakBlock(additionalPos, worldIn, playerIn, stack); + if(ItemUtils.isActive(stack)){ + for (BlockPos additionalPos : getTargetBlocks(worldIn, pos, playerIn)) { + breakBlock(additionalPos, worldIn, playerIn, stack); + } } return super.onBlockDestroyed(stack, worldIn, blockIn, pos, entityLiving); } + @Override + public ActionResult onItemRightClick(final World world, final EntityPlayer player, final EnumHand hand) { + final ItemStack stack = player.getHeldItem(hand); + if (player.isSneaking()) { + if (new ForgePowerItemManager(stack).getEnergyStored() < cost) { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyErrorTo") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberActivate"))); + } else { + if (!ItemUtils.isActive(stack)) { + if (stack.getTagCompound() == null) { + stack.setTagCompound(new NBTTagCompound()); + } + stack.getTagCompound().setBoolean("isActive", true); + if (world.isRemote) { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberActive"))); + } + } else { + stack.getTagCompound().setBoolean("isActive", false); + if (world.isRemote) { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberInactive"))); + } + } + } + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } + return new ActionResult<>(EnumActionResult.PASS, stack); + } + + @Override + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { + if (ItemUtils.isActive(stack) && new ForgePowerItemManager(stack).getEnergyStored() < cost) { + if(worldIn.isRemote){ + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyError") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberDeactivating"))); + } + stack.getTagCompound().setBoolean("isActive", false); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { + if (!ItemUtils.isActive(stack)) { + tooltip.add(TextFormatting.RED + I18n.format("techreborn.message.nanosaberInactive")); + } else { + tooltip.add(TextFormatting.GREEN + I18n.format("techreborn.message.nanosaberActive")); + } + } + // ItemPickaxe @Override public boolean canHarvestBlock(IBlockState blockIn) { From 46b1e920e9c2f7836d7d4603880fa9dce5db7bb2 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 15:32:55 +0000 Subject: [PATCH 55/86] Add shear mode to chainsaw, closes #1668 --- .../items/tools/ItemAdvancedChainsaw.java | 87 ++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java b/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java index f521d7e34..610fa95fe 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java @@ -25,22 +25,33 @@ package techreborn.items.tools; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.NonNullList; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.forge.ForgePowerItemManager; +import reborncore.common.util.ChatUtils; +import reborncore.common.util.ItemUtils; import techreborn.config.ConfigTechReborn; import techreborn.init.ModItems; +import techreborn.lib.MessageIDs; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; @@ -73,6 +84,18 @@ public class ItemAdvancedChainsaw extends ItemChainsaw { @Override public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) { + + if(ItemUtils.isActive(stack) && !worldIn.isRemote){ + IBlockState state = worldIn.getBlockState(pos); + if(state.getBlock() instanceof IShearable){ + if(((IShearable) state.getBlock()).isShearable(stack, worldIn, pos)){ + List results = ((IShearable) state.getBlock()).onSheared(stack, worldIn, pos, 0); + results.forEach(itemStack -> InventoryHelper.spawnItemStack(worldIn, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), itemStack)); + return super.onBlockDestroyed(stack, worldIn, blockIn, pos, entityLiving); + } + } + } + List wood = new ArrayList<>(); findWood(worldIn, pos, wood, new ArrayList<>()); wood.forEach(pos1 -> breakBlock(pos1, stack, worldIn, entityLiving, pos)); @@ -104,6 +127,66 @@ public class ItemAdvancedChainsaw extends ItemChainsaw { } } + @Override + public ActionResult onItemRightClick(final World world, final EntityPlayer player, final EnumHand hand) { + final ItemStack stack = player.getHeldItem(hand); + if (player.isSneaking()) { + if (new ForgePowerItemManager(stack).getEnergyStored() < cost) { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyErrorTo") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberActivate"))); + } else { + if (!ItemUtils.isActive(stack)) { + if (stack.getTagCompound() == null) { + stack.setTagCompound(new NBTTagCompound()); + } + stack.getTagCompound().setBoolean("isActive", true); + if (world.isRemote) { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberActive"))); + } + } else { + stack.getTagCompound().setBoolean("isActive", false); + if (world.isRemote) { + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberInactive"))); + } + } + } + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } + return new ActionResult<>(EnumActionResult.PASS, stack); + } + + @Override + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { + if (ItemUtils.isActive(stack) && new ForgePowerItemManager(stack).getEnergyStored() < cost) { + if(worldIn.isRemote){ + ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( + TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyError") + " " + + TextFormatting.GOLD + I18n + .format("techreborn.message.nanosaberDeactivating"))); + } + stack.getTagCompound().setBoolean("isActive", false); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, @Nullable + World worldIn, List tooltip, ITooltipFlag flagIn) { + if (!ItemUtils.isActive(stack)) { + tooltip.add(TextFormatting.YELLOW + "Shear: " + TextFormatting.RED + I18n.format("techreborn.message.nanosaberInactive")); + } else { + tooltip.add(TextFormatting.YELLOW + "Shear: " + TextFormatting.GREEN + I18n.format("techreborn.message.nanosaberActive")); + } + } + @Override public boolean canHarvestBlock(IBlockState blockIn) { return Items.DIAMOND_AXE.canHarvestBlock(blockIn); From 932848e9334f20016128cd35b7df7abb07e43b88 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 6 Mar 2019 15:43:56 +0000 Subject: [PATCH 56/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ca3bbfef9..885b0397c 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.20.13" +version = "2.21.0" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From ac173a5a75fb242ae3bfe4f90c1adb0a3ca3457b Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 8 Mar 2019 13:34:55 +0000 Subject: [PATCH 57/86] Add scrap box to matter fab, fixes https://github.com/TechReborn/TechReborn/issues/1682 --- src/main/java/techreborn/init/IC2Duplicates.java | 1 + src/main/java/techreborn/tiles/TileMatterFabricator.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 73a6b3e72..755ae1b91 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -69,6 +69,7 @@ public enum IC2Duplicates { THICK_NEUTRON_REFLECTOR(ItemParts.getPartByName("thick_neutron_reflector")), IRIDIUM_NEUTRON_REFLECTOR(ItemParts.getPartByName("iridium_neutron_reflector")), SCRAP(ItemParts.getPartByName("scrap")), + SCRAP_BOX(new ItemStack(ModItems.SCRAP_BOX)), FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER)), //Classical dedupes diff --git a/src/main/java/techreborn/tiles/TileMatterFabricator.java b/src/main/java/techreborn/tiles/TileMatterFabricator.java index 957b807e2..bdcc3fce8 100644 --- a/src/main/java/techreborn/tiles/TileMatterFabricator.java +++ b/src/main/java/techreborn/tiles/TileMatterFabricator.java @@ -1,4 +1,4 @@ -/* + /* * This file is part of TechReborn, licensed under the MIT License (MIT). * * Copyright (c) 2018 TechReborn @@ -122,6 +122,11 @@ public class TileMatterFabricator extends TilePowerAcceptor return 200; } } + if (IC2Duplicates.SCRAP_BOX.hasIC2Stack()) { + if (ItemUtils.isInputEqual(itemStack, IC2Duplicates.SCRAP_BOX.getIc2Stack(), true, true, true)) { + return 2000; + } + } return 0; } From 9791d260b588d6b8a7a683775f52d4298e07f5f3 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 8 Mar 2019 13:42:38 +0000 Subject: [PATCH 58/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 885b0397c..7ba332c71 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.21.0" +version = "2.21.1" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 96bbe75c608cc3a55e798ed54c40969a61613914 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 11 Mar 2019 02:22:49 +0300 Subject: [PATCH 59/86] Removed unused imports --- src/main/java/techreborn/blocks/BlockMachineCasing.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/techreborn/blocks/BlockMachineCasing.java b/src/main/java/techreborn/blocks/BlockMachineCasing.java index 34554a8dc..15f2051b9 100644 --- a/src/main/java/techreborn/blocks/BlockMachineCasing.java +++ b/src/main/java/techreborn/blocks/BlockMachineCasing.java @@ -38,14 +38,12 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import prospector.shootingstar.ShootingStar; import prospector.shootingstar.model.ModelCompound; import reborncore.api.ToolManager; -import reborncore.common.RebornCoreConfig; import reborncore.common.blocks.BlockWrenchEventHandler; import reborncore.common.blocks.PropertyString; import reborncore.common.items.WrenchHelper; From 9ebec4429f5aa34756baada566635bec2aa567e1 Mon Sep 17 00:00:00 2001 From: ralphII <48348583+ralphII@users.noreply.github.com> Date: Sun, 17 Mar 2019 15:56:47 +0100 Subject: [PATCH 60/86] Fix RollingMachine tile not updating its active state (#1687) --- .../tiles/tier1/TileRollingMachine.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java index db9f007c5..01d9c4ec8 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java +++ b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java @@ -35,6 +35,7 @@ import net.minecraft.util.EnumFacing; import org.apache.commons.lang3.tuple.Pair; import reborncore.api.IToolDrop; import reborncore.api.tile.IInventoryProvider; +import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.impl.ConfigRegistry; @@ -119,6 +120,7 @@ public class TileRollingMachine extends TilePowerAcceptor InventoryCrafting craftMatrix = getCraftingMatrix(); currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, world); if (currentRecipe != null) { + setIsActive(true); if (world.getTotalWorldTime() % 2 == 0) { Optional balanceResult = balanceRecipe(craftMatrix); if (balanceResult.isPresent()) { @@ -147,6 +149,8 @@ public class TileRollingMachine extends TilePowerAcceptor inventory.setInventorySlotContents(outputSlot, stack); tickTime = 0; hasCrafted = true; + } else { + setIsActive(false); } } if (hasCrafted) { @@ -167,13 +171,27 @@ public class TileRollingMachine extends TilePowerAcceptor && canMake(craftMatrix)) { useEnergy(getEuPerTick(energyPerTick)); tickTime++; + } else { + setIsActive(false); } } if (currentRecipeOutput.isEmpty()) { tickTime = 0; currentRecipe = null; + setIsActive(canMake(getCraftingMatrix())); } + } + public void setIsActive(boolean active) { + if (active == isRunning){ + return; + } + isRunning = active; + if (this.getWorld().getBlockState(this.getPos()).getBlock() instanceof BlockMachineBase) { + BlockMachineBase blockMachineBase = (BlockMachineBase)this.getWorld().getBlockState(this.getPos()).getBlock(); + blockMachineBase.setActive(active, this.getWorld(), this.getPos()); + } + this.getWorld().notifyBlockUpdate(this.getPos(), this.getWorld().getBlockState(this.getPos()), this.getWorld().getBlockState(this.getPos()), 3); } public Optional balanceRecipe(InventoryCrafting craftCache) { From 79586e0a62caaeb7fc1766af9da3e3eb1ea062fc Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 17 Mar 2019 15:07:14 +0000 Subject: [PATCH 61/86] Fix #1688 --- src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java b/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java index 840b95942..e81f858ab 100644 --- a/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java +++ b/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java @@ -165,7 +165,6 @@ public class TileElectricFurnace extends TilePowerAcceptor } } } else { - progress = 0; updateState(); } if (burning != isBurning()) { From d7f0e0403400932d94fbc89740db84d4447142ca Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 17 Mar 2019 16:10:20 +0000 Subject: [PATCH 62/86] Hold shift to go faster in the AESU gui, closes #1686 --- src/main/java/techreborn/client/gui/GuiAESU.java | 4 +++- src/main/java/techreborn/packets/PacketAesu.java | 10 +++++++--- .../techreborn/tiles/storage/TileAdjustableSU.java | 10 +++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index cafc7c395..806ffa7f1 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -27,6 +27,7 @@ package techreborn.client.gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.input.Keyboard; import reborncore.client.gui.builder.GuiBase; import reborncore.common.network.NetworkManager; import reborncore.common.powerSystem.PowerSystem; @@ -83,7 +84,8 @@ public class GuiAESU extends GuiBase { public void actionPerformed(final GuiButton button) throws IOException { super.actionPerformed(button); if (button.id >= 300 && button.id <= 303) { - NetworkManager.sendToServer(new PacketAesu(button.id, tile)); + boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); + NetworkManager.sendToServer(new PacketAesu(button.id, tile, shift)); } } } diff --git a/src/main/java/techreborn/packets/PacketAesu.java b/src/main/java/techreborn/packets/PacketAesu.java index 0d17818bf..180fcf530 100644 --- a/src/main/java/techreborn/packets/PacketAesu.java +++ b/src/main/java/techreborn/packets/PacketAesu.java @@ -37,32 +37,36 @@ public class PacketAesu implements INetworkPacket { int buttonID; BlockPos pos; + boolean shift; public PacketAesu() { } - public PacketAesu(int buttonID, TileAdjustableSU tile) { - this.pos = tile.getPos(); + public PacketAesu(int buttonID, TileAdjustableSU tile, boolean shift) { this.buttonID = buttonID; + this.pos = tile.getPos(); + this.shift = shift; } @Override public void writeData(ExtendedPacketBuffer out) throws IOException { out.writeBlockPos(pos); out.writeInt(buttonID); + out.writeBoolean(shift); } @Override public void readData(ExtendedPacketBuffer in) throws IOException { this.pos = in.readBlockPos(); this.buttonID = in.readInt(); + this.shift = in.readBoolean(); } @Override public void processData(PacketAesu message, MessageContext context) { TileEntity tile = context.getServerHandler().player.world.getTileEntity(message.pos); if (tile instanceof TileAdjustableSU){ - ((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID); + ((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID, shift); } } } diff --git a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java index f7a7796a9..e42db0881 100644 --- a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java +++ b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java @@ -54,18 +54,18 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro super("ADJUSTABLE_SU", 4, ModBlocks.ADJUSTABLE_SU, EnumPowerTier.INSANE, maxInput, maxOutput, maxEnergy); } - public void handleGuiInputFromClient(int id) { + public void handleGuiInputFromClient(int id, boolean shift) { if (id == 300) { - OUTPUT += 256; + OUTPUT += shift ? 4096 : 256; } if (id == 301) { - OUTPUT += 64; + OUTPUT += shift ? 512 : 64; } if (id == 302) { - OUTPUT -= 64; + OUTPUT -= shift ? 512 : 64; } if (id == 303) { - OUTPUT -= 256; + OUTPUT -= shift ? 4096 : 256; } if (OUTPUT > maxOutput) { OUTPUT = maxOutput; From 425f8921fc30c15800251ee5fe8d22a1d6e09b33 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 17 Mar 2019 17:08:39 +0000 Subject: [PATCH 63/86] Improve auto crafting table performance with large amount of recipes. --- .../tiles/tier1/TileAutoCraftingTable.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java index 024f2a02c..981f59bb6 100644 --- a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java +++ b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java @@ -287,6 +287,14 @@ public class TileAutoCraftingTable extends TilePowerAcceptor } public IRecipe findMatchingRecipe(InventoryCrafting crafting){ + if(crafting.isEmpty()){ + return null; + } + if(currentRecipe != null){ + if(currentRecipe.matches(crafting, world)){ + return currentRecipe; + } + } for (IRecipe testRecipe : CraftingManager.REGISTRY) { if (testRecipe.matches(crafting, world)) { return testRecipe; @@ -309,7 +317,19 @@ public class TileAutoCraftingTable extends TilePowerAcceptor charge(10); InventoryCrafting craftMatrix = getCraftingInventory(); - currentRecipe = findMatchingRecipe(craftMatrix); + //Only search the recipe tree when the inv changes + if(inventory.hasChanged){ + currentRecipe = findMatchingRecipe(craftMatrix); + } + + //Checks that the current recipe is still valid, if not it will check for a valid recipe next tick. + if(currentRecipe != null){ + if(!currentRecipe.matches(craftMatrix, world)){ + currentRecipe = null; + inventory.hasChanged = true; + } + } + if (currentRecipe != null) { if (world.getTotalWorldTime() % 2 == 0) { Optional balanceResult = balanceRecipe(craftMatrix); @@ -374,6 +394,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor public void setLockedInt(int lockedInt) { locked = lockedInt == 1; + inventory.hasChanged = true; } @Override @@ -412,6 +433,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor if (tag.hasKey("locked")) { locked = tag.getBoolean("locked"); } + inventory.hasChanged = true; super.readFromNBT(tag); } From 75e9621f9e0e7e92bcca53b0496d173f4a1cb8d3 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 17 Mar 2019 17:12:10 +0000 Subject: [PATCH 64/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7ba332c71..154dbf583 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.21.1" +version = "2.21.2" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 0ca18ade97b02499d8567398ad0579226d46b1c7 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 17 Mar 2019 21:50:26 +0000 Subject: [PATCH 65/86] Fix a bug with the auto crafting table --- src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java index 981f59bb6..fc2a7918c 100644 --- a/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java +++ b/src/main/java/techreborn/tiles/tier1/TileAutoCraftingTable.java @@ -304,7 +304,7 @@ public class TileAutoCraftingTable extends TilePowerAcceptor } public ItemStack findMatchingRecipeOutput(InventoryCrafting crafting){ - return findMatchingRecipe(crafting).getRecipeOutput(); + return findMatchingRecipe(crafting).getRecipeOutput().copy(); } // TilePowerAcceptor From 1d78c60e51cc834de0d9b69a746172430f328b93 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 23 Mar 2019 18:03:41 +0000 Subject: [PATCH 66/86] Superconductor update, adds cables, and new upgrades. --- .../api/reactor/FusionReactorRecipe.java | 26 +++++++++ .../blocks/cable/EnumCableType.java | 7 ++- .../java/techreborn/client/gui/GuiAESU.java | 3 +- .../techreborn/compat/jei/RecipeUtil.java | 2 +- .../FusionReactorRecipeWrapper.java | 4 ++ .../init/recipes/CraftingTableRecipes.java | 8 +++ .../init/recipes/FusionReactorRecipes.java | 14 +++++ .../java/techreborn/items/ItemUpgrades.java | 29 +++++++++- .../items/ingredients/ItemParts.java | 22 +++++++- .../java/techreborn/packets/PacketAesu.java | 8 ++- .../TileFusionControlComputer.java | 10 +++- .../tiles/storage/TileAdjustableSU.java | 53 ++++++++++++++++-- .../techreborn/blockstates/cable_inv.json | 5 ++ .../techreborn/blockstates/cable_thick.json | 5 ++ .../blockstates/items/materials/part.json | 5 ++ .../blockstates/items/misc/upgrades.json | 5 ++ .../assets/techreborn/lang/en_us.lang | 3 + .../blocks/cables/superconductor_cable.png | Bin 552 -> 1904 bytes .../cables/superconductor_cable_old.png | Bin 0 -> 552 bytes .../textures/items/cables/superconductor.png | Bin 0 -> 1726 bytes .../textures/items/upgrade/superconductor.png | Bin 0 -> 1949 bytes 21 files changed, 197 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/assets/techreborn/textures/blocks/cables/superconductor_cable_old.png create mode 100644 src/main/resources/assets/techreborn/textures/items/cables/superconductor.png create mode 100644 src/main/resources/assets/techreborn/textures/items/upgrade/superconductor.png diff --git a/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java b/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java index fac775c0b..ecb461849 100644 --- a/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java +++ b/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java @@ -65,6 +65,11 @@ public class FusionReactorRecipe { */ int tickTime; + /** + * This is the minium reactor size that this recipe can work with + */ + int minSize; + /** * @param topInput This is the top slot stack * @param bottomInput This is the bottom slot stack @@ -75,14 +80,31 @@ public class FusionReactorRecipe { */ public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU, double euTick, int tickTime) { + this(topInput, bottomInput, output, startEU, euTick, tickTime, 0); + } + + /** + * @param topInput This is the top slot stack + * @param bottomInput This is the bottom slot stack + * @param output This is the output stack + * @param startEU This is the inital EU amount + * @param euTick This is the eu that is transfured every tick + * @param tickTime This is the time the recipe takes to process + * @param minSize This is the min size of reactor required for this recipe + */ + public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU, + double euTick, int tickTime, int minSize) { this.topInput = topInput; this.bottomInput = bottomInput; this.output = output; this.startEU = startEU; this.euTick = euTick; this.tickTime = tickTime; + this.minSize = minSize; } + + public ItemStack getTopInput() { return topInput; } @@ -106,4 +128,8 @@ public class FusionReactorRecipe { public int getTickTime() { return tickTime; } + + public int getMinSize() { + return minSize; + } } diff --git a/src/main/java/techreborn/blocks/cable/EnumCableType.java b/src/main/java/techreborn/blocks/cable/EnumCableType.java index c8000073e..d33ae7019 100644 --- a/src/main/java/techreborn/blocks/cable/EnumCableType.java +++ b/src/main/java/techreborn/blocks/cable/EnumCableType.java @@ -41,7 +41,8 @@ public enum EnumCableType implements IStringSerializable { GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, EnumPowerTier.INSANE), ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, EnumPowerTier.MEDIUM), IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, EnumPowerTier.HIGH), - IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.EXTREME); + IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.EXTREME), + SUPERCONDUCTOR("superconductor", "techreborn:blocks/cables/superconductor_cable", Integer.MAX_VALUE / 4, 10.0, false, EnumPowerTier.INFINITE); public String textureName = "minecraft:blocks/iron_block"; public int transferRate = 128; @@ -73,6 +74,10 @@ public enum EnumCableType implements IStringSerializable { return new ItemStack(ModBlocks.CABLE, 1, this.ordinal()); } + public ItemStack getStack(int amount) { + return new ItemStack(ModBlocks.CABLE, amount, this.ordinal()); + } + @SubscribeEvent public static void handleConfig(ConfigRegistryFactory.RebornRegistryEvent event){ Configuration config = event.getConfiguration(ModInfo.MOD_ID, "misc"); diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index 806ffa7f1..9455a33ba 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -85,7 +85,8 @@ public class GuiAESU extends GuiBase { super.actionPerformed(button); if (button.id >= 300 && button.id <= 303) { boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); - NetworkManager.sendToServer(new PacketAesu(button.id, tile, shift)); + boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL); + NetworkManager.sendToServer(new PacketAesu(button.id, tile, shift, ctrl)); } } } diff --git a/src/main/java/techreborn/compat/jei/RecipeUtil.java b/src/main/java/techreborn/compat/jei/RecipeUtil.java index 912129fb1..a79a2b1fa 100644 --- a/src/main/java/techreborn/compat/jei/RecipeUtil.java +++ b/src/main/java/techreborn/compat/jei/RecipeUtil.java @@ -42,7 +42,7 @@ import java.awt.*; import java.util.List; public class RecipeUtil { - private static final int color = Color.darkGray.getRGB(); + public static final int color = Color.darkGray.getRGB(); private RecipeUtil() { } diff --git a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java index 53e62267d..a2416f47d 100644 --- a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java @@ -59,5 +59,9 @@ public class FusionReactorRecipeWrapper implements IRecipeWrapper { @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { RecipeUtil.drawInfo(minecraft, 0, 34, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime()); + if(baseRecipe.getMinSize() != 0){ + minecraft.fontRenderer.drawString("Reactor Size: " + baseRecipe.getMinSize(), 0, 74, RecipeUtil.color); + } + } } diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index dabf86273..4532a3b70 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -38,6 +38,7 @@ import reborncore.common.util.StringUtils; import techreborn.Core; import techreborn.blocks.BlockStorage; import techreborn.blocks.BlockStorage2; +import techreborn.blocks.cable.EnumCableType; import techreborn.compat.CompatManager; import techreborn.config.ConfigTechReborn; import techreborn.init.IC2Duplicates; @@ -191,6 +192,13 @@ public class CraftingTableRecipes extends RecipeMethods { } + registerShaped(EnumCableType.SUPERCONDUCTOR.getStack(), "MFM", "SSS", "MFM", 'M', getMaterial("advanced_machine", Type.MACHINE_FRAME), 'S', "craftingSuperconductor", 'F', getMaterial("energy_flow_circuit", 1, Type.PART)); + registerShaped(EnumCableType.SUPERCONDUCTOR.getStack(8), "MFM", "SSS", "MFM", 'M', getMaterial("advanced_machine", Type.MACHINE_FRAME), 'S', getMaterial("enhanced_super_conductor", Type.PART), 'F', getMaterial("energy_flow_circuit", 1, Type.PART)); + + registerShaped(ItemUpgrades.getUpgradeByName("superconductor"), "SOS", "CMC", "SOS", 'C', EnumCableType.SUPERCONDUCTOR.getStack(), 'M', getMaterial("highly_advanced_machine", Type.MACHINE_FRAME) , 'O', getMaterial("data_orb", Type.PART), 'S', getMaterial("enhanced_super_conductor", Type.PART)); + + + if (!CompatManager.isQuantumStorageLoaded) { registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', getMaterial("dataOrb", Type.PART), 'C', getMaterial("computerMonitor", Type.PART), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(IC2Duplicates.COMPRESSOR)); registerShaped(getStack(ModBlocks.QUANTUM_TANK), "EPE", "PCP", "EPE", 'P', "platePlatinum", 'E', "circuitAdvanced", 'C', getStack(ModBlocks.QUANTUM_CHEST)); diff --git a/src/main/java/techreborn/init/recipes/FusionReactorRecipes.java b/src/main/java/techreborn/init/recipes/FusionReactorRecipes.java index 0df0edd49..14ff43d32 100644 --- a/src/main/java/techreborn/init/recipes/FusionReactorRecipes.java +++ b/src/main/java/techreborn/init/recipes/FusionReactorRecipes.java @@ -24,11 +24,18 @@ package techreborn.init.recipes; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.init.Items; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; import techreborn.api.reactor.FusionReactorRecipe; import techreborn.api.reactor.FusionReactorRecipeHelper; import techreborn.blocks.BlockOre; import techreborn.items.ItemCells; import techreborn.items.ingredients.ItemDusts; +import techreborn.items.ingredients.ItemParts; /** * @author drcrazy @@ -48,5 +55,12 @@ public class FusionReactorRecipes extends RecipeMethods { FusionReactorRecipeHelper.registerRecipe( new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("lithium"), BlockOre.getOreByName("iridium"), 90000000, -2048, 1024)); + + ItemStack book = new ItemStack(Items.ENCHANTED_BOOK); + ItemEnchantedBook.addEnchantment(book, new EnchantmentData(Enchantment.REGISTRY.getObject(new ResourceLocation("efficiency")), 5)); + + FusionReactorRecipeHelper.registerRecipe( + new FusionReactorRecipe(ItemParts.getPartByName("super_conductor", 4), book, + ItemParts.getPartByName("enhanced_super_conductor", 4), 100000000, -8192, 2048, 50)); } } diff --git a/src/main/java/techreborn/items/ItemUpgrades.java b/src/main/java/techreborn/items/ItemUpgrades.java index ba4050e09..37352f1ee 100644 --- a/src/main/java/techreborn/items/ItemUpgrades.java +++ b/src/main/java/techreborn/items/ItemUpgrades.java @@ -24,14 +24,18 @@ package techreborn.items; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.NonNullList; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.api.tile.IUpgrade; +import reborncore.api.tile.IUpgradeable; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.recipes.IUpgradeHandler; import reborncore.common.registration.RebornRegistry; @@ -39,10 +43,12 @@ import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.tile.TileLegacyMachineBase; import techreborn.init.ModItems; import techreborn.lib.ModInfo; +import techreborn.tiles.storage.TileAdjustableSU; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.security.InvalidParameterException; +import java.util.List; @RebornRegistry(modID = ModInfo.MOD_ID) public class ItemUpgrades extends ItemTR implements IUpgrade { @@ -56,7 +62,7 @@ public class ItemUpgrades extends ItemTR implements IUpgrade { @ConfigRegistry(config = "items", category = "upgrades", key = "energy_storage", comment = "Energy storage upgrade extra power") public static double energyStoragePower = 40_000; - public static final String[] types = new String[] { "overclock", "transformer", "energy_storage"}; + public static final String[] types = new String[] { "overclock", "transformer", "energy_storage", "superconductor"}; public ItemUpgrades() { setUnlocalizedName("techreborn.upgrade"); @@ -127,6 +133,9 @@ public class ItemUpgrades extends ItemTR implements IUpgrade { acceptor.extraTeir += 1; } } + if(machineBase instanceof TileAdjustableSU){ + + } } @Override @@ -134,4 +143,22 @@ public class ItemUpgrades extends ItemTR implements IUpgrade { public void handleRightClick(TileEntity tile, ItemStack stack, Container container, int slotID) { } + + @Override + public void addInformation(ItemStack stack, + @Nullable + World worldIn, List tooltip, ITooltipFlag flagIn) { + if(stack.getItemDamage() == 3){ + tooltip.add(TextFormatting.LIGHT_PURPLE + "Increases the max output of the AESU"); + tooltip.add(TextFormatting.GOLD + "Blame obstinate_3 for this"); + } + } + + @Override + public boolean isValidForInventory(IUpgradeable upgradeable, ItemStack stack) { + if(stack.getItemDamage() == 3){ + return upgradeable instanceof TileAdjustableSU; + } + return true; + } } diff --git a/src/main/java/techreborn/items/ingredients/ItemParts.java b/src/main/java/techreborn/items/ingredients/ItemParts.java index 7fc06b54b..773f2e166 100644 --- a/src/main/java/techreborn/items/ingredients/ItemParts.java +++ b/src/main/java/techreborn/items/ingredients/ItemParts.java @@ -27,9 +27,12 @@ package techreborn.items.ingredients; import com.google.common.base.CaseFormat; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.Core; import techreborn.client.EGui; import techreborn.utils.TechRebornCreativeTab; @@ -46,7 +49,7 @@ public class ItemParts extends ItemTR { "thorium_cell", "double_thorium_cell", "quad_thorium_cell", "plutonium_cell", "double_plutonium_cell", "quad_plutonium_cell", "computer_monitor", "machine_parts", "neutron_reflector", "iridium_neutron_reflector", "thick_neutron_reflector", "electronic_circuit", "advanced_circuit", "sap", "rubber", "scrap", - "carbon_mesh", "carbon_fiber", "coolant_simple", "coolant_triple", "coolant_six"}; + "carbon_mesh", "carbon_fiber", "coolant_simple", "coolant_triple", "coolant_six", "enhanced_super_conductor"}; public ItemParts() { this.setCreativeTab(TechRebornCreativeTab.instance); @@ -116,4 +119,21 @@ public class ItemParts extends ItemTR { } return itemStack; } + + @SideOnly(Side.CLIENT) + @Override + public boolean hasEffect(ItemStack stack) { + if(stack.getItemDamage() == getPartByName("enhanced_super_conductor").getItemDamage()){ + return true; + } + return false; + } + + @Override + public EnumRarity getRarity(ItemStack stack) { + if(stack.getItemDamage() == getPartByName("enhanced_super_conductor").getItemDamage()){ + return EnumRarity.EPIC; + } + return super.getRarity(stack); + } } diff --git a/src/main/java/techreborn/packets/PacketAesu.java b/src/main/java/techreborn/packets/PacketAesu.java index 180fcf530..6258a7ad3 100644 --- a/src/main/java/techreborn/packets/PacketAesu.java +++ b/src/main/java/techreborn/packets/PacketAesu.java @@ -38,14 +38,16 @@ public class PacketAesu implements INetworkPacket { int buttonID; BlockPos pos; boolean shift; + boolean ctrl; public PacketAesu() { } - public PacketAesu(int buttonID, TileAdjustableSU tile, boolean shift) { + public PacketAesu(int buttonID, TileAdjustableSU tile, boolean shift, boolean ctrl) { this.buttonID = buttonID; this.pos = tile.getPos(); this.shift = shift; + this.ctrl = ctrl; } @Override @@ -53,6 +55,7 @@ public class PacketAesu implements INetworkPacket { out.writeBlockPos(pos); out.writeInt(buttonID); out.writeBoolean(shift); + out.writeBoolean(ctrl); } @Override @@ -60,13 +63,14 @@ public class PacketAesu implements INetworkPacket { this.pos = in.readBlockPos(); this.buttonID = in.readInt(); this.shift = in.readBoolean(); + this.ctrl = in.readBoolean(); } @Override public void processData(PacketAesu message, MessageContext context) { TileEntity tile = context.getServerHandler().player.world.getTileEntity(message.pos); if (tile instanceof TileAdjustableSU){ - ((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID, shift); + ((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID, shift, ctrl); } } } diff --git a/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java b/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java index a9d421cdf..4b46ccfb6 100644 --- a/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java +++ b/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java @@ -74,6 +74,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor int outputStackSlot = 2; FusionReactorRecipe currentRecipe = null; boolean hasStartedCrafting = false; + long lastTick = -1; public TileFusionControlComputer() { super(); @@ -180,7 +181,8 @@ public class TileFusionControlComputer extends TilePowerAcceptor * @return boolean True if reactor can execute recipe provided */ private boolean validateReactorRecipe(FusionReactorRecipe recipe) { - return validateReactorRecipeInputs(recipe, getStackInSlot(topStackSlot), getStackInSlot(bottomStackSlot)) || validateReactorRecipeInputs(recipe, getStackInSlot(bottomStackSlot), getStackInSlot(topStackSlot)); + boolean validRecipe = validateReactorRecipeInputs(recipe, getStackInSlot(topStackSlot), getStackInSlot(bottomStackSlot)) || validateReactorRecipeInputs(recipe, getStackInSlot(bottomStackSlot), getStackInSlot(topStackSlot)); + return validRecipe && getSize() >= recipe.getMinSize(); } private boolean validateReactorRecipeInputs(FusionReactorRecipe recipe, ItemStack slot1, ItemStack slot2) { @@ -206,6 +208,12 @@ public class TileFusionControlComputer extends TilePowerAcceptor return; } + if(lastTick == world.getTotalWorldTime()){ + //Prevent tick accerators, blame obstinate for this. + return; + } + lastTick = world.getTotalWorldTime(); + // Force check every second if (world.getTotalWorldTime() % 20 == 0) { checkCoils(); diff --git a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java index e42db0881..cfb8d5fa8 100644 --- a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java +++ b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java @@ -28,6 +28,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import reborncore.api.power.EnumPowerTier; +import reborncore.api.tile.IUpgrade; import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; @@ -35,6 +36,7 @@ import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.items.ItemUpgrades; import techreborn.lib.ModInfo; @RebornRegistry(modID = ModInfo.MOD_ID) @@ -53,10 +55,40 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro public TileAdjustableSU() { super("ADJUSTABLE_SU", 4, ModBlocks.ADJUSTABLE_SU, EnumPowerTier.INSANE, maxInput, maxOutput, maxEnergy); } - - public void handleGuiInputFromClient(int id, boolean shift) { + + int superconductors = 0; + + @Override + public void update() { + super.update(); + + superconductors = 0; + for (int i = 0; i < getUpgradeSlotCount(); i++) { + ItemStack stack = getUpgradeInvetory().getStackInSlot(i); + if(stack.getItem() instanceof ItemUpgrades && stack.getItemDamage() == 3){ + superconductors++; + } + } + if (OUTPUT > getMaxConfigOutput()) { + OUTPUT = getMaxConfigOutput(); + } + } + + public int getMaxConfigOutput(){ + int extra = 0; + if(superconductors > 0){ + extra = (int) Math.pow(2, (superconductors + 2)) * maxOutput; + } + return maxOutput + extra; + } + + public void handleGuiInputFromClient(int id, boolean shift, boolean ctrl) { if (id == 300) { OUTPUT += shift ? 4096 : 256; + if(ctrl){ + //Set to max, limited to the max later + OUTPUT = Integer.MAX_VALUE; + } } if (id == 301) { OUTPUT += shift ? 512 : 64; @@ -66,9 +98,12 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro } if (id == 303) { OUTPUT -= shift ? 4096 : 256; + if(ctrl){ + OUTPUT = 1; + } } - if (OUTPUT > maxOutput) { - OUTPUT = maxOutput; + if (OUTPUT > getMaxConfigOutput()) { + OUTPUT = getMaxConfigOutput(); } if (OUTPUT <= -1) { OUTPUT = 0; @@ -126,4 +161,14 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro .complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45) .syncEnergyValue().syncIntegerValue(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this); } + + @Override + public boolean canBeUpgraded() { + return true; + } + + @Override + public boolean isUpgradeValid(IUpgrade upgrade, ItemStack stack) { + return upgrade instanceof ItemUpgrades && stack.getItemDamage() == 3; + } } diff --git a/src/main/resources/assets/techreborn/blockstates/cable_inv.json b/src/main/resources/assets/techreborn/blockstates/cable_inv.json index 8db9b9dc3..8a57f4654 100644 --- a/src/main/resources/assets/techreborn/blockstates/cable_inv.json +++ b/src/main/resources/assets/techreborn/blockstates/cable_inv.json @@ -45,6 +45,11 @@ "textures": { "layer0": "techreborn:items/cables/insulatedhv" } + }, + "superconductor": { + "textures": { + "layer0": "techreborn:items/cables/superconductor" + } } } } diff --git a/src/main/resources/assets/techreborn/blockstates/cable_thick.json b/src/main/resources/assets/techreborn/blockstates/cable_thick.json index 77e24ebaa..4890f79d3 100644 --- a/src/main/resources/assets/techreborn/blockstates/cable_thick.json +++ b/src/main/resources/assets/techreborn/blockstates/cable_thick.json @@ -77,6 +77,11 @@ "textures": { "cable": "techreborn:blocks/cables/hv_insulated_cable" } + }, + "superconductor": { + "textures": { + "cable": "techreborn:blocks/cables/superconductor_cable" + } } } } diff --git a/src/main/resources/assets/techreborn/blockstates/items/materials/part.json b/src/main/resources/assets/techreborn/blockstates/items/materials/part.json index 21e23df6a..dfb8fff28 100644 --- a/src/main/resources/assets/techreborn/blockstates/items/materials/part.json +++ b/src/main/resources/assets/techreborn/blockstates/items/materials/part.json @@ -195,6 +195,11 @@ "textures": { "layer0": "techreborn:items/part/coolant_six" } + }, + "enhanced_super_conductor": { + "textures": { + "layer0": "techreborn:items/part/super_conductor" + } } } } diff --git a/src/main/resources/assets/techreborn/blockstates/items/misc/upgrades.json b/src/main/resources/assets/techreborn/blockstates/items/misc/upgrades.json index adc22c8c9..7476f32e1 100644 --- a/src/main/resources/assets/techreborn/blockstates/items/misc/upgrades.json +++ b/src/main/resources/assets/techreborn/blockstates/items/misc/upgrades.json @@ -35,6 +35,11 @@ "textures": { "layer0": "techreborn:items/upgrade/injection_upgrade" } + }, + "superconductor": { + "textures": { + "layer0": "techreborn:items/upgrade/superconductor" + } } } } diff --git a/src/main/resources/assets/techreborn/lang/en_us.lang b/src/main/resources/assets/techreborn/lang/en_us.lang index 3835fb467..b7e703874 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.lang +++ b/src/main/resources/assets/techreborn/lang/en_us.lang @@ -146,6 +146,7 @@ tile.techreborn.cable.glassfiber.name=Glass Fiber Cable tile.techreborn.cable.insulatedcopper.name=Insulated Copper Cable tile.techreborn.cable.insulatedgold.name=Insulated Gold Cable tile.techreborn.cable.insulatedhv.name=Insulated HV Cable +tile.techreborn.cable.superconductor.name=Superconductor Cable #Fluid blocks tile.techreborn.berylium.name=Beryllium @@ -487,6 +488,7 @@ item.techreborn.part.coolant_six.name=60k Coolant Cell item.techreborn.part.carbon_mesh.name=Carbon Mesh item.techreborn.part.carbon_fiber.name=Carbon Fiber item.techreborn.part.uuMatter.name=UU-Matter +item.techreborn.part.enhanced_super_conductor.name=Enhanced Superconductor #Items-Armor item.techreborn.cloakingdevice.name=Cloaking Device @@ -528,6 +530,7 @@ item.techreborn.scrapbox.name=Scrap Box item.techreborn.upgrade.overclock.name=Overclocker Upgrade item.techreborn.upgrade.transformer.name=Transformer Upgrade item.techreborn.upgrade.energy_storage.name=Energy Storage Upgrade +item.techreborn.upgrade.superconductor.name=Superconductor Upgrade item.bronzeSword.name=Bronze Sword diff --git a/src/main/resources/assets/techreborn/textures/blocks/cables/superconductor_cable.png b/src/main/resources/assets/techreborn/textures/blocks/cables/superconductor_cable.png index 7ed6f3423b023818eac245d18c6ebde2216d12a4..0cc997494904446b2173b8c47541a59f104952db 100644 GIT binary patch literal 1904 zcmbVNeN5bB9PThUK0<;7wq<8RQ!<^yUO%q)(YhOfJ2r0f7=d#`w;11R-*OFiZPym= zKtr-4QHN|{Y>sGjECTTZ*^CQDT@+2!e~fX8$s~(J7oC4B2Im|5D-$i$$XLaT_K(AuG=}{BIDlGfnFfUi9 zFs$%~5^1;E!w(ChmT&?|i$Z5Ap(8Yg?W{}bK>L(U1%@DXE`H6$>Fdfzd zFs3y18nCUmIU@FUio8VB?ZS7a1VoU47Qj=9xM~V1Kau4X(Ab`)2s{h1I{iewZ4hq{ zx8MQIfVkV~Aw`CB<6hp$cw8LMKZvt55rQ;(R12g?)vQ@&2trdd6x~uZ6}K5dRO_<* z1X8->LPF2es%9=sC}30y=oI6mZI`k@NzCK)E+d{bE{PP3!vs_<6JeP=R*z|xX2!HT zQ0JHbWdMaX9M0QVRZAj~H(^?h-N=nxKvqSYkscjVtaCNSY@ZHo~|C*3Mlm%?LET1PyDF zBKPE>JW0Dq))hfHcJl(`eJqDU1tS3qtc8G1 zX>zTc4+R1(h9)aID`Uw;jr=m#61qn!A zA5U^#36fC{$CEzZO_Oqz=iQ79IX5jX?+d$``bj@SfhT2fDKH@w6#mTyT z4WROw(Mj_9Bk%SHTl%YCaliP+NE#nXzV?IjX!Y3sudemoU;KW5atM#bW945vu2qkh zrf=?eeDlZ6Z4H-yZQVC>^JwPYzMs!cpTP&mM+YZH2e%c~ynbLZok-KeDY{~6di%uq ztYdHa?myCf?53&dPx?=ObM`oztV&K5IAy zcWm*OXFpsxRQl3|=crAk_nj*KG*Y4xjB$)D7s z%&o1V#i7X$D$ZUyR(AEfdE&0ieNS%uUf~WUFT%OM#!lTBx#~DDSv7ZM Jc)sC@^xyJ@f}#Kb literal 552 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>&;orV9i zlL-k4E4J*qeDluo%{!NE+J67p%bO1#-?;a1_WAc4?*EC~_iN3z-Opd$W?9)^mS!_#4aPG zD!HatTOBAg*VDx@MB=jVncG6m3OpEsD4>7iZo^VwcET{y)2W#jQbiwr+Fsr4CHe9AD9SiJDMh z;5+v{IU#xh!{Vt~KbqtZOyjf@T*3?V1cPdcYeY#(Vo9o1a#1RfVlXl=w9qv$ z*EO;TF|@EUHn%b|)iyA&GB9XjnY9%~LvDUbW?Cg~4WA>GIDr}%JYD@<);T3K0RWV% B&S(Gt diff --git a/src/main/resources/assets/techreborn/textures/blocks/cables/superconductor_cable_old.png b/src/main/resources/assets/techreborn/textures/blocks/cables/superconductor_cable_old.png new file mode 100644 index 0000000000000000000000000000000000000000..7ed6f3423b023818eac245d18c6ebde2216d12a4 GIT binary patch literal 552 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>&;orV9i zlL-k4E4J*qeDluo%{!NE+J67p%bO1#-?;a1_WAc4?*EC~_iN3z-Opd$W?9)^mS!_#4aPG zD!HatTOBAg*VDx@MB=jVncG6m3OpEsD4>7iZo^VwcET{y)2W#jQbiwr+Fsr4CHe9AD9SiJDMh z;5+v{IU#xh!{Vt~KbqtZOyjf@T*3?V1cPdcYeY#(Vo9o1a#1RfVlXl=w9qv$ z*EO;TF|@EUHn%b|)iyA&GB9XjnY9%~LvDUbW?Cg~4WA>GIDr}%JYD@<);T3K0RWV% B&S(Gt literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/techreborn/textures/items/cables/superconductor.png b/src/main/resources/assets/techreborn/textures/items/cables/superconductor.png new file mode 100644 index 0000000000000000000000000000000000000000..0d1d398d120edecc82d43d4f27078dcda54328ef GIT binary patch literal 1726 zcmbVNeM}o=7{5)OFw@Bv-3NqtxdC=_*SqT%y|bm37HExEYu62CjB?z)Z4Y`MyF1px zGz;i3kSv(F{WHvTM089u$u!esW-8(zMii1}#;FN$F2-o)qWi;znBaS*ZP1|6UGm=h z-uwRE=Xrk5*A2&_ZI<=b>k$O8M8cssoU6=Hu@1iPyRpQrBpv734B-ZEh17T7VcmJ}h7=L_63R z8dNlZx@>Nor<^Xdk+xB8hm)pvp>~q;5Tu8o9604>oFrqnqs0e<+B6}_#6zt`UGU3? zr42)62qK%!+OiItqNNCmrfGt-6Lvce5xCwb8(a>T_3b4IA)xb`s2ZXoqozczOX)Ry z7_@Ymf~1zk%6idF&|yT5QwhpOnv@DafiL6KUM*8lF7O1%013#34zW}jtELr0(bLL5 zh%O)hMFDgz%a(PlYKtV5Rp>^`0Z60hkX6xoqE7`x9Oz1~#)Fmv(9G>78= zp(vSBpkgJH(O}RF42@dbMOjd?`i>QMK!`Jd4>Qkk(t+C@396AHDTZ=BzKmiOK}`0o zigGfPr-XvJB5(%xZ#aQxl8PpAkfbPaDL|-l3Pa1TV}eRX(V#kLj$`G1Bp8foN>a?g z13li>j7D05Zi;rhal4Hw7|F6sMAi*X=0POn!=OWKq9`yt;DO7*IUy_Hz=fnUiFa|d z6X!{q6dW!<(@sz6en{ba&9Im53;*-}qnZfIj?3J#9J3hBd||?(4kOuDESKG2e{q!& z(L#za9B-z+597_40|6^;i?{57WwF^bfI?SKgk^-TB#kVmfj|m6>c6BJ0Zk{&5?y9N z{GDLoY(+Vj;IK!S%W`vqALaH2WZ2U**u1u+lNS+W%@dJOAmKT3?I;y)-oJI`&|Ek9 z%pe-5v{*LQV_(NY?8Z$4)^zI}IbLs_svaDgo-_h~pC*N!Chi6Z| p2C1=ma_sY0^J3*gi!W<8)-FV|17YO1+D7va6KRQt&Ng=r{t0}jNFM+I literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/techreborn/textures/items/upgrade/superconductor.png b/src/main/resources/assets/techreborn/textures/items/upgrade/superconductor.png new file mode 100644 index 0000000000000000000000000000000000000000..6a272f0745e62d3264dc64ec383ad3539de13e46 GIT binary patch literal 1949 zcmbVNe@qis96wMA6I_TQQv!G%Dl%>FuC#?asYKc;MT%IuQT!3T-d)?1wpZ^C+M-i4 zopTt`AkGCg{4r4z)c6My=WnOT{+LA6I1_(HCuF!qK^LOTv3F1!w>YzT$-DRNz0do8 zzQ6B_qQZG&MkkJjAZUy!&tL&_oIIkVzj@AvYAk29 zNj7rEWKb>%*77!rz=IH}Ooz;o31OSL2-fog z3u}~G1&ymUa3-O|wHa!Hm(Y;I7o|OZiowf=@6GB z`A8J?`~6CPhLRVYC{7Rrim6bQN&yfGG3b@3fWj-L4ofhwA}w$}iQ~PnERnMF<&q8o znhu%Z@rA{D#gLnT!_WZbLvbZ0n=}Yy=rGP#F1QED85(8XtcUeVBEaHdtk1OQkh84tEr6$#yMIjVO7>1Ilx8WF?bnt?Q0+wg8{v-9g zn->5b&?)2feUn~aB=8Q-4Gu)hyj<91)N64=dq1WMU4xLd&Wdg*{WtDyS?ik(tR54jj)MzHi{^ayj zEJv(?0EBt zDhP_iO@=wvtSyb(7v#k+Olr&FJGZnSRUV8>`S2I($P^@XdgP9{ggf&)CU;+1b`vH? zvY+=R&b=~~{3zzZRC3g+L-V)g7R5|JTqw5K#7KfPuO7is(Qv)URs8Z#Hy<~P_&bHJEnJbt7;>Sl}iyCu`=FOS_g z*^?|%7c#OXUrXU1(?o1kXl dmi})BpeKFrw>I|&7RWzPld;fnBzO6ze*uEBx%B`5 literal 0 HcmV?d00001 From fc277000b8c43276b00882f127f3d9e0f6aeda71 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 23 Mar 2019 20:01:30 +0000 Subject: [PATCH 67/86] Fix super conductor output on aesu's --- .../java/techreborn/items/ItemUpgrades.java | 8 +++++-- .../tiles/storage/TileAdjustableSU.java | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/techreborn/items/ItemUpgrades.java b/src/main/java/techreborn/items/ItemUpgrades.java index 37352f1ee..f0640fa6a 100644 --- a/src/main/java/techreborn/items/ItemUpgrades.java +++ b/src/main/java/techreborn/items/ItemUpgrades.java @@ -34,6 +34,7 @@ import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.lwjgl.input.Keyboard; import reborncore.api.tile.IUpgrade; import reborncore.api.tile.IUpgradeable; import reborncore.common.powerSystem.TilePowerAcceptor; @@ -149,8 +150,11 @@ public class ItemUpgrades extends ItemTR implements IUpgrade { @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { if(stack.getItemDamage() == 3){ - tooltip.add(TextFormatting.LIGHT_PURPLE + "Increases the max output of the AESU"); - tooltip.add(TextFormatting.GOLD + "Blame obstinate_3 for this"); + tooltip.add(TextFormatting.LIGHT_PURPLE + "Increases the max transfer of the Adjustable SU"); + if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)){ + tooltip.add(TextFormatting.GOLD + "Blame obstinate_3 for this"); + } + } } diff --git a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java index cfb8d5fa8..13566b2a6 100644 --- a/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java +++ b/src/main/java/techreborn/tiles/storage/TileAdjustableSU.java @@ -72,6 +72,9 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro if (OUTPUT > getMaxConfigOutput()) { OUTPUT = getMaxConfigOutput(); } + if(world.getTotalWorldTime() % 20 == 0){ + checkTeir(); + } } public int getMaxConfigOutput(){ @@ -138,6 +141,25 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro return OUTPUT; } + @Override + public double getMaxOutput() { + return OUTPUT; + } + + @Override + public double getBaseMaxInput() { + //If we have super conductors increase the max input of the machine + if(getMaxConfigOutput() > maxOutput){ + return getMaxConfigOutput(); + } + return maxInput; + } + + @Override + public EnumPowerTier getBaseTier() { + return null; + } + // TilePowerAcceptor @Override public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { From 053324154e97b3216717176ed1c921ee4ef67570 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 24 Mar 2019 00:54:54 +0000 Subject: [PATCH 68/86] Improve creative solar panel --- .../generator/TileCreativeSolarPanel.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java index d2f5970fc..3e8024ad8 100644 --- a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java @@ -28,6 +28,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; +import net.minecraftforge.energy.CapabilityEnergy; +import net.minecraftforge.energy.IEnergyStorage; import reborncore.api.IToolDrop; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.PowerSystem; @@ -48,24 +50,18 @@ public class TileCreativeSolarPanel extends TilePowerAcceptor implements IToolDr @Override public void update() { - //If FE power is disabled we handle the power this way. - if(!PowerSystem.EnergySystem.FE.enabled.get()){ - boolean added = false; - for (EnumFacing facing : EnumFacing.VALUES){ - TileEntity tileEntity = world.getTileEntity(getPos().offset(facing)); - if(tileEntity instanceof TilePowerAcceptor){ - ((TilePowerAcceptor) tileEntity).addEnergy(100000); - added = true; + if(world.isRemote){ + return; + } + for (EnumFacing facing : EnumFacing.VALUES){ + TileEntity tileEntity = world.getTileEntity(getPos().offset(facing)); + if(tileEntity != null ){ + IEnergyStorage energyStorage = tileEntity.getCapability(CapabilityEnergy.ENERGY, facing.getOpposite()); + if(energyStorage != null){ + energyStorage.receiveEnergy(Integer.MAX_VALUE, false); } } - if(!added){ - //If nothing happened then go back to to ic2 power - super.update(); - } - } else { - super.update(); } - setEnergy(getMaxPower()); } From 826187466502bd90a5f5ecac366c61cf027675c9 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 25 Mar 2019 14:36:48 +0300 Subject: [PATCH 69/86] Should fix #1691 --- .../techreborn/tiles/generator/TileCreativeSolarPanel.java | 1 - .../java/techreborn/tiles/generator/TileLightningRod.java | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java index 3e8024ad8..4b1bf5277 100644 --- a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java @@ -32,7 +32,6 @@ import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.IEnergyStorage; import reborncore.api.IToolDrop; import reborncore.api.power.EnumPowerTier; -import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.init.ModBlocks; diff --git a/src/main/java/techreborn/tiles/generator/TileLightningRod.java b/src/main/java/techreborn/tiles/generator/TileLightningRod.java index b5283e326..3e9e932b9 100644 --- a/src/main/java/techreborn/tiles/generator/TileLightningRod.java +++ b/src/main/java/techreborn/tiles/generator/TileLightningRod.java @@ -65,8 +65,9 @@ public class TileLightningRod extends TilePowerAcceptor implements IToolDrop { --onStatusHoldTicks; if (onStatusHoldTicks == 0 || getEnergy() <= 0) { - if (getBlockType() instanceof BlockMachineBase) - ((BlockMachineBase) getBlockType()).setActive(false, world, pos); + if (world.getBlockState(pos).getBlock() instanceof BlockMachineBase) { + ((BlockMachineBase) world.getBlockState(pos).getBlock()).setActive(false, world, pos); + } onStatusHoldTicks = -1; } @@ -87,7 +88,7 @@ public class TileLightningRod extends TilePowerAcceptor implements IToolDrop { world.addWeatherEffect(lightningBolt); world.spawnEntity(lightningBolt); addEnergy(baseEnergyStrike * (0.3F + weatherStrength)); - ((BlockMachineBase) getBlockType()).setActive(true, world, pos); + ((BlockMachineBase) world.getBlockState(pos).getBlock()).setActive(true, world, pos); onStatusHoldTicks = 400; } } From 17427e675e4a9e3cb2e9b408d0179ffe4527070a Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 25 Mar 2019 21:37:27 +0000 Subject: [PATCH 70/86] Fixes https://github.com/TechReborn/TechReborn/issues/1693 and Fixes https://github.com/FTBTeam/FTB-Sky-Odyssey/issues/102 --- .../techreborn/blocks/generator/solarpanel/BlockSolarPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/blocks/generator/solarpanel/BlockSolarPanel.java b/src/main/java/techreborn/blocks/generator/solarpanel/BlockSolarPanel.java index 568bb3717..401a65176 100644 --- a/src/main/java/techreborn/blocks/generator/solarpanel/BlockSolarPanel.java +++ b/src/main/java/techreborn/blocks/generator/solarpanel/BlockSolarPanel.java @@ -95,7 +95,7 @@ public class BlockSolarPanel extends BlockMachineBase { @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { - return getStateFromMeta(placer.getHeldItem(hand).getItemDamage()); + return getStateFromMeta(meta); } @Override From 8ab9724181752b03d859408ddf8e671d8d4903a0 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 25 Mar 2019 21:41:50 +0000 Subject: [PATCH 71/86] Fixes #1695 --- src/main/java/techreborn/tiles/tier1/TileRecycler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/tier1/TileRecycler.java b/src/main/java/techreborn/tiles/tier1/TileRecycler.java index feb70f448..e56ccb02b 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRecycler.java +++ b/src/main/java/techreborn/tiles/tier1/TileRecycler.java @@ -38,6 +38,7 @@ import reborncore.common.util.Inventory; import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.ContainerBuilder; +import techreborn.init.IC2Duplicates; import techreborn.init.ModBlocks; import techreborn.init.ModItems; import techreborn.items.ingredients.ItemParts; @@ -51,6 +52,8 @@ public class TileRecycler extends TilePowerAcceptor public static int maxInput = 32; @ConfigRegistry(config = "machines", category = "recycler", key = "RecyclerMaxEnergy", comment = "Recycler Max Energy (Value in EU)") public static int maxEnergy = 1000; + @ConfigRegistry(config = "machines", category = "recycler", key = "produceIC2Scrap", comment = "When enabled and when ic2 is installed the recycler will make ic2 scrap") + public static boolean produceIC2Scrap = false; private final Inventory inventory = new Inventory(3, "TileRecycler", 64, this); private final int cost = 2; @@ -76,7 +79,10 @@ public class TileRecycler extends TilePowerAcceptor } public void recycleItems() { - final ItemStack itemstack = ItemParts.getPartByName("scrap"); + ItemStack itemstack = ItemParts.getPartByName("scrap"); + if(produceIC2Scrap && IC2Duplicates.SCRAP.hasIC2Stack()){ + itemstack = IC2Duplicates.SCRAP.getIc2Stack(); + } final int randomchance = this.world.rand.nextInt(chance); if (randomchance == 1) { From 0b09ec8390c4dae2d539c777fcdeaff27411d774 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 25 Mar 2019 21:47:45 +0000 Subject: [PATCH 72/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 154dbf583..d4b4b4da2 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.21.2" +version = "2.22.0" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From 01103a26baf1bbbcfdb55b775846e7e6bd8e66ee Mon Sep 17 00:00:00 2001 From: drcrazy Date: Tue, 26 Mar 2019 14:28:38 +0300 Subject: [PATCH 73/86] Check blast furnace upgrades both on client and server. Closes #1694 --- .../techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java b/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java index 7f3a1634e..32391f4c4 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java +++ b/src/main/java/techreborn/tiles/multiblock/TileIndustrialBlastFurnace.java @@ -137,7 +137,7 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC multiblockChecker = new MultiblockChecker(world, downCenter); } - if (!world.isRemote && getMutliBlock()){ + if (getMutliBlock()){ super.update(); } } From 8ad5419ce1b92e816d97f71f65f78669321f0328 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Sun, 31 Mar 2019 02:00:27 +0100 Subject: [PATCH 74/86] Update build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d4b4b4da2..ed0a4ae40 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ repositories { maven { // JEI name "JEI" - url "http://dvs1.progwml6.com/files/maven" + url "https://dvs1.progwml6.com/files/maven" } } From 74d18371677d5e51c68773cec7994e660e7ab627 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 1 Apr 2019 15:27:58 +0300 Subject: [PATCH 75/86] Updated freezer multiblock. More work on #1672 --- .../client/gui/GuiVacuumFreezer.java | 24 ++++++++++++++++- .../tiles/multiblock/TileVacuumFreezer.java | 27 ++++++++++++++++--- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java index 7e46266ce..bad555994 100644 --- a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java +++ b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java @@ -98,7 +98,8 @@ public class GuiVacuumFreezer extends GuiBase { { // This code here makes a basic multiblock and then sets to the selected one. final Multiblock multiblock = new Multiblock(); - IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "reinforced"); + IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "reinforced"); + IBlockState advancedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "advanced"); addComponent(0, -1, 0, reinforcedCasing, multiblock); addComponent(1, -1, 0, reinforcedCasing, multiblock); @@ -110,6 +111,27 @@ public class GuiVacuumFreezer extends GuiBase { addComponent(1, -1, -1, reinforcedCasing, multiblock); addComponent(1, -1, 1, reinforcedCasing, multiblock); + if (TileVacuumFreezer.bigMultiblock) { + addComponent(1, -2, 0, advancedCasing, multiblock); + addComponent(0, -2, 1, advancedCasing, multiblock); + addComponent(-1, -2, 0, advancedCasing, multiblock); + addComponent(0, -2, -1, advancedCasing, multiblock); + addComponent(-1, -2, -1, advancedCasing, multiblock); + addComponent(-1, -2, 1, advancedCasing, multiblock); + addComponent(1, -2, -1, advancedCasing, multiblock); + addComponent(1, -2, 1, advancedCasing, multiblock); + + addComponent(0, -3, 0, reinforcedCasing, multiblock); + addComponent(1, -3, 0, reinforcedCasing, multiblock); + addComponent(0, -3, 1, reinforcedCasing, multiblock); + addComponent(-1, -3, 0, reinforcedCasing, multiblock); + addComponent(0, -3, -1, reinforcedCasing, multiblock); + addComponent(-1, -3, -1, reinforcedCasing, multiblock); + addComponent(-1, -3, 1, reinforcedCasing, multiblock); + addComponent(1, -3, -1, reinforcedCasing, multiblock); + addComponent(1, -3, 1, reinforcedCasing, multiblock); + } + final MultiblockSet set = new MultiblockSet(multiblock); ClientProxy.multiblockRenderEvent.setMultiblock(set); ClientProxy.multiblockRenderEvent.parent = tile.getPos(); diff --git a/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java b/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java index 4a112bacf..674a3ca1d 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java +++ b/src/main/java/techreborn/tiles/multiblock/TileVacuumFreezer.java @@ -25,6 +25,7 @@ package techreborn.tiles.multiblock; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.impl.ConfigRegistry; @@ -44,6 +45,9 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP public static int maxInput = 64; @ConfigRegistry(config = "machines", category = "vacuumfreezer", key = "VacuumFreezerMaxEnergy", comment = "Vacuum Freezer Max Energy (Value in EU)") public static int maxEnergy = 64_000; + @ConfigRegistry(config = "machines", category = "vacuumfreezer", key = "VacuumFreezerBigMultiblock", comment = "Vacuum Freezer requires big multiblock") + public static boolean bigMultiblock = false; + public MultiblockChecker multiblockChecker; @@ -59,20 +63,35 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP if(multiblockChecker == null){ return false; } - return multiblockChecker.checkRectY(1, 1, MultiblockChecker.REINFORCED_CASING, MultiblockChecker.ZERO_OFFSET); + + final boolean up = multiblockChecker.checkRectY(1, 1, MultiblockChecker.REINFORCED_CASING, MultiblockChecker.ZERO_OFFSET); + final boolean down = multiblockChecker.checkRectY(1, 1, MultiblockChecker.REINFORCED_CASING, new BlockPos(0, -2, 0)); + final boolean chamber = multiblockChecker.checkRingYHollow(1, 1, MultiblockChecker.ADVANCED_CASING, new BlockPos(0, -1, 0)); + + if (bigMultiblock) { + return down && chamber && up; + } + else { + return up; + } } // TileGenericMachine @Override public void update() { - if(multiblockChecker == null){ - multiblockChecker = new MultiblockChecker(world, pos.down()); - } if (!world.isRemote && getMultiBlock()) { super.update(); } } + // TileEntity + @Override + public void validate() { + super.validate(); + multiblockChecker = new MultiblockChecker(world, pos.down()); + } + + // IContainerProvider @Override public BuiltContainer createContainer(final EntityPlayer player) { From b713b43eafd7a94aeaf3a87513d7965d976fb9d0 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Wed, 3 Apr 2019 18:23:28 +0300 Subject: [PATCH 76/86] Transformers\Energy storages will use vanilla rotation. Closes #1692 --- .../blocks/storage/BlockEnergyStorage.java | 18 ------------------ .../blocks/transformers/BlockTransformer.java | 18 ------------------ 2 files changed, 36 deletions(-) diff --git a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java index 29f1c3848..946e10cbd 100644 --- a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java @@ -136,24 +136,6 @@ public abstract class BlockEnergyStorage extends BaseTileBlock { } // Block - @Override - public boolean rotateBlock(World world, BlockPos pos, EnumFacing side) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); - if (block instanceof BlockEnergyStorage) { - EnumFacing facing = state.getValue(BlockEnergyStorage.FACING); - if (facing.getOpposite() == side) { - facing = side; - } else { - facing = side.getOpposite(); - } - world.setBlockState(pos, state.withProperty(BlockEnergyStorage.FACING, facing)); - return true; - } - - return false; - } - @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { diff --git a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java index 2871e6444..2b121c611 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java @@ -178,24 +178,6 @@ public abstract class BlockTransformer extends BaseTileBlock { return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); } - @Override - public boolean rotateBlock(World world, BlockPos pos, EnumFacing side) { - IBlockState state = world.getBlockState(pos); - Block block = state.getBlock(); - if (block instanceof BlockTransformer) { - EnumFacing facing = state.getValue(BlockTransformer.FACING); - if (facing.getOpposite() == side) { - facing = side; - } else { - facing = side.getOpposite(); - } - world.setBlockState(pos, state.withProperty(BlockTransformer.FACING, facing)); - return true; - } - - return false; - } - @Override public int getMetaFromState(IBlockState state) { int facingInt = getSideFromEnum(state.getValue(FACING)); From ec2fcf5d6d9313cf9451937fef760bec78e003e5 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Wed, 3 Apr 2019 18:24:27 +0300 Subject: [PATCH 77/86] Removed unused import. --- src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java | 1 - .../java/techreborn/blocks/transformers/BlockTransformer.java | 1 - 2 files changed, 2 deletions(-) diff --git a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java index 946e10cbd..464d351fd 100644 --- a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java @@ -26,7 +26,6 @@ package techreborn.blocks.storage; import com.google.common.base.Predicate; import com.google.common.collect.Iterators; -import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; diff --git a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java index 2b121c611..ee34d90f9 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java @@ -26,7 +26,6 @@ package techreborn.blocks.transformers; import com.google.common.base.Predicate; import com.google.common.collect.Iterators; -import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; From 925a7b4c0ab88ba49649ebf838aae558f5449688 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 3 Apr 2019 21:48:44 +0100 Subject: [PATCH 78/86] Add tank support for Fluid Replicator, fixes https://github.com/TechReborn/TechReborn/issues/1698 --- .../FluidReplicatorRecipe.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/techreborn/api/fluidreplicator/FluidReplicatorRecipe.java b/src/main/java/techreborn/api/fluidreplicator/FluidReplicatorRecipe.java index 2ddf67e2b..b320cf93b 100644 --- a/src/main/java/techreborn/api/fluidreplicator/FluidReplicatorRecipe.java +++ b/src/main/java/techreborn/api/fluidreplicator/FluidReplicatorRecipe.java @@ -25,9 +25,14 @@ package techreborn.api.fluidreplicator; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; import reborncore.common.util.FluidUtils; import techreborn.init.ModItems; import techreborn.tiles.multiblock.TileFluidReplicator; @@ -112,6 +117,9 @@ public class FluidReplicatorRecipe implements Cloneable { return false; } final BlockPos hole = tile.getPos().offset(tile.getFacing().getOpposite(), 2); + if(hasValidTank(tile.getWorld(), hole)){ + return true; + } final Fluid fluid = FluidRegistry.lookupFluidForBlock(tile.getWorld().getBlockState(hole).getBlock()); if (fluid == null) { return false; @@ -126,6 +134,19 @@ public class FluidReplicatorRecipe implements Cloneable { return true; } + + private boolean hasValidTank(World world, BlockPos pos){ + TileEntity tileEntity = world.getTileEntity(pos); + if(tileEntity == null){ + return false; + } + IFluidHandler fluidHandler = tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null); + if(fluidHandler != null){ + FluidStack containedStack = fluidHandler.drain(1000, false); + return containedStack != null && FluidUtils.fluidEquals(containedStack.getFluid(), output); + } + return false; + } public boolean onCraft(TileFluidReplicator tile) { return true; From afe6a179afeda0d805cc2ff6fe0c8241bc89f551 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 3 Apr 2019 22:09:44 +0100 Subject: [PATCH 79/86] Optimise matter fab a bit --- src/main/java/techreborn/tiles/TileMatterFabricator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/techreborn/tiles/TileMatterFabricator.java b/src/main/java/techreborn/tiles/TileMatterFabricator.java index bdcc3fce8..176e97f04 100644 --- a/src/main/java/techreborn/tiles/TileMatterFabricator.java +++ b/src/main/java/techreborn/tiles/TileMatterFabricator.java @@ -88,11 +88,12 @@ public class TileMatterFabricator extends TilePowerAcceptor } private void addOutputProducts(int slot) { - if (inventory.getStackInSlot(slot).isEmpty()) { + ItemStack stack = getStackInSlot(slot); + if (stack.isEmpty()) { inventory.setInventorySlotContents(slot, new ItemStack(ModItems.UU_MATTER)); } - else if (ItemUtils.isItemEqual(this.inventory.getStackInSlot(slot), new ItemStack(ModItems.UU_MATTER), true, true)) { - inventory.getStackInSlot(slot).setCount((Math.min(64, 1 + inventory.getStackInSlot(slot).getCount()))); + else if (ItemUtils.isItemEqual(stack, new ItemStack(ModItems.UU_MATTER), true, true) && stack.getCount() < stack.getMaxStackSize()) { + inventory.getStackInSlot(slot).grow(1); } } From 75f06f6f80f9d592ebae9323e9ccb0925e9fde07 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 3 Apr 2019 22:31:16 +0100 Subject: [PATCH 80/86] Make creative solar panel quicker --- .../techreborn/tiles/generator/TileCreativeSolarPanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java index 4b1bf5277..69f772b72 100644 --- a/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileCreativeSolarPanel.java @@ -57,7 +57,9 @@ public class TileCreativeSolarPanel extends TilePowerAcceptor implements IToolDr if(tileEntity != null ){ IEnergyStorage energyStorage = tileEntity.getCapability(CapabilityEnergy.ENERGY, facing.getOpposite()); if(energyStorage != null){ - energyStorage.receiveEnergy(Integer.MAX_VALUE, false); + for (int i = 0; i < 10; i++) { + energyStorage.receiveEnergy(Integer.MAX_VALUE, false); + } } } } From 73f55540156a5a916557b375ce3d2e1ae4f19c15 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 3 Apr 2019 22:40:34 +0100 Subject: [PATCH 81/86] #releaseBuild --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ed0a4ae40..c0688aa4d 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ configurations { compile.extendsFrom shade } -version = "2.22.0" +version = "2.22.1" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { From c57c8b5287f2b31b901bef914c9d5ae9d4c1682b Mon Sep 17 00:00:00 2001 From: drcrazy Date: Fri, 12 Apr 2019 12:45:34 +0300 Subject: [PATCH 82/86] Filter compressor and extractor recipes from JEI if IC2 dedupe is true --- .../compat/jei/TechRebornJeiPlugin.java | 6 ++ src/main/java/techreborn/init/ModRecipes.java | 61 +----------- .../init/recipes/CompressorRecipes.java | 94 +++++++++++++++++++ 3 files changed, 101 insertions(+), 60 deletions(-) create mode 100644 src/main/java/techreborn/init/recipes/CompressorRecipes.java diff --git a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java index ea3194a4e..6ce34ff46 100644 --- a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java +++ b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java @@ -293,6 +293,12 @@ public class TechRebornJeiPlugin implements IModPlugin { if (recipe instanceof ScrapboxRecipe) { return CompatConfigs.showScrapbox; } + if (IC2Duplicates.deduplicate() && (recipe instanceof CompressorRecipe)) { + return false; + } + if (IC2Duplicates.deduplicate() && (recipe instanceof ExtractorRecipe)) { + return false; + } return true; }).collect(Collectors.toList())); diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 75448d75d..06b9d522e 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -39,7 +39,6 @@ import reborncore.common.util.ItemUtils; import reborncore.common.util.OreUtil; import reborncore.common.util.RebornCraftingHelper; import techreborn.Core; -import techreborn.api.recipe.machines.CompressorRecipe; import techreborn.api.recipe.machines.GrinderRecipe; import techreborn.api.recipe.machines.VacuumFreezerRecipe; import techreborn.compat.CompatManager; @@ -48,10 +47,8 @@ import techreborn.init.recipes.*; import techreborn.items.*; import techreborn.items.ingredients.ItemDusts; import techreborn.items.ingredients.ItemIngots; -import techreborn.items.ingredients.ItemPlates; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; @@ -86,12 +83,12 @@ public class ModRecipes { AlloySmelterRecipes.init(); FluidReplicatorRecipes.init(); BlastFurnaceRecipes.init(); + CompressorRecipes.init(); addVacuumFreezerRecipes(); addIc2Recipes(); addGrinderRecipes(); - addCompressorRecipes(); } public static void postInit() { @@ -114,62 +111,6 @@ public class ModRecipes { IndustrialSawmillRecipes.init(); } - private static void addCompressorRecipes() { - RecipeHandler.addRecipe(new CompressorRecipe(ItemIngots.getIngotByName("advanced_alloy"), - ItemPlates.getPlateByName("advanced_alloy"), 400, 20)); - RecipeHandler.addRecipe(new CompressorRecipe(IC2Duplicates.CARBON_MESH.getStackBasedOnConfig(), - ItemPlates.getPlateByName("carbon"), 400, 2)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("plankWood", 1), - OreUtil.getStackFromName("plateWood", 1), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("dustLazurite", 1), - ItemPlates.getPlateByName("lazurite", 1), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("obsidian", 1), - ItemPlates.getPlateByName("obsidian", 9), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("dustObsidian", 1), - ItemPlates.getPlateByName("obsidian", 1), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("dustYellowGarnet", 1), - ItemPlates.getPlateByName("YellowGarnet"), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("blockYellowGarnet", 1), - ItemPlates.getPlateByName("YellowGarnet", 9), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("dustRedGarnet", 1), - ItemPlates.getPlateByName("RedGarnet"), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe(OreUtil.getStackFromName("blockRedGarnet", 1), - ItemPlates.getPlateByName("RedGarnet", 9), 300, 4)); - RecipeHandler.addRecipe(new CompressorRecipe("ingotRefinedIron", - ItemPlates.getPlateByName("RefinedIron"), 300, 4)); - - ItemStack plate; - for (String ore : OreUtil.oreNames) { - if (ore.equals("iridium")) { - continue; - } - if (OreUtil.hasPlate(ore)) { - try { - plate = ItemPlates.getPlateByName(ore, 1); - } catch (InvalidParameterException e) { - plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore), 1); - } - if (plate.isEmpty()) { - continue; - } - if (OreUtil.hasIngot(ore)) { - RecipeHandler.addRecipe(new CompressorRecipe( - OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4)); - } - if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) { - RecipeHandler.addRecipe(new CompressorRecipe( - OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore), 1), plate, 300, 4)); - } - if (OreUtil.hasBlock(ore)) { - ItemStack morePlates = plate.copy(); - morePlates.setCount(9); - RecipeHandler.addRecipe(new CompressorRecipe( - OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore), 1), morePlates, 300, 4)); - } - } - } - } - static void addGrinderRecipes() { // Vanilla diff --git a/src/main/java/techreborn/init/recipes/CompressorRecipes.java b/src/main/java/techreborn/init/recipes/CompressorRecipes.java new file mode 100644 index 000000000..1e048cf55 --- /dev/null +++ b/src/main/java/techreborn/init/recipes/CompressorRecipes.java @@ -0,0 +1,94 @@ +/* + * This file is part of TechReborn, licensed under the MIT License (MIT). + * + * Copyright (c) 2018 TechReborn + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package techreborn.init.recipes; + +import java.security.InvalidParameterException; + +import net.minecraft.item.ItemStack; +import reborncore.api.recipe.RecipeHandler; +import reborncore.common.util.OreUtil; +import techreborn.api.recipe.machines.CompressorRecipe; +import techreborn.init.IC2Duplicates; +import techreborn.items.ingredients.ItemIngots; +import techreborn.items.ingredients.ItemPlates; + +/** + * @author drcrazy + * + */ +public class CompressorRecipes extends RecipeMethods { + + public static void init() { + register(ItemIngots.getIngotByName("advanced_alloy"), ItemPlates.getPlateByName("advanced_alloy"), 400, 20); + register(IC2Duplicates.CARBON_MESH.getStackBasedOnConfig(), ItemPlates.getPlateByName("carbon"), 400, 2); + register(OreUtil.getStackFromName("plankWood"), OreUtil.getStackFromName("plateWood")); + register(OreUtil.getStackFromName("dustLazurite"), ItemPlates.getPlateByName("lazurite")); + register(OreUtil.getStackFromName("obsidian"), ItemPlates.getPlateByName("obsidian", 9)); + register(OreUtil.getStackFromName("dustObsidian"), ItemPlates.getPlateByName("obsidian")); + register(OreUtil.getStackFromName("dustYellowGarnet"), ItemPlates.getPlateByName("YellowGarnet")); + register(OreUtil.getStackFromName("blockYellowGarnet"), ItemPlates.getPlateByName("YellowGarnet", 9)); + register(OreUtil.getStackFromName("dustRedGarnet"), ItemPlates.getPlateByName("RedGarnet")); + register(OreUtil.getStackFromName("blockRedGarnet"), ItemPlates.getPlateByName("RedGarnet", 9)); + register("ingotRefinedIron", ItemPlates.getPlateByName("RefinedIron")); + + ItemStack plate; + for (String ore : OreUtil.oreNames) { + if (ore.equals("iridium")) { + continue; + } + if (!OreUtil.hasPlate(ore)) { + continue; + } + + try { + plate = ItemPlates.getPlateByName(ore, 1); + } catch (InvalidParameterException e) { + plate = OreUtil.getStackFromName("plate" + OreUtil.capitalizeFirstLetter(ore)); + } + if (plate.isEmpty()) { + continue; + } + if (OreUtil.hasIngot(ore)) { + register(OreUtil.getStackFromName("ingot" + OreUtil.capitalizeFirstLetter(ore)), plate); + } + if (OreUtil.hasGem(ore) && OreUtil.hasDust(ore)) { + register(OreUtil.getStackFromName("dust" + OreUtil.capitalizeFirstLetter(ore)), plate); + } + if (OreUtil.hasBlock(ore)) { + ItemStack morePlates = plate.copy(); + morePlates.setCount(9); + register(OreUtil.getStackFromName("block" + OreUtil.capitalizeFirstLetter(ore)), morePlates); + } + } + } + + static void register(Object input, ItemStack output) { + register(input, output, 300, 4); + } + + static void register(Object input, ItemStack output, int tickTime, int euPerTick) { + RecipeHandler.addRecipe(new CompressorRecipe(input, output, tickTime, euPerTick)); + } +} From a506f4b30141e7237540e8a87f79eb52f4278a6f Mon Sep 17 00:00:00 2001 From: drcrazy Date: Tue, 23 Apr 2019 16:14:54 +0300 Subject: [PATCH 83/86] Updated rubber log usage. Some work on #1706 --- src/main/java/techreborn/init/IC2Duplicates.java | 1 + src/main/java/techreborn/init/OreDict.java | 3 ++- .../init/recipes/CraftingTableRecipes.java | 12 +++++++----- .../init/recipes/IndustrialCentrifugeRecipes.java | 6 ++++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 755ae1b91..613de2e05 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -71,6 +71,7 @@ public enum IC2Duplicates { SCRAP(ItemParts.getPartByName("scrap")), SCRAP_BOX(new ItemStack(ModItems.SCRAP_BOX)), FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER)), + RUBBER_WOOD(new ItemStack(ModBlocks.RUBBER_LOG)), //Classical dedupes ENERGY_CRYSTAL(new ItemStack(ModItems.ENERGY_CRYSTAL), true), diff --git a/src/main/java/techreborn/init/OreDict.java b/src/main/java/techreborn/init/OreDict.java index f26879538..583a62fb6 100644 --- a/src/main/java/techreborn/init/OreDict.java +++ b/src/main/java/techreborn/init/OreDict.java @@ -120,7 +120,8 @@ public class OreDict { OreUtil.registerOre("fenceIron", ModBlocks.REFINED_IRON_FENCE); //TODO ic2 bug? Disabled as it crashes with this line - //OreUtil.registerOre("woodRubber", ModBlocks.RUBBER_LOG); + OreUtil.registerOre("logWood", ModBlocks.RUBBER_LOG); + OreUtil.registerOre("logRubber", ModBlocks.RUBBER_LOG); OreUtil.registerOre("glassReinforced", ModBlocks.REINFORCED_GLASS); OreUtil.registerOre("craftingDiamondGrinder", ItemParts.getPartByName("diamondGrindingHead")); diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index 4532a3b70..a7ed1aefa 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -64,11 +64,16 @@ public class CraftingTableRecipes extends RecipeMethods { registerCompressionRecipes(); registerMixedMetalIngotRecipes(); - + + // Wood stuff + registerShapeless(getStack(ModBlocks.RUBBER_PLANKS, 4), IC2Duplicates.RUBBER_WOOD.getStackBasedOnConfig()); + registerShaped(new ItemStack(ModBlocks.RUBBER_LOG_SLAB_HALF, 6), "WWW", 'W', new ItemStack(ModBlocks.RUBBER_PLANKS)); + registerShaped(new ItemStack(ModBlocks.RUBBER_LOG_STAIR, 4), "W ", "WW ", "WWW", 'W', new ItemStack(ModBlocks.RUBBER_PLANKS)); + registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_stone", 1), "stone", "plateIridiumAlloy"); registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_tungstensteel", 1), BlockStorage2.getStorageBlockByName("tungstensteel", 1), "plateIridium"); registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_tungstensteel", 1), BlockStorage2.getStorageBlockByName("iridium_reinforced_stone", 1), getMaterialObject("tungstensteel", Type.INGOT)); - registerShapeless(getStack(ModBlocks.RUBBER_PLANKS, 4), getStack(ModBlocks.RUBBER_LOG)); + if(newCellRecipe){ registerShaped(DynamicCell.getEmptyCell(16), " T ", "TGT", " T ", 'T', "ingotTin", 'G', "paneGlass"); // Blame thermal expansion for making gears have the same recipe } else { @@ -319,9 +324,6 @@ public class CraftingTableRecipes extends RecipeMethods { } } - registerShaped(new ItemStack(ModBlocks.RUBBER_LOG_SLAB_HALF, 6), "WWW", 'W', new ItemStack(ModBlocks.RUBBER_PLANKS)); - registerShaped(new ItemStack(ModBlocks.RUBBER_LOG_STAIR, 4), "W ", "WW ", "WWW", 'W', new ItemStack(ModBlocks.RUBBER_PLANKS)); - Core.logHelper.info("Crafting Table Recipes Added"); } diff --git a/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java b/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java index 7204ffcb9..0ecb5552b 100644 --- a/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java +++ b/src/main/java/techreborn/init/recipes/IndustrialCentrifugeRecipes.java @@ -29,7 +29,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import reborncore.api.recipe.RecipeHandler; import techreborn.api.recipe.machines.CentrifugeRecipe; -import techreborn.init.ModBlocks; +import techreborn.init.IC2Duplicates; import techreborn.items.DynamicCell; import java.security.InvalidParameterException; @@ -78,7 +78,9 @@ public class IndustrialCentrifugeRecipes extends RecipeMethods { register(getStack(Blocks.RED_MUSHROOM, 32), 5000, getMaterial("methane", Type.CELL)); register(getStack(Items.NETHER_WART, 32), 5000, getMaterial("methane", Type.CELL)); register(getMaterial("sap", 4, Type.PART), 1300, getMaterial("rubber", 14, Type.PART)); - register(getStack(ModBlocks.RUBBER_LOG, 16), 5000, false, getMaterial("sap", 8, Type.PART), getMaterial("methane", Type.CELL), getMaterial("carbon", 4, Type.CELL)); + ItemStack stack = IC2Duplicates.RUBBER_WOOD.getStackBasedOnConfig(); + stack.setCount(16); + register(stack, 5000, false, getMaterial("sap", 8, Type.PART), getMaterial("methane", Type.CELL), getMaterial("carbon", 4, Type.CELL)); register(getStack(Blocks.SOUL_SAND, 16), 2500, getStack(Blocks.SAND, 10), getMaterial("saltpeter", 4, Type.DUST), getMaterial("coal", Type.DUST), getMaterial("oil", Type.CELL)); register(getOre("dustBronze"), 1500, getMaterial("copper", 6, Type.SMALL_DUST), getMaterial("tin", 2, Type.SMALL_DUST)); register(getOre("dustIron", 2), 1500, getMaterial("tin", Type.SMALL_DUST), getMaterial("nickel", Type.SMALL_DUST)); From 138c5e60720e6fcae958455a5b008458447bbaa5 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Tue, 23 Apr 2019 20:57:56 +0300 Subject: [PATCH 84/86] De-dupe for re-battery. Some work on #1665 --- src/main/java/techreborn/init/IC2Duplicates.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 613de2e05..8ae615882 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -72,11 +72,12 @@ public enum IC2Duplicates { SCRAP_BOX(new ItemStack(ModItems.SCRAP_BOX)), FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER)), RUBBER_WOOD(new ItemStack(ModBlocks.RUBBER_LOG)), + RE_BATTERY(new ItemStack(ModItems.RE_BATTERY)), //Classical dedupes ENERGY_CRYSTAL(new ItemStack(ModItems.ENERGY_CRYSTAL), true), LAPATRON_CRYSTAL(new ItemStack(ModItems.LAPOTRONIC_CRYSTAL), true), - RE_BATTERY(new ItemStack(ModItems.RE_BATTERY), true), + REFINED_IRON(ItemIngots.getIngotByName("refined_iron"), true), BASIC_MACHINE_FRAME(BlockMachineFrames.getFrameByName("basic"), true), ADVANCED_MACHINE_FRAME(BlockMachineFrames.getFrameByName("advanced"), true), From d30d3316e9e66180475a4819c8c360116f2f26bb Mon Sep 17 00:00:00 2001 From: drcrazy Date: Thu, 25 Apr 2019 16:07:06 +0300 Subject: [PATCH 85/86] Energy Crystal dedupe for #1665 --- .../java/techreborn/init/IC2Duplicates.java | 5 +- .../init/recipes/CraftingTableRecipes.java | 73 ++++++++++--------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 8ae615882..059a82c61 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -73,9 +73,10 @@ public enum IC2Duplicates { FREQ_TRANSMITTER(new ItemStack(ModItems.FREQUENCY_TRANSMITTER)), RUBBER_WOOD(new ItemStack(ModBlocks.RUBBER_LOG)), RE_BATTERY(new ItemStack(ModItems.RE_BATTERY)), - + ENERGY_CRYSTAL(new ItemStack(ModItems.ENERGY_CRYSTAL)), + //Classical dedupes - ENERGY_CRYSTAL(new ItemStack(ModItems.ENERGY_CRYSTAL), true), + LAPATRON_CRYSTAL(new ItemStack(ModItems.LAPOTRONIC_CRYSTAL), true), REFINED_IRON(ItemIngots.getIngotByName("refined_iron"), true), diff --git a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java index a7ed1aefa..97760232a 100644 --- a/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java +++ b/src/main/java/techreborn/init/recipes/CraftingTableRecipes.java @@ -101,9 +101,11 @@ public class CraftingTableRecipes extends RecipeMethods { registerShaped(getStack(ModItems.STEEL_JACKHAMMER), "SBS", "SCS", " S ", 'S', "ingotSteel", 'C', "circuitBasic", 'B', "reBattery"); registerShaped(getStack(ModItems.DIAMOND_JACKHAMMER), "DSD", "TCT", " D ", 'D', "gemDiamond", 'C', "circuitAdvanced", 'S', getStack(ModItems.STEEL_JACKHAMMER, 1, OreDictionary.WILDCARD_VALUE), 'T', "ingotTitanium"); registerShaped(getStack(ModItems.ADVANCED_JACKHAMMER), "NDN", "OCO", " I ", 'I', "plateIridiumAlloy", 'N', "nuggetIridium", 'D', getStack(ModItems.DIAMOND_JACKHAMMER, 1, OreDictionary.WILDCARD_VALUE), 'C', "circuitMaster", 'O', getMaterial("overclock", Type.UPGRADE)); + + // Armour registerShaped(getStack(ModItems.CLOAKING_DEVICE), "CIC", "IOI", "CIC", 'C', "ingotChrome", 'I', "plateIridiumAlloy", 'O', getStack(ModItems.LAPOTRONIC_ORB)); registerShaped(getStack(ModItems.LAPOTRONIC_ORB_PACK), "FOF", "SPS", "FIF", 'F', "circuitMaster", 'O', getStack(ModItems.LAPOTRONIC_ORB), 'S', "craftingSuperconductor", 'I', "ingotIridium", 'P', getStack(ModItems.LITHIUM_BATTERY_PACK)); - + registerShaped(getStack(ModItems.LITHIUM_BATTERY_PACK), "BCB", "BPB", "B B", 'B', getStack(ModItems.LITHIUM_BATTERY), 'P', "plateAluminum", 'C', "circuitAdvanced"); if (ConfigTechReborn.enableGemArmorAndTools) { addToolAndArmourRecipes(getStack(ModItems.RUBY_SWORD), getStack(ModItems.RUBY_PICKAXE), getStack(ModItems.RUBY_AXE), getStack(ModItems.RUBY_HOE), getStack(ModItems.RUBY_SPADE), getStack(ModItems.RUBY_HELMET), getStack(ModItems.RUBY_CHESTPLATE), getStack(ModItems.RUBY_LEGGINGS), getStack(ModItems.RUBY_BOOTS), "gemRuby"); addToolAndArmourRecipes(getStack(ModItems.SAPPHIRE_SWORD), getStack(ModItems.SAPPHIRE_PICKAXE), getStack(ModItems.SAPPHIRE_AXE), getStack(ModItems.SAPPHIRE_HOE), getStack(ModItems.SAPPHIRE_SPADE), getStack(ModItems.SAPPHIRE_HELMET), getStack(ModItems.SAPPHIRE_CHSTPLATE), getStack(ModItems.SAPPHIRE_LEGGINGS), getStack(ModItems.SAPPHIRE_BOOTS), "gemSapphire"); @@ -111,12 +113,23 @@ public class CraftingTableRecipes extends RecipeMethods { addToolAndArmourRecipes(getStack(ModItems.BRONZE_SWORD), getStack(ModItems.BRONZE_PICKAXE), getStack(ModItems.BRONZE_AXE), getStack(ModItems.BRONZE_HOE), getStack(ModItems.BRONZE_SPADE), getStack(ModItems.BRONZE_HELMET), getStack(ModItems.BRONZE_CHESTPLATE), getStack(ModItems.BRONZE_LEGGINGS), getStack(ModItems.BRONZE_BOOTS), "ingotBronze"); } + // Battery + registerShaped(getStack(ModItems.LAPOTRONIC_ORB), "LLL", "LPL", "LLL", 'L', "lapotronCrystal", 'P', "plateIridiumAlloy"); + registerShaped(getStack(ModItems.LITHIUM_BATTERY), " C ", "PFP", "PFP", 'F', getCell("lithium"), 'P', "plateAluminum", 'C', getStack(IC2Duplicates.CABLE_IGOLD)); + + if(!IC2Duplicates.deduplicate()){ + registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond"); + registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic"); + registerShaped(getStack(ModItems.RE_BATTERY), " W ", "TRT", "TRT", 'T', "ingotTin", 'R', "dustRedstone", 'W', getStack(IC2Duplicates.CABLE_ICOPPER)); + } + //Upgrades registerShaped(ItemUpgrades.getUpgradeByName("energy_storage"), "PPP", "WBW", "PCP", 'P', "plankWood", 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic", 'B', "reBattery"); registerShaped(ItemUpgrades.getUpgradeByName("overclock"), "TTT", "WCW", 'T', getMaterial("coolant_simple", Type.PART), 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic"); registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', getMaterial("helium_coolant_triple", Type.PART), 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic"); registerShaped(ItemUpgrades.getUpgradeByName("overclock", 2), " T ", "WCW", 'T', getMaterial("nak_coolant_simple", Type.PART), 'W', getStack(IC2Duplicates.CABLE_ICOPPER), 'C', "circuitBasic"); registerShaped(ItemUpgrades.getUpgradeByName("transformer"), "GGG", "WTW", "GCG", 'G', "blockGlass", 'W', getStack(IC2Duplicates.CABLE_IGOLD), 'C', "circuitBasic", 'T', getStack(IC2Duplicates.MVT)); + registerShaped(ItemUpgrades.getUpgradeByName("superconductor"), "SOS", "CMC", "SOS", 'C', EnumCableType.SUPERCONDUCTOR.getStack(), 'M', getMaterial("highly_advanced_machine", Type.MACHINE_FRAME) , 'O', getMaterial("data_orb", Type.PART), 'S', getMaterial("enhanced_super_conductor", Type.PART)); //Machines registerShaped(getMaterial("standard", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "ingotRefinedIron", 'C', "circuitBasic", 'A', "machineBlockBasic"); @@ -194,15 +207,32 @@ public class CraftingTableRecipes extends RecipeMethods { registerShapeless(getStack(IC2Duplicates.FREQ_TRANSMITTER), getStack(IC2Duplicates.CABLE_ICOPPER), "circuitBasic"); registerShapeless(getStack(IC2Duplicates.GENERATOR), "reBattery", "machineBlockBasic", getStack(Blocks.FURNACE)); registerShaped(getStack(IC2Duplicates.WATER_MILL), "SWS", "WGW", "SWS", 'S', "stickWood", 'W', "plankWood", 'G', getStack(IC2Duplicates.GENERATOR)); - } - + + // Cables registerShaped(EnumCableType.SUPERCONDUCTOR.getStack(), "MFM", "SSS", "MFM", 'M', getMaterial("advanced_machine", Type.MACHINE_FRAME), 'S', "craftingSuperconductor", 'F', getMaterial("energy_flow_circuit", 1, Type.PART)); registerShaped(EnumCableType.SUPERCONDUCTOR.getStack(8), "MFM", "SSS", "MFM", 'M', getMaterial("advanced_machine", Type.MACHINE_FRAME), 'S', getMaterial("enhanced_super_conductor", Type.PART), 'F', getMaterial("energy_flow_circuit", 1, Type.PART)); - - registerShaped(ItemUpgrades.getUpgradeByName("superconductor"), "SOS", "CMC", "SOS", 'C', EnumCableType.SUPERCONDUCTOR.getStack(), 'M', getMaterial("highly_advanced_machine", Type.MACHINE_FRAME) , 'O', getMaterial("data_orb", Type.PART), 'S', getMaterial("enhanced_super_conductor", Type.PART)); - - + if (!IC2Duplicates.deduplicate()) { + registerShaped(getMaterial("copper", 6, Type.CABLE), "CCC", 'C', "ingotCopper"); + registerShaped(getMaterial("tin", 9, Type.CABLE), "TTT", 'T', "ingotTin"); + registerShaped(getMaterial("gold", 12, Type.CABLE), "GGG", 'G', "ingotGold"); + registerShaped(getMaterial("hv", 12, Type.CABLE), "RRR", 'R', "ingotRefinedIron"); + registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RRR", "CCC", "RRR", 'R', "itemRubber", 'C', "ingotCopper"); + registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RCR", "RCR", "RCR", 'R', "itemRubber", 'C', "ingotCopper"); + registerShapeless(getMaterial("insulatedcopper", Type.CABLE), "itemRubber", getMaterial("copper", Type.CABLE)); + registerShaped(getMaterial("insulatedgold", 4, Type.CABLE), "RRR", "RGR", "RRR", 'R', "itemRubber", 'G', "ingotGold"); + registerShapeless(getMaterial("insulatedgold", Type.CABLE), "itemRubber", "itemRubber", getMaterial("gold", Type.CABLE)); + registerShaped(getMaterial("insulatedhv", 4, Type.CABLE), "RRR", "RIR", "RRR", 'R', "itemRubber", 'I', "ingotRefinedIron"); + registerShapeless(getMaterial("insulatedhv", Type.CABLE), "itemRubber", "itemRubber", getMaterial("hv", Type.CABLE)); + registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemDiamond", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustDiamond", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemRuby", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustRuby", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "gemDiamond", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "dustDiamond", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "gemDiamond", 'G', "blockGlass"); + registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "dustDiamond", 'G', "blockGlass"); + } if (!CompatManager.isQuantumStorageLoaded) { registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', getMaterial("dataOrb", Type.PART), 'C', getMaterial("computerMonitor", Type.PART), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(IC2Duplicates.COMPRESSOR)); @@ -215,16 +245,6 @@ public class CraftingTableRecipes extends RecipeMethods { //Parts registerShaped(getMaterial("iridium_alloy", Type.INGOT), "IAI", "ADA", "IAI", 'I', "ingotIridium", 'D', "dustDiamond", 'A', "plateAdvancedAlloy"); - registerShaped(getStack(ModItems.LITHIUM_BATTERY), " C ", "PFP", "PFP", 'F', getCell("lithium"), 'P', "plateAluminum", 'C', getStack(IC2Duplicates.CABLE_IGOLD)); - - if(!IC2Duplicates.isClassicalDedupe()){ - registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond"); - registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic"); - registerShaped(getStack(ModItems.RE_BATTERY), " W ", "TRT", "TRT", 'T', "ingotTin", 'R', "dustRedstone", 'W', getStack(IC2Duplicates.CABLE_ICOPPER)); - } - - registerShaped(getStack(ModItems.LITHIUM_BATTERY_PACK), "BCB", "BPB", "B B", 'B', getStack(ModItems.LITHIUM_BATTERY), 'P', "plateAluminum", 'C', "circuitAdvanced"); - registerShaped(getStack(ModItems.LAPOTRONIC_ORB), "LLL", "LPL", "LLL", 'L', "lapotronCrystal", 'P', "plateIridiumAlloy"); registerShaped(getStack(ModItems.SCRAP_BOX), "SSS", "SSS", "SSS", 'S', getMaterial("scrap", Type.PART)); registerShaped(getMaterial("machine", Type.MACHINE_FRAME), "AAA", "A A", "AAA", 'A', "ingotRefinedIron"); registerShaped(getMaterial("advanced_machine", Type.MACHINE_FRAME), " C ", "AMA", " C ", 'A', "plateAdvancedAlloy", 'C', "plateCarbon", 'M', "machineBlockBasic"); @@ -251,25 +271,6 @@ public class CraftingTableRecipes extends RecipeMethods { registerShaped(getMaterial("super_conductor", 4, Type.PART), "CCC", "TIT", "EEE", 'E', "circuitMaster", 'C', getMaterial("heliumCoolantSimple", Type.PART), 'T', "ingotTungsten", 'I', "plateIridiumAlloy"); if (!IC2Duplicates.deduplicate()) { - registerShaped(getMaterial("copper", 6, Type.CABLE), "CCC", 'C', "ingotCopper"); - registerShaped(getMaterial("tin", 9, Type.CABLE), "TTT", 'T', "ingotTin"); - registerShaped(getMaterial("gold", 12, Type.CABLE), "GGG", 'G', "ingotGold"); - registerShaped(getMaterial("hv", 12, Type.CABLE), "RRR", 'R', "ingotRefinedIron"); - registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RRR", "CCC", "RRR", 'R', "itemRubber", 'C', "ingotCopper"); - registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RCR", "RCR", "RCR", 'R', "itemRubber", 'C', "ingotCopper"); - registerShapeless(getMaterial("insulatedcopper", Type.CABLE), "itemRubber", getMaterial("copper", Type.CABLE)); - registerShaped(getMaterial("insulatedgold", 4, Type.CABLE), "RRR", "RGR", "RRR", 'R', "itemRubber", 'G', "ingotGold"); - registerShapeless(getMaterial("insulatedgold", Type.CABLE), "itemRubber", "itemRubber", getMaterial("gold", Type.CABLE)); - registerShaped(getMaterial("insulatedhv", 4, Type.CABLE), "RRR", "RIR", "RRR", 'R', "itemRubber", 'I', "ingotRefinedIron"); - registerShapeless(getMaterial("insulatedhv", Type.CABLE), "itemRubber", "itemRubber", getMaterial("hv", Type.CABLE)); - registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemDiamond", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustDiamond", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemRuby", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 3, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustRuby", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "gemDiamond", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 6, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotSilver", 'D', "dustDiamond", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "gemDiamond", 'G', "blockGlass"); - registerShaped(getMaterial("glassfiber", 8, Type.CABLE), "GGG", "RDR", "GGG", 'R', "ingotElectrum", 'D', "dustDiamond", 'G', "blockGlass"); registerShaped(getMaterial("carbon_fiber", Type.PART), " C ", "C C", " C ", 'C', "dustCoal"); registerShaped(getMaterial("carbon_fiber", Type.PART), "CCC", "C C", "CCC", 'C', getCell("carbon")); registerShapeless(getMaterial("carbon_mesh", Type.PART), getMaterial("carbon_fiber", Type.PART), getMaterial("carbon_fiber", Type.PART)); From 8cc611192dac3019fe0aa41c03bf85289fb0ec7b Mon Sep 17 00:00:00 2001 From: drcrazy Date: Thu, 25 Apr 2019 16:40:36 +0300 Subject: [PATCH 86/86] Lapotron Crystal dedupe for #1665 --- src/main/java/techreborn/init/IC2Duplicates.java | 5 +---- .../java/techreborn/init/recipes/BlastFurnaceRecipes.java | 1 + src/main/java/techreborn/tiles/TileMatterFabricator.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/techreborn/init/IC2Duplicates.java b/src/main/java/techreborn/init/IC2Duplicates.java index 059a82c61..5f81abe1b 100644 --- a/src/main/java/techreborn/init/IC2Duplicates.java +++ b/src/main/java/techreborn/init/IC2Duplicates.java @@ -74,11 +74,8 @@ public enum IC2Duplicates { RUBBER_WOOD(new ItemStack(ModBlocks.RUBBER_LOG)), RE_BATTERY(new ItemStack(ModItems.RE_BATTERY)), ENERGY_CRYSTAL(new ItemStack(ModItems.ENERGY_CRYSTAL)), + LAPATRON_CRYSTAL(new ItemStack(ModItems.LAPOTRONIC_CRYSTAL)), - //Classical dedupes - - LAPATRON_CRYSTAL(new ItemStack(ModItems.LAPOTRONIC_CRYSTAL), true), - REFINED_IRON(ItemIngots.getIngotByName("refined_iron"), true), BASIC_MACHINE_FRAME(BlockMachineFrames.getFrameByName("basic"), true), ADVANCED_MACHINE_FRAME(BlockMachineFrames.getFrameByName("advanced"), true), diff --git a/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java b/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java index 9527af133..ebc26cef4 100644 --- a/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java +++ b/src/main/java/techreborn/init/recipes/BlastFurnaceRecipes.java @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ + package techreborn.init.recipes; import net.minecraft.init.Blocks; diff --git a/src/main/java/techreborn/tiles/TileMatterFabricator.java b/src/main/java/techreborn/tiles/TileMatterFabricator.java index 176e97f04..75670fdb3 100644 --- a/src/main/java/techreborn/tiles/TileMatterFabricator.java +++ b/src/main/java/techreborn/tiles/TileMatterFabricator.java @@ -1,4 +1,4 @@ - /* +/* * This file is part of TechReborn, licensed under the MIT License (MIT). * * Copyright (c) 2018 TechReborn