Added Distillation tower. Closes #884
This commit is contained in:
parent
4c8a9fb7e8
commit
7d7340111d
20 changed files with 826 additions and 14 deletions
|
@ -70,4 +70,5 @@ public class Reference {
|
|||
public static String compressorRecipe = I18n.translateToLocal("tile.techreborn.compressor.name");
|
||||
public static String recyclerRecipe = I18n.translateToLocal("tile.techreborn.recycler.name");
|
||||
public static String scrapboxRecipe = I18n.translateToLocal("techreborn.recipe.scrapbox");
|
||||
public static String distillationTowerRecipe = I18n.translateToLocal("techreborn.recipe.distillationtower");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class DistillationTowerRecipe extends BaseRecipe {
|
||||
|
||||
private boolean useOreDictionary = true;
|
||||
|
||||
/**
|
||||
* @param inputCells Cells with to-be-distilled ingredient
|
||||
* @param input2 Additional empty cells for output products
|
||||
* @param output1 First output product
|
||||
* @param output2 Second output product
|
||||
* @param output3 Third output product
|
||||
* @param output4 Firth output product
|
||||
* @param tickTime Number of ticks for recipe to complete
|
||||
* @param euPerTick Amount of EU consumed per tick
|
||||
*/
|
||||
public DistillationTowerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
|
||||
super(Reference.distillationTowerRecipe, tickTime, euPerTick);
|
||||
if (inputCells != null)
|
||||
addInput(inputCells);
|
||||
if (input2 != null)
|
||||
addInput(input2);
|
||||
if (output1 != null)
|
||||
addOutput(output1);
|
||||
if (output2 != null)
|
||||
addOutput(output2);
|
||||
if (output3 != null)
|
||||
addOutput(output3);
|
||||
if (output4 != null)
|
||||
addOutput(output4);
|
||||
}
|
||||
|
||||
public DistillationTowerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2,
|
||||
ItemStack output3, ItemStack output4, int tickTime, int euPerTick, boolean oreDict) {
|
||||
this(inputCells, input2, output1, output2, output3, output4, tickTime, euPerTick);
|
||||
this.useOreDictionary = oreDict;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see reborncore.api.recipe.IBaseRecipeType#getUserFreindlyName()
|
||||
*/
|
||||
@Override
|
||||
public String getUserFreindlyName() {
|
||||
return "Distillation Tower";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useOreDic() {
|
||||
return useOreDictionary;
|
||||
}
|
||||
}
|
|
@ -24,12 +24,16 @@
|
|||
|
||||
package techreborn.blocks.advanced_machine;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
import prospector.shootingstar.model.ModelCompound;
|
||||
import reborncore.api.tile.IMachineGuiHandler;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.multiblock.TileDistillationTower;
|
||||
|
||||
public class BlockDistillationTower extends BlockMachineBase {
|
||||
|
||||
|
@ -39,8 +43,18 @@ public class BlockDistillationTower extends BlockMachineBase {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World world, final int meta) {
|
||||
return new TileDistillationTower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMachineGuiHandler getGui() {
|
||||
return null;
|
||||
return EGui.DISTILLATION_TOWER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAdvanced() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public enum EGui implements IMachineGuiHandler {
|
|||
DESTRUCTOPACK(false),
|
||||
DIESEL_GENERATOR(true),
|
||||
DIGITAL_CHEST(true),
|
||||
DISTILLATION_TOWER(true),
|
||||
ELECTRIC_FURNACE(true),
|
||||
EXTRACTOR(true),
|
||||
FUSION_CONTROLLER(true),
|
||||
|
|
|
@ -156,6 +156,8 @@ public class GuiHandler implements IGuiHandler {
|
|||
return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile);
|
||||
case PLASMA_GENERATOR:
|
||||
return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile);
|
||||
case DISTILLATION_TOWER:
|
||||
return new GuiDistillationTower(player, (TileDistillationTower) tile);
|
||||
default:
|
||||
break;
|
||||
|
||||
|
|
173
src/main/java/techreborn/client/gui/GuiDistillationTower.java
Normal file
173
src/main/java/techreborn/client/gui/GuiDistillationTower.java
Normal file
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
import techreborn.tiles.multiblock.TileDistillationTower;
|
||||
|
||||
public class GuiDistillationTower extends GuiBase {
|
||||
|
||||
public TileDistillationTower tile;
|
||||
|
||||
public GuiDistillationTower(final EntityPlayer player, final TileDistillationTower tile) {
|
||||
super(player, tile, tile.createContainer(player));
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
// Battery slot
|
||||
this.drawSlot(8, 72, layer);
|
||||
// Input slots
|
||||
this.drawSlot(35, 27, layer);
|
||||
this.drawSlot(35, 47, layer);
|
||||
// Four output slots
|
||||
this.drawOutputSlotBar(78, 36, 4, layer);
|
||||
// JEI Button
|
||||
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.FOREGROUND;
|
||||
|
||||
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||
this.builder.drawMultiEnergyBar(this, 9, 19, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||
if (tile.getMutliBlock()) {
|
||||
addHologramButton(6, 4, 212, layer);
|
||||
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(this, layer);
|
||||
addHologramButton(76, 56, 212, layer);
|
||||
builder.drawHologramButton(this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
public void addHologramButton(int x, int y, int id, Layer layer) {
|
||||
if (id == 0)
|
||||
buttonList.clear();
|
||||
int factorX = 0;
|
||||
int factorY = 0;
|
||||
if (layer == Layer.BACKGROUND) {
|
||||
factorX = guiLeft;
|
||||
factorY = guiTop;
|
||||
}
|
||||
buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(final GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
if (button.id == 212) {
|
||||
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
|
||||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
IBlockState advancedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "advanced");
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "standard");
|
||||
|
||||
this.addComponent(0, 0, 0, standardCasing, multiblock);
|
||||
this.addComponent(1, 0, 0, standardCasing, multiblock);
|
||||
this.addComponent(0, 0, 1, standardCasing, multiblock);
|
||||
this.addComponent(-1, 0, 0, standardCasing, multiblock);
|
||||
this.addComponent(0, 0, -1, standardCasing, multiblock);
|
||||
this.addComponent(-1, 0, -1, standardCasing, multiblock);
|
||||
this.addComponent(-1, 0, 1, standardCasing, multiblock);
|
||||
this.addComponent(1, 0, -1, standardCasing, multiblock);
|
||||
this.addComponent(1, 0, 1, standardCasing, multiblock);
|
||||
|
||||
this.addComponent(1, 1, 0, advancedCasing, multiblock);
|
||||
this.addComponent(0, 1, 1, advancedCasing, multiblock);
|
||||
this.addComponent(-1, 1, 0, advancedCasing, multiblock);
|
||||
this.addComponent(0, 1, -1, advancedCasing, multiblock);
|
||||
this.addComponent(-1, 1, -1, advancedCasing, multiblock);
|
||||
this.addComponent(-1, 1, 1, advancedCasing, multiblock);
|
||||
this.addComponent(1, 1, -1, advancedCasing, multiblock);
|
||||
this.addComponent(1, 1, 1, advancedCasing, multiblock);
|
||||
|
||||
this.addComponent(1, 2, 0, standardCasing, multiblock);
|
||||
this.addComponent(0, 2, 1, standardCasing, multiblock);
|
||||
this.addComponent(-1, 2, 0, standardCasing, multiblock);
|
||||
this.addComponent(0, 2, -1, standardCasing, multiblock);
|
||||
this.addComponent(-1, 2, -1, standardCasing, multiblock);
|
||||
this.addComponent(-1, 2, 1, standardCasing, multiblock);
|
||||
this.addComponent(1, 2, -1, standardCasing, multiblock);
|
||||
this.addComponent(1, 2, 1, standardCasing, multiblock);
|
||||
|
||||
this.addComponent(0, 3, 0, advancedCasing, multiblock);
|
||||
this.addComponent(1, 3, 0, advancedCasing, multiblock);
|
||||
this.addComponent(0, 3, 1, advancedCasing, multiblock);
|
||||
this.addComponent(-1, 3, 0, advancedCasing, multiblock);
|
||||
this.addComponent(0, 3, -1, advancedCasing, multiblock);
|
||||
this.addComponent(-1, 3, -1, advancedCasing, multiblock);
|
||||
this.addComponent(-1, 3, 1, advancedCasing, multiblock);
|
||||
this.addComponent(1, 3, -1, advancedCasing, multiblock);
|
||||
this.addComponent(1, 3, 1, advancedCasing, multiblock);
|
||||
|
||||
final MultiblockSet set = new MultiblockSet(multiblock);
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
ClientProxy.multiblockRenderEvent.parent = this.tile.getPos();
|
||||
MultiblockRenderEvent.anchor = new BlockPos(
|
||||
this.tile.getPos().getX()
|
||||
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
|
||||
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
|
||||
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
|
||||
}
|
||||
} else {
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
|
||||
multiblock.addComponent(new BlockPos(x, y, z), blockState);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@ZenClass("mods.techreborn.distillationTower")
|
||||
public class CTDistillationTower extends CTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) CraftTweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) CraftTweakerCompat.toObject(input2);
|
||||
|
||||
DistillationTowerRecipe r = new DistillationTowerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.distillationTowerRecipe;
|
||||
}
|
||||
|
||||
}
|
|
@ -87,6 +87,7 @@ public class CraftTweakerCompat implements ICompatModule {
|
|||
CraftTweakerAPI.registerClass(CTFluidGen.class);
|
||||
CraftTweakerAPI.registerClass(CTRollingMachine.class);
|
||||
CraftTweakerAPI.registerClass(CTScrapbox.class);
|
||||
CraftTweakerAPI.registerClass(CTDistillationTower.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,6 +41,7 @@ public class RecipeCategoryUids {
|
|||
public static final String COMPRESSOR = "TechReborn.Compressor";
|
||||
public static final String SCRAPBOX = "TechReborn.Scrapbox";
|
||||
public static final String INDUSTRIAL_SAWMILL = "TechReborn.IndustrialSawmill";
|
||||
public static final String DISTILLATION_TOWER = "TechReborn.DistillationTower";
|
||||
|
||||
private RecipeCategoryUids() {
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import java.awt.*;
|
|||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class RecipeUtil {
|
||||
private static final int color = Color.darkGray.getRGB();
|
||||
|
||||
|
@ -54,7 +55,6 @@ public class RecipeUtil {
|
|||
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||
int lineSpacing = fontRenderer.FONT_HEIGHT + 1;
|
||||
|
||||
NumberFormat formatter = NumberFormat.getInstance();
|
||||
String startCostEU = PowerSystem.getLocaliszedPower(startCost);
|
||||
String startCostString = I18n.translateToLocalFormatted("techreborn.jei.recipe.start.cost", startCostEU);
|
||||
fontRenderer.drawString(startCostString, x, y, color);
|
||||
|
|
|
@ -49,6 +49,7 @@ import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
|||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.api.recipe.machines.CompressorRecipe;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
|
@ -71,6 +72,8 @@ import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeCategory;
|
|||
import techreborn.compat.jei.chemicalReactor.ChemicalReactorRecipeWrapper;
|
||||
import techreborn.compat.jei.compressor.CompressorRecipeCategory;
|
||||
import techreborn.compat.jei.compressor.CompressorRecipeWrapper;
|
||||
import techreborn.compat.jei.distillationTower.DistillationTowerRecipeCategory;
|
||||
import techreborn.compat.jei.distillationTower.DistillationTowerRecipeWrapper;
|
||||
import techreborn.compat.jei.extractor.ExtractorRecipeCategory;
|
||||
import techreborn.compat.jei.extractor.ExtractorRecipeWrapper;
|
||||
import techreborn.compat.jei.fusionReactor.FusionReactorRecipeCategory;
|
||||
|
@ -105,10 +108,10 @@ import javax.annotation.Nonnull;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class TechRebornJeiPlugin implements IModPlugin {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static void addDebugRecipes(final IModRegistry registry) {
|
||||
final ItemStack diamondBlock = new ItemStack(Blocks.DIAMOND_BLOCK);
|
||||
final ItemStack dirtBlock = new ItemStack(Blocks.DIRT);
|
||||
|
@ -139,6 +142,7 @@ public class TechRebornJeiPlugin implements IModPlugin {
|
|||
new BlastFurnaceRecipeCategory(guiHelper),
|
||||
new CentrifugeRecipeCategory(guiHelper),
|
||||
new ChemicalReactorRecipeCategory(guiHelper),
|
||||
new DistillationTowerRecipeCategory(guiHelper),
|
||||
new FusionReactorRecipeCategory(guiHelper),
|
||||
new GrinderRecipeCategory(guiHelper),
|
||||
new ImplosionCompressorRecipeCategory(guiHelper),
|
||||
|
@ -160,7 +164,6 @@ public class TechRebornJeiPlugin implements IModPlugin {
|
|||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void register(
|
||||
@Nonnull
|
||||
|
@ -241,6 +244,7 @@ public class TechRebornJeiPlugin implements IModPlugin {
|
|||
registry.handleRecipes(IndustrialSawmillRecipe.class, recipe -> new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
registry.handleRecipes(VacuumFreezerRecipe.class, recipe -> new VacuumFreezerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.VACUUM_FREEZER);
|
||||
registry.handleRecipes(ScrapboxRecipe.class, recipe -> new ScrapboxRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.SCRAPBOX);
|
||||
registry.handleRecipes(DistillationTowerRecipe.class, recipe -> new DistillationTowerRecipeWrapper(jeiHelpers, recipe), RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
registry.addRecipeHandlers(new RollingMachineRecipeHandler());
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
|
@ -298,6 +302,7 @@ public class TechRebornJeiPlugin implements IModPlugin {
|
|||
registry.addRecipeClickArea(GuiThermalGenerator.class, 150, 4, 18, 18, EFluidGenerator.THERMAL.getRecipeID());
|
||||
registry.addRecipeClickArea(GuiAlloySmelter.class, 150, 4, 18, 18, RecipeCategoryUids.ALLOY_SMELTER);
|
||||
registry.addRecipeClickArea(GuiPlasmaGenerator.class, 150, 4, 18, 18, EFluidGenerator.PLASMA.getRecipeID());
|
||||
registry.addRecipeClickArea(GuiDistillationTower.class, 150, 4, 18, 18, RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
|
||||
//OLD ONES
|
||||
registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,
|
||||
|
@ -332,6 +337,7 @@ public class TechRebornJeiPlugin implements IModPlugin {
|
|||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.INDUSTRIAL_SAWMILL), RecipeCategoryUids.INDUSTRIAL_SAWMILL);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.ROLLING_MACHINE), RecipeCategoryUids.ROLLING_MACHINE);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModItems.SCRAP_BOX), RecipeCategoryUids.SCRAPBOX);
|
||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.DISTILLATION_TOWER), RecipeCategoryUids.DISTILLATION_TOWER);
|
||||
|
||||
final IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry();
|
||||
|
||||
|
@ -372,6 +378,9 @@ public class TechRebornJeiPlugin implements IModPlugin {
|
|||
new BuiltContainerTransferInfo("compressor", RecipeCategoryUids.COMPRESSOR, 36, 1, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("industrialsawmill", RecipeCategoryUids.INDUSTRIAL_SAWMILL, 36, 2, 0, 36));
|
||||
recipeTransferRegistry.addRecipeTransferHandler(
|
||||
new BuiltContainerTransferInfo("distillationtower", RecipeCategoryUids.DISTILLATION_TOWER, 36, 2, 0, 36));
|
||||
|
||||
|
||||
if (CompatManager.isQuantumStorageLoaded) {
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.QUANTUM_CHEST));
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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.compat.jei.distillationTower;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class DistillationTowerRecipeCategory implements IRecipeCategory<DistillationTowerRecipeWrapper> {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/jei.png");
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 };
|
||||
private final IDrawable background;
|
||||
private final String title;
|
||||
|
||||
public DistillationTowerRecipeCategory(IGuiHelper guiHelper) {
|
||||
background = guiHelper.createDrawable(texture, 0, 0, 104, 62);
|
||||
title = I18n.translateToLocal("tile.techreborn:distillation_tower.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.DISTILLATION_TOWER;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull DistillationTowerRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
guiItemStacks.init(INPUT_SLOTS[0], true, 3, 12);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 3, 32);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 45, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 64, 3);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 83, 22);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[3], false, 64, 41);
|
||||
|
||||
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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.compat.jei.distillationTower;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
import techreborn.client.gui.TRBuilder;
|
||||
import techreborn.compat.jei.BaseRecipeWrapper;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class DistillationTowerRecipeWrapper extends BaseRecipeWrapper<DistillationTowerRecipe> {
|
||||
private final IDrawableAnimated progress;
|
||||
|
||||
/**
|
||||
* @param jeiHelpers JEI Helper Class
|
||||
* @param baseRecipe Distillation Tower recipe
|
||||
*/
|
||||
|
||||
public DistillationTowerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull DistillationTowerRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
IDrawableStatic progressStatic = guiHelper.createDrawable(TRBuilder.GUI_SHEET, 100, 151, 16, 10);
|
||||
int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 25, 26);
|
||||
|
||||
int y1 = 1;
|
||||
int y2 = 54;
|
||||
minecraft.fontRenderer.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2) - 40, y1, 0x444444);
|
||||
minecraft.fontRenderer.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRenderer.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2) - 40, y2, 0x444444);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -283,6 +283,7 @@ public class ModBlocks {
|
|||
|
||||
DISTILLATION_TOWER = new BlockDistillationTower();
|
||||
registerBlock(DISTILLATION_TOWER, "distillation_tower");
|
||||
GameRegistry.registerTileEntity(TileDistillationTower.class, "TileDistillationTowerTR");
|
||||
|
||||
VACUUM_FREEZER = new BlockVacuumFreezer();
|
||||
registerBlock(VACUUM_FREEZER, "vacuum_freezer");
|
||||
|
|
|
@ -77,6 +77,7 @@ public class ModRecipes {
|
|||
ScrapboxRecipes.init();
|
||||
ChemicalReactorRecipes.init();
|
||||
FusionReactorRecipes.init();
|
||||
DistillationTowerRecipes.init();
|
||||
|
||||
addAlloySmelterRecipes();
|
||||
addBlastFurnaceRecipes();
|
||||
|
|
|
@ -107,16 +107,16 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getMaterial("standard", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateAluminum", 'C', "circuitBasic", 'A', "machineBlockBasic");
|
||||
registerShaped(getMaterial("reinforced", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateSteel", 'C', "circuitAdvanced", 'A', "machineBlockAdvanced");
|
||||
registerShaped(getMaterial("reinforced", 1, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateSteel", 'C', "circuitAdvanced", 'A', getMaterial("standard", Type.MACHINE_CASING));
|
||||
registerShaped(getMaterial("advanced", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateChrome", 'C', "circuitElite", 'A', getMaterial("highly_advanced_machine", Type.MACHINE_FRAME));
|
||||
registerShaped(getMaterial("advanced", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateChrome", 'C', "circuitElite", 'A', "machineBlockElite");
|
||||
registerShaped(getMaterial("advanced", 1, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "plateChrome", 'C', "circuitElite", 'A', getMaterial("reinforced", Type.MACHINE_CASING));
|
||||
registerShapeless(getStack(IC2Duplicates.GENERATOR), "reBattery", "machineBlockBasic", getStack(Blocks.FURNACE));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateIron", 'H', getStack(ModBlocks.REINFORCED_GLASS), 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateAluminum", 'H', getStack(ModBlocks.REINFORCED_GLASS), 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateIron", 'H', "glassReinforced", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.SEMI_FLUID_GENERATOR), "III", "IHI", "CGC", 'I', "plateAluminum", 'H', "glassReinforced", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.DIESEL_GENERATOR), "III", "I I", "CGC", 'I', "ingotRefinedIron", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.DIESEL_GENERATOR), "III", "I I", "CGC", 'I', "plateAluminum", 'C', "circuitBasic", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.GAS_TURBINE), "IAI", "WGW", "IAI", 'I', "plateInvar", 'A', "circuitAdvanced", 'W', getStack(ModBlocks.WIND_MILL), 'G', getStack(ModBlocks.REINFORCED_GLASS));
|
||||
registerShaped(getStack(ModBlocks.GAS_TURBINE), "IAI", "WGW", "IAI", 'I', "plateAluminum", 'A', "circuitAdvanced", 'W', getStack(ModBlocks.WIND_MILL), 'G', getStack(ModBlocks.REINFORCED_GLASS));
|
||||
registerShaped(getStack(ModBlocks.THERMAL_GENERATOR), "III", "IRI", "CGC", 'I', "plateInvar", 'R', getStack(ModBlocks.REINFORCED_GLASS), 'G', getStack(IC2Duplicates.GENERATOR), 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.GAS_TURBINE), "IAI", "WGW", "IAI", 'I', "plateInvar", 'A', "circuitAdvanced", 'W', getStack(ModBlocks.WIND_MILL), 'G', "glassReinforced");
|
||||
registerShaped(getStack(ModBlocks.GAS_TURBINE), "IAI", "WGW", "IAI", 'I', "plateAluminum", 'A', "circuitAdvanced", 'W', getStack(ModBlocks.WIND_MILL), 'G', "glassReinforced");
|
||||
registerShaped(getStack(ModBlocks.THERMAL_GENERATOR), "III", "IRI", "CGC", 'I', "plateInvar", 'R', "glassReinforced", 'G', getStack(IC2Duplicates.GENERATOR), 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), " I ", " G ", " I ", 'I', "plateMagnalium", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), "IGI", 'I', "plateMagnalium", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.WATER_MILL), "SWS", "WGW", "SWS", 'S', "stickWood", 'W', "plankWood", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
|
@ -129,7 +129,7 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), "CHC", "HBH", "FHF", 'H', getMaterial("cupronickelHeatingCoil", Type.PART), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'F', getStack(IC2Duplicates.ELECTRICAL_FURNACE));
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'H', "craftingDiamondGrinder", 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'G', getStack(IC2Duplicates.GRINDER));
|
||||
registerShaped(getStack(ModBlocks.IMPLOSION_COMPRESSOR), "ABA", "CPC", "ABA", 'A', getMaterialObject("advancedAlloy", Type.INGOT), 'C', "circuitAdvanced", 'B', "machineBlockAdvanced", 'P', getStack(IC2Duplicates.COMPRESSOR));
|
||||
registerShaped(getStack(ModBlocks.VACUUM_FREEZER), "SPS", "CGC", "SPS", 'S', "plateSteel", 'C', "circuitAdvanced", 'G', getStack(ModBlocks.REINFORCED_GLASS), 'P', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.VACUUM_FREEZER), "SPS", "CGC", "SPS", 'S', "plateSteel", 'C', "circuitAdvanced", 'G', "glassReinforced", 'P', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.DISTILLATION_TOWER), "CMC", "PBP", "EME", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), 'M', "circuitMaster", 'B', "machineBlockAdvanced", 'C', getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), 'P', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.CHEMICAL_REACTOR), "IMI", "CPC", "IEI", 'I', "plateInvar", 'C', "circuitAdvanced", 'M', getStack(IC2Duplicates.EXTRACTOR), 'P', getStack(IC2Duplicates.COMPRESSOR), 'E', getStack(IC2Duplicates.EXTRACTOR));
|
||||
registerShaped(getStack(ModBlocks.ROLLING_MACHINE), "PCP", "MBM", "PCP", 'P', getStack(Blocks.PISTON), 'C', "circuitAdvanced", 'M', getStack(IC2Duplicates.COMPRESSOR), 'B', "machineBlockBasic");
|
||||
|
@ -150,6 +150,7 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getStack(ModBlocks.PLAYER_DETECTOR, true), " D ", "CFC", " D ", 'D', getMaterial("data_storage_circuit", Type.PART), 'C', "circuitAdvanced", 'F', getStack(ModBlocks.COMPUTER_CUBE));
|
||||
registerShaped(getStack(ModBlocks.DRAGON_EGG_SYPHON), "CTC", "PSP", "CBC", 'C', "circuitMaster", 'T', getStack(IC2Duplicates.MFE), 'P', "plateIridiumAlloy", 'S', "craftingSuperconductor", 'B', getStack(ModItems.LAPOTRONIC_ORB));
|
||||
registerShaped(getStack(ModBlocks.PLASMA_GENERATOR), "PPP", "PTP", "CGC", 'P', "plateTungstensteel", 'T', getStack(IC2Duplicates.HVT), 'C', "circuitMaster", 'G', getStack(IC2Duplicates.GENERATOR));
|
||||
registerShaped(getStack(ModBlocks.DISTILLATION_TOWER), "ICI", "PFP", "ECE", 'I', getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), 'C', "circuitMaster", 'P', "plateAluminum", 'F', "machineBlockElite", 'E', getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER));
|
||||
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registerShaped(getStack(IC2Duplicates.HVT), " H ", " M ", " H ", 'M', getStack(IC2Duplicates.MVT), 'H', getStack(IC2Duplicates.CABLE_IHV));
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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 techreborn.api.recipe.machines.DistillationTowerRecipe;
|
||||
import techreborn.items.DynamicCell;
|
||||
import techreborn.items.ItemCells;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class DistillationTowerRecipes extends RecipeMethods {
|
||||
|
||||
public static void init() {
|
||||
register(ItemCells.getCellByName("oil", 16), 1400, 13, getMaterial("diesel", 16, Type.CELL), getMaterial("sulfuricAcid", 16, Type.CELL), getMaterial("glyceryl", Type.CELL));
|
||||
}
|
||||
|
||||
static void register(ItemStack input, int ticks, int euPerTick, boolean oreDict, ItemStack... outputs) {
|
||||
ItemStack output1;
|
||||
ItemStack output2 = null;
|
||||
ItemStack output3 = null;
|
||||
ItemStack output4 = null;
|
||||
|
||||
if (outputs.length == 3) {
|
||||
output1 = outputs[0];
|
||||
output2 = outputs[1];
|
||||
output3 = outputs[2];
|
||||
} else if (outputs.length == 2) {
|
||||
output1 = outputs[0];
|
||||
output2 = outputs[1];
|
||||
} else if (outputs.length == 1) {
|
||||
output1 = outputs[0];
|
||||
} else if (outputs.length == 4) {
|
||||
output1 = outputs[0];
|
||||
output2 = outputs[1];
|
||||
output3 = outputs[2];
|
||||
output4 = outputs[3];
|
||||
} else {
|
||||
throw new InvalidParameterException("Invalid number of distillation tower outputs: " + outputs);
|
||||
}
|
||||
|
||||
int cellCount = 0;
|
||||
for (ItemStack stack : outputs) {
|
||||
if (stack.getItem() instanceof DynamicCell) {
|
||||
cellCount += stack.getCount();
|
||||
}
|
||||
}
|
||||
|
||||
if (input.getItem() instanceof DynamicCell) {
|
||||
int inputCount = input.getCount();
|
||||
if (cellCount < inputCount) {
|
||||
if (output2 == null) {
|
||||
output2 = DynamicCell.getEmptyCell(inputCount - cellCount);
|
||||
} else if (output3 == null) {
|
||||
output3 = DynamicCell.getEmptyCell(inputCount - cellCount);
|
||||
} else if (output4 == null) {
|
||||
output4 = DynamicCell.getEmptyCell(inputCount - cellCount);
|
||||
}
|
||||
}
|
||||
cellCount -= inputCount;
|
||||
}
|
||||
|
||||
if (cellCount < 0) { cellCount = 0; }
|
||||
|
||||
ItemStack cells = null;
|
||||
if (cellCount > 0) {
|
||||
if (cellCount > 64) {
|
||||
throw new InvalidParameterException("Invalid distillation tower outputs: " + outputs + "(Recipe requires > 64 cells)");
|
||||
}
|
||||
cells = DynamicCell.getEmptyCell(cellCount);
|
||||
}
|
||||
RecipeHandler.addRecipe(new DistillationTowerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict));
|
||||
}
|
||||
|
||||
static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) {
|
||||
register(input, ticks, euPerTick, true, outputs);
|
||||
}
|
||||
|
||||
}
|
|
@ -109,8 +109,6 @@ public class IndustrialCentrifugeRecipes extends RecipeMethods {
|
|||
register(getMaterial("helium", 16, Type.CELL), 10000, getMaterial("helium3", Type.CELL));
|
||||
register(getMaterial("calciumcarbonate", Type.CELL), 40, getMaterial("calcite", Type.DUST));
|
||||
register(getMaterial("sulfur", Type.CELL), 40, getMaterial("sulfur", Type.DUST));
|
||||
//TO-DO Implement Distillation tower
|
||||
register(getMaterial("oil", 4, Type.CELL), 800, getMaterial("diesel", Type.CELL));
|
||||
}
|
||||
|
||||
static void register(Object input, int ticks, boolean oreDict, ItemStack... outputs) {
|
||||
|
|
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 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.tiles.multiblock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class TileDistillationTower extends TilePowerAcceptor
|
||||
implements IToolDrop, IRecipeCrafterProvider, IInventoryProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "distillation_tower", key = "DistillationTowerMaxInput", comment = "Distillation Tower Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
@ConfigRegistry(config = "machines", category = "distillation_tower", key = "DistillationTowerMaxEnergy", comment = "Distillation Tower Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10000;
|
||||
|
||||
public Inventory inventory = new Inventory(11, "TileDistillationTower", 64, this);
|
||||
public MultiblockChecker multiblockChecker;
|
||||
public RecipeCrafter crafter;
|
||||
|
||||
public TileDistillationTower() {
|
||||
super();
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3, 4, 5 };
|
||||
this.crafter = new RecipeCrafter(Reference.distillationTowerRecipe, this, 2, 4, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
if (this.multiblockChecker == null) {
|
||||
return false;
|
||||
}
|
||||
final boolean layer0 = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.STANDARD_CASING, MultiblockChecker.ZERO_OFFSET);
|
||||
final boolean layer1 = this.multiblockChecker.checkRingY(1, 1, MultiblockChecker.ADVANCED_CASING, new BlockPos(0, 1, 0));
|
||||
final boolean layer2 = this.multiblockChecker.checkRingY(1, 1, MultiblockChecker.STANDARD_CASING, new BlockPos(0, 2, 0));
|
||||
final boolean layer3 = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.ADVANCED_CASING, new BlockPos(0, 3, 0));
|
||||
final Block centerBlock1 = this.multiblockChecker.getBlock(0, 1, 0).getBlock();
|
||||
final Block centerBlock2 = this.multiblockChecker.getBlock(0, 2, 0).getBlock();
|
||||
final boolean center1 = (centerBlock1 == Blocks.AIR);
|
||||
final boolean center2 = (centerBlock2 == Blocks.AIR);
|
||||
return layer0 && layer1 && layer2 && layer3 && center1 && center2;
|
||||
}
|
||||
|
||||
public int getProgressScaled(final int scale) {
|
||||
if (this.crafter.currentTickTime != 0) {
|
||||
return this.crafter.currentTickTime * scale / this.crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (this.multiblockChecker == null) {
|
||||
final BlockPos pos = this.getPos().offset(this.getFacing().getOpposite(), 2);
|
||||
this.multiblockChecker = new MultiblockChecker(this.world, pos);
|
||||
}
|
||||
|
||||
if (world.isRemote){ return; }
|
||||
|
||||
if (this.getMutliBlock()) {
|
||||
super.update();
|
||||
this.charge(6);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxOutput() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getBaseMaxInput() {
|
||||
return maxInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(final NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
this.crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
this.crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(final EnumFacing side) {
|
||||
return new int[] { 0, 1, 2, 3, 4, 5 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(final int index, final ItemStack itemStackIn, final EnumFacing direction) {
|
||||
return index == 0 || index == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(final int index, final ItemStack stack, final EnumFacing direction) {
|
||||
return index == 2 || index == 3 || index == 4 || index == 5;
|
||||
}
|
||||
|
||||
// IToolDrop
|
||||
@Override
|
||||
public ItemStack getToolDrop(EntityPlayer p0) {
|
||||
return new ItemStack(ModBlocks.DISTILLATION_TOWER, 1);
|
||||
}
|
||||
|
||||
// IRecipeCrafterProvider
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return this.crafter;
|
||||
}
|
||||
|
||||
// IInventoryProvider
|
||||
@Override
|
||||
public IInventory getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
// IContainerProvider
|
||||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("distillationtower").player(player.inventory).inventory().hotbar().addInventory()
|
||||
.tile(this).slot(0, 35, 27).slot(1, 35, 47).outputSlot(2, 79, 37).outputSlot(3, 99, 37)
|
||||
.outputSlot(4, 119, 37).outputSlot(5, 139, 37).energySlot(6, 8, 72).syncEnergyValue().syncCrafterValue()
|
||||
.addInventory().create(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -633,6 +633,7 @@ techreborn.recipe.lathe=Lathe Recipe
|
|||
techreborn.recipe.platecuttingmachine=Plate Cutting Machine Recipe
|
||||
techreborn.recipe.chemicalReactor=Chemical Reactor Recipe
|
||||
techreborn.recipe.implosioncompressor=Implosion Compressor
|
||||
techreborn.recipe.distillationtower=Distillation Tower Recipe
|
||||
|
||||
#Message
|
||||
techreborn.message.missingmultiblock=Incomplete Multiblock
|
||||
|
|
Loading…
Reference in a new issue