Merge remote-tracking branch 'origin/1.14' into 1.14.4

This commit is contained in:
modmuss50 2019-08-20 14:36:55 +01:00
commit 17665e7400
14 changed files with 41 additions and 21 deletions

View file

@ -39,6 +39,10 @@ public class BlastFurnaceRecipe extends RebornRecipe {
public BlastFurnaceRecipe(RebornRecipeType<?> type, Identifier name) { public BlastFurnaceRecipe(RebornRecipeType<?> type, Identifier name) {
super(type, name); super(type, name);
} }
public int getHeat() {
return heat;
}
@Override @Override
public void deserialize(JsonObject jsonObject) { public void deserialize(JsonObject jsonObject) {

View file

@ -83,8 +83,8 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
heat += BlockMachineCasing.getHeatFromState(part.getCachedState()); heat += BlockMachineCasing.getHeatFromState(part.getCachedState());
} }
if (world.getBlockState(location.offset(Direction.UP, 1)).getBlock().getTranslationKey().equals("blockEntity.lava") if (world.getBlockState(location.offset(Direction.UP, 1)).getMaterial().equals(Material.LAVA)
&& world.getBlockState(location.offset(Direction.UP, 2)).getBlock().getTranslationKey().equals("blockEntity.lava")) { && world.getBlockState(location.offset(Direction.UP, 2)).getMaterial().equals(Material.LAVA)) {
heat += 500; heat += 500;
} }
return heat; return heat;

View file

@ -31,7 +31,6 @@ import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.recipes.RecipeCrafter; import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory; import reborncore.common.util.RebornInventory;
import techreborn.blockentity.GenericMachineBlockEntity; import techreborn.blockentity.GenericMachineBlockEntity;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModRecipes; import techreborn.init.ModRecipes;
import techreborn.init.TRBlockEntities; import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent; import techreborn.init.TRContent;

View file

@ -27,7 +27,6 @@ package techreborn.blocks.transformers;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import techreborn.blockentity.transformers.EVTransformerBlockEntity; import techreborn.blockentity.transformers.EVTransformerBlockEntity;
import techreborn.blockentity.transformers.HVTransformerBlockEntity;
/** /**
* Created by modmuss50 on 16/03/2016. * Created by modmuss50 on 16/03/2016.

View file

@ -26,7 +26,6 @@ package techreborn.client.gui;
import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.GuiBase;

View file

@ -28,7 +28,6 @@ import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.blockentity.machine.tier1.AlloySmelterBlockEntity;
import techreborn.blockentity.machine.tier1.SoildCanningMachineBlockEntity; import techreborn.blockentity.machine.tier1.SoildCanningMachineBlockEntity;
public class GuiSolidCanningMachine extends GuiBase<BuiltContainer> { public class GuiSolidCanningMachine extends GuiBase<BuiltContainer> {

View file

@ -28,7 +28,6 @@ import net.minecraft.entity.player.PlayerEntity;
import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.GuiBase;
import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.client.gui.guibuilder.GuiBuilder;
import techreborn.blockentity.machine.tier1.AssemblingMachineBlockEntity;
import techreborn.blockentity.machine.tier1.WireMillBlockEntity; import techreborn.blockentity.machine.tier1.WireMillBlockEntity;
public class GuiWireMill extends GuiBase<BuiltContainer> { public class GuiWireMill extends GuiBase<BuiltContainer> {

View file

@ -24,7 +24,6 @@
package techreborn.compat.rei; package techreborn.compat.rei;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Point;
import me.shedaniel.math.api.Rectangle; import me.shedaniel.math.api.Rectangle;
import me.shedaniel.rei.api.RecipeCategory; 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.renderers.RecipeRenderer;
import me.shedaniel.rei.gui.widget.*; import me.shedaniel.rei.gui.widget.*;
import me.shedaniel.rei.impl.ScreenHelper; 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.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import reborncore.common.crafting.RebornRecipe; import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.RebornRecipeType; import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.util.StringUtils; import reborncore.common.util.StringUtils;
@ -92,12 +87,14 @@ public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCate
Point startPoint = new Point( bounds.getCenterX() - 41, bounds.getCenterY() - recipeLines*12 -1); Point startPoint = new Point( bounds.getCenterX() - 41, bounds.getCenterY() - recipeLines*12 -1);
List<Widget> widgets = new LinkedList<>(); List<Widget> widgets = new LinkedList<>();
widgets.add(new RecipeBaseWidget(bounds));
widgets.add(new RecipeArrowWidget(startPoint.x + 24, startPoint.y + 1, true)); widgets.add(new RecipeArrowWidget(startPoint.x + 24, startPoint.y + 1, true));
int i = 0; int i = 0;
for (List<ItemStack> inputs : machineRecipe.getInput()){ for (List<ItemStack> inputs : machineRecipe.getInput()){
widgets.add(new SlotWidget(startPoint.x + 1, startPoint.y + 1 + (i++ * 20), Renderer.fromItemStacks(inputs), true, true, true)); 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()); 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()){ widgets.add(new LabelWidget(startPoint.x + 1, startPoint.y + 1 + (i++ * 20), energyPerTick.asFormattedString()){
@Override @Override
@ -110,6 +107,17 @@ public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCate
for (ItemStack outputs : machineRecipe.getOutput()){ for (ItemStack outputs : machineRecipe.getOutput()){
widgets.add(new SlotWidget(startPoint.x + 61, startPoint.y + 1 + (i++ * 20), Renderer.fromItemStack(outputs), true, true, true)); 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; return widgets;
} }
@ -117,15 +125,15 @@ public class MachineRecipeCategory<R extends RebornRecipe> implements RecipeCate
@Override @Override
public int getDisplayHeight() { public int getDisplayHeight() {
if (recipeLines == 1) { if (recipeLines == 1) {
return 36; return 37;
} }
else if (recipeLines == 3) { else if (recipeLines == 3) {
return 90; return 80;
} }
else if (recipeLines == 4) { else if (recipeLines == 4) {
return 110; return 105;
} }
return 66; return 60;
} }
} }

View file

@ -28,6 +28,7 @@ import me.shedaniel.rei.api.RecipeDisplay;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import reborncore.common.crafting.ingredient.RebornIngredient; import reborncore.common.crafting.ingredient.RebornIngredient;
import techreborn.api.recipe.recipes.BlastFurnaceRecipe;
import reborncore.common.crafting.RebornRecipe; import reborncore.common.crafting.RebornRecipe;
import java.util.List; import java.util.List;
@ -40,17 +41,25 @@ public class MachineRecipeDisplay<R extends RebornRecipe> implements RecipeDispl
private List<List<ItemStack>> inputs; private List<List<ItemStack>> inputs;
private List<ItemStack> outputs; private List<ItemStack> outputs;
private int energy = 0; private int energy = 0;
private int heat = 0;
public MachineRecipeDisplay(R recipe) { public MachineRecipeDisplay(R recipe) {
this.recipe = recipe; this.recipe = recipe;
this.inputs = recipe.getRebornIngredients().stream().map(RebornIngredient::getPreviewStacks).collect(Collectors.toList()); this.inputs = recipe.getRebornIngredients().stream().map(RebornIngredient::getPreviewStacks).collect(Collectors.toList());
this.outputs = recipe.getOutputs(); this.outputs = recipe.getOutputs();
this.energy = recipe.getPower(); this.energy = recipe.getPower();
if (recipe instanceof BlastFurnaceRecipe) {
this.heat = ((BlastFurnaceRecipe) recipe).getHeat();
}
} }
public int getEnergy() { public int getEnergy() {
return energy; return energy;
} }
public int getHeat() {
return heat;
}
@Override @Override
public Optional<Identifier> getRecipeLocation() { public Optional<Identifier> getRecipeLocation() {

View file

@ -26,6 +26,7 @@ package techreborn.multiblocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -323,10 +324,10 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
@Override @Override
protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException { protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException {
BlockState state = world.getBlockState(new BlockPos(x, y, z)); 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; hasLava = true;
} else { } else {
super.isBlockGoodForInterior(world, x, y, z); super.isBlockGoodForInterior(world, x, y, z);

View file

@ -597,6 +597,7 @@
"techreborn.jei.recipe.running.cost": "%s/t: %s", "techreborn.jei.recipe.running.cost": "%s/t: %s",
"techreborn.jei.recipe.processing.time.1": "Time: %s ticks", "techreborn.jei.recipe.processing.time.1": "Time: %s ticks",
"techreborn.jei.recipe.processing.time.2": "(%s sec)", "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.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!", "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!",
@ -659,6 +660,8 @@
"techreborn:scrapbox": "Scrapbox", "techreborn:scrapbox": "Scrapbox",
"techreborn:vacuum_freezer": "Vacuum Freezer", "techreborn:vacuum_freezer": "Vacuum Freezer",
"techreborn:fluid_replicator": "Fluid Replicator", "techreborn:fluid_replicator": "Fluid Replicator",
"techreborn:fusion_reactor": "Fusion Reactor",
"techreborn:rolling_machine": "Rolling Machine",
"_comment26": "Fluid buckets", "_comment26": "Fluid buckets",
"item.techreborn.beryllium_bucket": "Beryllium", "item.techreborn.beryllium_bucket": "Beryllium",

View file

@ -11,7 +11,7 @@
"item": "techreborn:nickel_ingot" "item": "techreborn:nickel_ingot"
}, },
"C": { "C": {
"item": "techreborn:copper_ingot" "tag": "c:copper_ingot"
} }
}, },
"result": { "result": {

View file

@ -8,7 +8,7 @@
], ],
"key": { "key": {
"A": { "A": {
"item": "techreborn:aluminum_ingot" "tag": "c:aluminum_ingot"
}, },
"M": { "M": {
"item": "techreborn:magnesium_dust" "item": "techreborn:magnesium_dust"