From f682142ef7811cfb6ce28c5d81804600b01911a6 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Mon, 19 Aug 2019 23:22:49 +0300 Subject: [PATCH 1/4] Fix biofuel model --- .../techreborn/models/block/fluid/{bio_fuel.json => biofuel.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/assets/techreborn/models/block/fluid/{bio_fuel.json => biofuel.json} (100%) diff --git a/src/main/resources/assets/techreborn/models/block/fluid/bio_fuel.json b/src/main/resources/assets/techreborn/models/block/fluid/biofuel.json similarity index 100% rename from src/main/resources/assets/techreborn/models/block/fluid/bio_fuel.json rename to src/main/resources/assets/techreborn/models/block/fluid/biofuel.json From 5bac19e302c1b8a5113cd07c190957af70f645c0 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Tue, 20 Aug 2019 00:01:38 +0300 Subject: [PATCH 2/4] tags for rolling machine + some REI polishing --- .../machine/tier1/WireMillBlockEntity.java | 1 - .../blocks/transformers/BlockEVTransformer.java | 1 - src/main/java/techreborn/client/gui/GuiAESU.java | 1 - .../client/gui/GuiSolidCanningMachine.java | 1 - .../java/techreborn/client/gui/GuiWireMill.java | 1 - .../compat/rei/MachineRecipeCategory.java | 14 +++++--------- .../resources/assets/techreborn/lang/en_us.json | 2 ++ .../rolling_machine/cupronickel_heating_coil.json | 2 +- .../recipes/rolling_machine/magnalium_plate.json | 2 +- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java index 0a205a11e..8ee8ee71c 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java @@ -31,7 +31,6 @@ import reborncore.client.containerBuilder.builder.ContainerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; import techreborn.blockentity.GenericMachineBlockEntity; -import techreborn.config.TechRebornConfig; import techreborn.init.ModRecipes; import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; diff --git a/src/main/java/techreborn/blocks/transformers/BlockEVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockEVTransformer.java index d61e68564..3170f22a5 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockEVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockEVTransformer.java @@ -27,7 +27,6 @@ package techreborn.blocks.transformers; import net.minecraft.block.entity.BlockEntity; import net.minecraft.world.BlockView; import techreborn.blockentity.transformers.EVTransformerBlockEntity; -import techreborn.blockentity.transformers.HVTransformerBlockEntity; /** * Created by modmuss50 on 16/03/2016. diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index bf73036e6..b006eac76 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -26,7 +26,6 @@ package techreborn.client.gui; import com.mojang.blaze3d.platform.GlStateManager; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.gui.builder.GuiBase; diff --git a/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java b/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java index 78c065bb1..9145ba931 100644 --- a/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java +++ b/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java @@ -28,7 +28,6 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import techreborn.blockentity.machine.tier1.AlloySmelterBlockEntity; import techreborn.blockentity.machine.tier1.SoildCanningMachineBlockEntity; public class GuiSolidCanningMachine extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiWireMill.java b/src/main/java/techreborn/client/gui/GuiWireMill.java index b6b268fe2..6f5909622 100644 --- a/src/main/java/techreborn/client/gui/GuiWireMill.java +++ b/src/main/java/techreborn/client/gui/GuiWireMill.java @@ -28,7 +28,6 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import techreborn.blockentity.machine.tier1.AssemblingMachineBlockEntity; import techreborn.blockentity.machine.tier1.WireMillBlockEntity; public class GuiWireMill extends GuiBase { diff --git a/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java b/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java index ff818a0cc..24dc403d8 100644 --- a/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java +++ b/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java @@ -24,7 +24,6 @@ package techreborn.compat.rei; -import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.api.RecipeCategory; @@ -32,15 +31,11 @@ import me.shedaniel.rei.api.Renderer; import me.shedaniel.rei.gui.renderers.RecipeRenderer; import me.shedaniel.rei.gui.widget.*; import me.shedaniel.rei.impl.ScreenHelper; -import me.shedaniel.rei.plugin.DefaultPlugin; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.render.GuiLighting; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; -import net.minecraft.util.math.MathHelper; import reborncore.common.crafting.RebornRecipe; import reborncore.common.crafting.RebornRecipeType; import reborncore.common.util.StringUtils; @@ -92,6 +87,7 @@ public class MachineRecipeCategory implements RecipeCate Point startPoint = new Point( bounds.getCenterX() - 41, bounds.getCenterY() - recipeLines*12 -1); List widgets = new LinkedList<>(); + widgets.add(new RecipeBaseWidget(bounds)); widgets.add(new RecipeArrowWidget(startPoint.x + 24, startPoint.y + 1, true)); int i = 0; @@ -117,15 +113,15 @@ public class MachineRecipeCategory implements RecipeCate @Override public int getDisplayHeight() { if (recipeLines == 1) { - return 36; + return 37; } else if (recipeLines == 3) { - return 90; + return 80; } else if (recipeLines == 4) { - return 110; + return 105; } - return 66; + return 60; } } diff --git a/src/main/resources/assets/techreborn/lang/en_us.json b/src/main/resources/assets/techreborn/lang/en_us.json index 8cda70985..2d7a9bfda 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.json +++ b/src/main/resources/assets/techreborn/lang/en_us.json @@ -659,6 +659,8 @@ "techreborn:scrapbox": "Scrapbox", "techreborn:vacuum_freezer": "Vacuum Freezer", "techreborn:fluid_replicator": "Fluid Replicator", + "techreborn:fusion_reactor": "Fusion Reactor", + "techreborn:rolling_machine": "Rolling Machine", "_comment26": "Fluid buckets", "item.techreborn.beryllium_bucket": "Beryllium", diff --git a/src/main/resources/data/techreborn/recipes/rolling_machine/cupronickel_heating_coil.json b/src/main/resources/data/techreborn/recipes/rolling_machine/cupronickel_heating_coil.json index 7df4cf47b..60b65b575 100644 --- a/src/main/resources/data/techreborn/recipes/rolling_machine/cupronickel_heating_coil.json +++ b/src/main/resources/data/techreborn/recipes/rolling_machine/cupronickel_heating_coil.json @@ -11,7 +11,7 @@ "item": "techreborn:nickel_ingot" }, "C": { - "item": "techreborn:copper_ingot" + "tag": "c:copper_ingot" } }, "result": { diff --git a/src/main/resources/data/techreborn/recipes/rolling_machine/magnalium_plate.json b/src/main/resources/data/techreborn/recipes/rolling_machine/magnalium_plate.json index 62f0419a5..7bc3fe81c 100644 --- a/src/main/resources/data/techreborn/recipes/rolling_machine/magnalium_plate.json +++ b/src/main/resources/data/techreborn/recipes/rolling_machine/magnalium_plate.json @@ -8,7 +8,7 @@ ], "key": { "A": { - "item": "techreborn:aluminum_ingot" + "tag": "c:aluminum_ingot" }, "M": { "item": "techreborn:magnesium_dust" From 21d77a2d7d0061e51fcdb1f520d014bd8301c89a Mon Sep 17 00:00:00 2001 From: drcrazy Date: Tue, 20 Aug 2019 02:52:16 +0300 Subject: [PATCH 3/4] Lava now works for blast furnace. Closes #1800 --- .../multiblock/IndustrialBlastFurnaceBlockEntity.java | 4 ++-- src/main/java/techreborn/multiblocks/MultiBlockCasing.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java index 2021abf3f..94ea08015 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java @@ -83,8 +83,8 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity heat += BlockMachineCasing.getHeatFromState(part.getCachedState()); } - if (world.getBlockState(location.offset(Direction.UP, 1)).getBlock().getTranslationKey().equals("blockEntity.lava") - && world.getBlockState(location.offset(Direction.UP, 2)).getBlock().getTranslationKey().equals("blockEntity.lava")) { + if (world.getBlockState(location.offset(Direction.UP, 1)).getMaterial().equals(Material.LAVA) + && world.getBlockState(location.offset(Direction.UP, 2)).getMaterial().equals(Material.LAVA)) { heat += 500; } return heat; diff --git a/src/main/java/techreborn/multiblocks/MultiBlockCasing.java b/src/main/java/techreborn/multiblocks/MultiBlockCasing.java index 7d25663f9..3a91e7212 100644 --- a/src/main/java/techreborn/multiblocks/MultiBlockCasing.java +++ b/src/main/java/techreborn/multiblocks/MultiBlockCasing.java @@ -26,6 +26,7 @@ package techreborn.multiblocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.Material; import net.minecraft.block.entity.BlockEntity; import net.minecraft.nbt.CompoundTag; import net.minecraft.util.math.BlockPos; @@ -323,10 +324,10 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase { @Override protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException { BlockState state = world.getBlockState(new BlockPos(x, y, z)); - Block block = state.getBlock(); - if (state.isAir()) { - } else if (block.getTranslationKey().equals("blockEntity.lava")) { + if (state.getMaterial().equals(Material.AIR)) { + + } else if (state.getMaterial().equals(Material.LAVA)) { hasLava = true; } else { super.isBlockGoodForInterior(world, x, y, z); From fee7d69919767d15fa64e0a6cbd986404cb3a117 Mon Sep 17 00:00:00 2001 From: drcrazy Date: Tue, 20 Aug 2019 03:44:54 +0300 Subject: [PATCH 4/4] Add heat to REI --- .../api/recipe/recipes/BlastFurnaceRecipe.java | 4 ++++ .../techreborn/compat/rei/MachineRecipeCategory.java | 12 ++++++++++++ .../techreborn/compat/rei/MachineRecipeDisplay.java | 9 +++++++++ src/main/resources/assets/techreborn/lang/en_us.json | 1 + 4 files changed, 26 insertions(+) diff --git a/src/main/java/techreborn/api/recipe/recipes/BlastFurnaceRecipe.java b/src/main/java/techreborn/api/recipe/recipes/BlastFurnaceRecipe.java index c71fb5150..a164d0163 100644 --- a/src/main/java/techreborn/api/recipe/recipes/BlastFurnaceRecipe.java +++ b/src/main/java/techreborn/api/recipe/recipes/BlastFurnaceRecipe.java @@ -39,6 +39,10 @@ public class BlastFurnaceRecipe extends RebornRecipe { public BlastFurnaceRecipe(RebornRecipeType type, Identifier name) { super(type, name); } + + public int getHeat() { + return heat; + } @Override public void deserialize(JsonObject jsonObject) { diff --git a/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java b/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java index 24dc403d8..0957ee4a9 100644 --- a/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java +++ b/src/main/java/techreborn/compat/rei/MachineRecipeCategory.java @@ -94,6 +94,7 @@ public class MachineRecipeCategory implements RecipeCate for (List inputs : machineRecipe.getInput()){ widgets.add(new SlotWidget(startPoint.x + 1, startPoint.y + 1 + (i++ * 20), Renderer.fromItemStacks(inputs), true, true, true)); } + Text energyPerTick = new TranslatableText("techreborn.jei.recipe.running.cost", "E", machineRecipe.getEnergy()); widgets.add(new LabelWidget(startPoint.x + 1, startPoint.y + 1 + (i++ * 20), energyPerTick.asFormattedString()){ @Override @@ -106,6 +107,17 @@ public class MachineRecipeCategory implements RecipeCate for (ItemStack outputs : machineRecipe.getOutput()){ widgets.add(new SlotWidget(startPoint.x + 61, startPoint.y + 1 + (i++ * 20), Renderer.fromItemStack(outputs), true, true, true)); } + + int heat = machineRecipe.getHeat(); + if (heat > 0) { + String neededHeat = heat + " " + StringUtils.t("techreborn.jei.recipe.heat"); + widgets.add(new LabelWidget(startPoint.x + 61, startPoint.y + 1 + (i++ * 20), neededHeat){ + @Override + public void render(int mouseX, int mouseY, float delta) { + font.draw(text, x - font.getStringWidth(text) / 2, y, ScreenHelper.isDarkModeEnabled() ? 0xFFBBBBBB : 0xFF404040); + } + }); + } return widgets; } diff --git a/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java b/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java index 31ef29459..9c6e48260 100644 --- a/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java +++ b/src/main/java/techreborn/compat/rei/MachineRecipeDisplay.java @@ -28,6 +28,7 @@ import me.shedaniel.rei.api.RecipeDisplay; import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; import reborncore.common.crafting.ingredient.RebornIngredient; +import techreborn.api.recipe.recipes.BlastFurnaceRecipe; import reborncore.common.crafting.RebornRecipe; import java.util.List; @@ -40,17 +41,25 @@ public class MachineRecipeDisplay implements RecipeDispl private List> inputs; private List outputs; private int energy = 0; + private int heat = 0; public MachineRecipeDisplay(R recipe) { this.recipe = recipe; this.inputs = recipe.getRebornIngredients().stream().map(RebornIngredient::getPreviewStacks).collect(Collectors.toList()); this.outputs = recipe.getOutputs(); this.energy = recipe.getPower(); + if (recipe instanceof BlastFurnaceRecipe) { + this.heat = ((BlastFurnaceRecipe) recipe).getHeat(); + } } public int getEnergy() { return energy; } + + public int getHeat() { + return heat; + } @Override public Optional getRecipeLocation() { diff --git a/src/main/resources/assets/techreborn/lang/en_us.json b/src/main/resources/assets/techreborn/lang/en_us.json index 2d7a9bfda..b0cbab78c 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.json +++ b/src/main/resources/assets/techreborn/lang/en_us.json @@ -597,6 +597,7 @@ "techreborn.jei.recipe.running.cost": "%s/t: %s", "techreborn.jei.recipe.processing.time.1": "Time: %s ticks", "techreborn.jei.recipe.processing.time.2": "(%s sec)", + "techreborn.jei.recipe.heat": "Heat", "techreborn.jei.desc.rubberSap": "In order to get sap, you need to find a rubber tree or obtain a rubber tree sapling and proceed to grow it. Once you have obtained a rubber tree, search around for little yellowish spots on the tree. If you don't see any, just wait a bit and eventually these yellow \"sap\" spots. To harvest the sap, use a treetap and use it on the log.", "techreborn.jei.desc.scrapBox": "Scrapboxes can be opened by either a simple use in hand, or by dispensers. That's right, just throw your scrapboxes into dispensers and give them a redstone signal, and boom! Random item!",