Start moving everything over to the new system

This commit is contained in:
modmuss50 2019-04-14 17:01:38 +01:00
parent 98dd01697c
commit 1dad4697ba
48 changed files with 311 additions and 1379 deletions

View file

@ -25,10 +25,8 @@
package techreborn;
import net.minecraft.block.BlockDispenser;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.MinecraftForge;
@ -38,11 +36,8 @@ import net.minecraftforge.fml.common.registry.VillagerRegistry;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.ForgeRegistries;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.multiblock.MultiblockEventHandler;
import reborncore.common.multiblock.MultiblockServerTickHandler;
import reborncore.common.registration.RegistrationManager;
@ -144,7 +139,6 @@ public class TechReborn {
proxy.postInit();
ModRecipes.postInit();
LOGGER.debug(RecipeHandler.recipeList.size() + " recipes loaded");
//todo: remove, gens localization
// for (Item item : ForgeRegistries.ITEMS.getValues()) {

View file

@ -1,49 +0,0 @@
/*
* 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.api;
/**
* This contains some static stuff used in recipes and other things
*/
public class Reference {
public static String ALLOY_SMELTER_RECIPE = "ALLOY_SMELTER_RECIPE";
public static String ASSEMBLING_MACHINE_RECIPE = "ASSEMBLING_MACHINE_RECIPE";
public static String BLAST_FURNACE_RECIPE = "BLAST_FURNACE_RECIPE";
public static String CENTRIFUGE_RECIPE = "CENTRIFUGE_RECIPE";
public static String CHEMICAL_REACTOR_RECIPE = "CHEMICAL_REACTOR_RECIPE";
public static String COMPRESSOR_RECIPE = "COMPRESSOR_RECIPE";
public static String DISTILLATION_TOWER_RECIPE = "DISTILLATION_TOWER_RECIPE";
public static String EXTRACTOR_RECIPE = "EXTRACTOR_RECIPE";
public static String GRINDER_RECIPE = "GRINDER_RECIPE";
public static String IMPLOSION_COMPRESSOR_RECIPE = "IMPLOSION_COMPRESSOR_RECIPE";
public static String INDUSTRIAL_ELECTROLYZER_RECIPE = "INDUSTRIAL_ELECTROLYZER_RECIPE";
public static String INDUSTRIAL_GRINDER_RECIPE = "INDUSTRIAL_GRINDER_RECIPE";
public static String INDUSTRIAL_SAWMILL_RECIPE = "INDUSTRIAL_SAWMILL_RECIPE";
public static String RECYCLER_RECIPE = "RECYCLER_RECIPE";
public static String SCRAPBOX_RECIPE = "SCRAPBOX_RECIPE";
public static String VACUUM_FREEZER_RECIPE = "VACUUM_FREEZER_RECIPE";
public static String FLUID_REPLICATOR_RECIPE = "FLUID_REPLICATOR_RECIPE";
}

View file

@ -31,7 +31,7 @@ import net.minecraftforge.fluids.FluidStack;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.Inventory;
import reborncore.common.util.Tank;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileFluidReplicator;
@ -53,7 +53,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
* @param outputSlots This is the list of slots that the crafting logic should look for output fluid
*/
public FluidReplicatorRecipeCrafter(TileEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
super(Reference.FLUID_REPLICATOR_RECIPE, parentTile, 1, 1, inventory, inputSlots, outputSlots);
super(ModRecipes.FLUID_REPLICATOR, parentTile, 1, 1, inventory, inputSlots, outputSlots);
}
/**
@ -92,7 +92,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
// RecipeCrafter
@Override
public void updateEntity() {
if (parentTile.getWorld().isRemote) {
if (tile.getWorld().isRemote) {
return;
}
ticksSinceLastChange++;
@ -114,7 +114,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
}
// If it has reached the recipe tick time
if (currentRecipe != null && currentTickTime >= currentNeededTicks && hasAllInputs()) {
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) parentTile;
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) tile;
// Checks to see if it can fit the output
// And fill tank with replicated fluid
if (canFit(currentRecipe.getFluid(), tileFluidReplicator.tank) && currentRecipe.onCraft(tileFluidReplicator)) {
@ -137,7 +137,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
// Increase the ticktime
currentTickTime ++;
if(currentTickTime == 1 || currentTickTime % 20 == 0 && soundHanlder != null){
soundHanlder.playSound(false, parentTile);
soundHanlder.playSound(false, tile);
}
}
}
@ -147,7 +147,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
@Override
public void updateCurrentRecipe() {
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) parentTile;
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) tile;
for (FluidReplicatorRecipe recipe : FluidReplicatorRecipeList.recipes) {
if (recipe.canCraft(tileFluidReplicator) && hasAllInputs(recipe)) {
if (!canFit(recipe.getFluid(), tileFluidReplicator.tank)) {
@ -187,7 +187,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
@Override
public boolean canCraftAgain() {
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) parentTile;
TileFluidReplicator tileFluidReplicator = (TileFluidReplicator) tile;
for (FluidReplicatorRecipe recipe : FluidReplicatorRecipeList.recipes) {
if (recipe.canCraft(tileFluidReplicator) && hasAllInputs(recipe)) {
if (!canFit(recipe.getFluid(), tileFluidReplicator.tank)) {

View file

@ -1,145 +0,0 @@
/*
* 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.api.recipe;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.common.recipes.RecipeTranslator;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.List;
/**
* Extend this to add a recipe
*/
public abstract class BaseRecipe implements IBaseRecipeType, Cloneable {
public String name;
public int tickTime;
public int euPerTick;
private ArrayList<Object> inputs;
private ArrayList<ItemStack> outputs;
private boolean oreDict = true;
public BaseRecipe(String name, int tickTime, int euPerTick) {
inputs = new ArrayList<>();
outputs = new ArrayList<>();
this.name = name;
// This adds all new recipes
this.tickTime = tickTime;
this.euPerTick = euPerTick;
}
@Override
public ItemStack getOutput(int i) {
return outputs.get(i).copy();
}
@Override
public int getOutputsSize() {
return outputs.size();
}
public void addOutput(ItemStack stack) {
if (stack == null || stack.isEmpty()) {
throw new InvalidParameterException("Output stack is null or empty");
}
outputs.add(stack);
}
@Override
public List<Object> getInputs() {
return inputs;
}
@Override
public String getRecipeName() {
return name;
}
@Override
public int tickTime() {
return tickTime;
}
@Override
public int euPerTick() {
return euPerTick;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public boolean canCraft(TileEntity tile) {
if (tile instanceof ITileRecipeHandler) {
return ((ITileRecipeHandler) tile).canCraft(tile, this);
}
return true;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public boolean onCraft(TileEntity tile) {
if (tile instanceof ITileRecipeHandler) {
return ((ITileRecipeHandler) tile).onCraft(tile, this);
}
return true;
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
public void setOreDict(boolean oreDict) {
this.oreDict = oreDict;
}
@Override
public boolean useOreDic() {
return oreDict;
}
@Override
public List<ItemStack> getOutputs() {
return outputs;
}
public void addInput(Object inuput) {
if (inuput == null) {
throw new InvalidParameterException("input is invalid!");
}
if (inuput instanceof ItemStack) {
if (((ItemStack) inuput).isEmpty()) {
throw new InvalidParameterException("input is invalid!");
}
}
if (RecipeTranslator.getStackFromObject(inuput) == null || RecipeTranslator.getStackFromObject(inuput).isEmpty()) {
throw new InvalidParameterException("Could not determin recipe input for " + inuput);
}
inputs.add(inuput);
}
}

View file

@ -1,37 +0,0 @@
/*
* 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.api.recipe;
import net.minecraft.tileentity.TileEntity;
/**
* Created by Mark on 03/04/2016.
* @param <T> descendant of BaseRecipe
*/
public interface ITileRecipeHandler<T extends BaseRecipe> {
boolean canCraft(TileEntity tile, T recipe);
boolean onCraft(TileEntity tile, T recipe);
}

View file

@ -25,11 +25,10 @@
package techreborn.api.recipe;
import net.minecraft.tileentity.TileEntity;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.crafting.Recipe;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.Inventory;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import java.util.List;
@ -46,16 +45,16 @@ public class ScrapboxRecipeCrafter extends RecipeCrafter {
* @param outputSlots Slot IDs for output
*/
public ScrapboxRecipeCrafter(TileEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
super(Reference.SCRAPBOX_RECIPE, parentTile, 1, 1, inventory, inputSlots, outputSlots);
super(ModRecipes.SCRAPBOX, parentTile, 1, 1, inventory, inputSlots, outputSlots);
}
@Override
public void updateCurrentRecipe(){
List<IBaseRecipeType> scrapboxRecipeList = RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE);
int random = parentTile.getWorld().rand.nextInt(scrapboxRecipeList.size());
List<Recipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(tile.getWorld());
int random = tile.getWorld().rand.nextInt(scrapboxRecipeList.size());
// Sets the current recipe then syncs
setCurrentRecipe(scrapboxRecipeList.get(random));
this.currentNeededTicks = Math.max((int) (currentRecipe.tickTime() * (1.0 - getSpeedMultiplier())), 1);
this.currentNeededTicks = Math.max((int) (currentRecipe.getTime() * (1.0 - getSpeedMultiplier())), 1);
this.currentTickTime = 0;
setIsActive();
}

View file

@ -1,47 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class AlloySmelterRecipe extends BaseRecipe {
public AlloySmelterRecipe(Object input1, Object input2, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.ALLOY_SMELTER_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (input2 != null)
addInput(input2);
if (output1 != null)
addOutput(output1);
}
@Override
public String getUserFreindlyName() {
return "Alloy Smelter";
}
}

View file

@ -1,47 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class AssemblingMachineRecipe extends BaseRecipe {
public AssemblingMachineRecipe(Object input1, Object input2, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.ASSEMBLING_MACHINE_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (input2 != null)
addInput(input2);
if (output1 != null)
addOutput(output1);
}
@Override
public String getUserFreindlyName() {
return "Assembling Machine";
}
}

View file

@ -1,54 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class BlastFurnaceRecipe extends BaseRecipe {
public int neededHeat;
public BlastFurnaceRecipe(Object input1, Object input2, ItemStack output1, ItemStack output2, int tickTime,
int euPerTick, int neededHeat) {
super(Reference.BLAST_FURNACE_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (input2 != null)
addInput(input2);
if (output1 != null)
addOutput(output1);
if (output2 != null)
addOutput(output2);
this.neededHeat = neededHeat;
}
@Override
public String getUserFreindlyName() {
return "Blast Furnace";
}
}

View file

@ -1,62 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class CentrifugeRecipe extends BaseRecipe {
public CentrifugeRecipe(Object input1, Object input2, ItemStack output1, ItemStack output2, ItemStack output3,
ItemStack output4, int tickTime, int euPerTick) {
super(Reference.CENTRIFUGE_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
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);
setOreDict(false);
}
public CentrifugeRecipe(Object input1, Object input2, ItemStack output1, ItemStack output2, ItemStack output3,
ItemStack output4, int tickTime, int euPerTick, boolean useOreDic) {
this(input1, input2, output1, output2, output3, output4, tickTime, euPerTick);
setOreDict(useOreDic);
}
@Override
public String getUserFreindlyName() {
return "Centrifuge";
}
}

View file

@ -1,47 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class ChemicalReactorRecipe extends BaseRecipe {
public ChemicalReactorRecipe(Object input1, Object input2, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.CHEMICAL_REACTOR_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (input2 != null)
addInput(input2);
if (output1 != null)
addOutput(output1);
}
@Override
public String getUserFreindlyName() {
return "Chemical Reactor";
}
}

View file

@ -1,45 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class CompressorRecipe extends BaseRecipe {
public CompressorRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.COMPRESSOR_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
}
@Override
public String getUserFreindlyName() {
return "Compressor";
}
}

View file

@ -1,78 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
/**
* @author drcrazy
*
*/
public class DistillationTowerRecipe extends BaseRecipe {
/**
* @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(Object inputCells, Object input2, ItemStack output1, ItemStack output2,
ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
super(Reference.DISTILLATION_TOWER_RECIPE, 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(Object inputCells, Object input2, ItemStack output1, ItemStack output2,
ItemStack output3, ItemStack output4, int tickTime, int euPerTick, boolean oreDict) {
this(inputCells, input2, output1, output2, output3, output4, tickTime, euPerTick);
setOreDict(oreDict);
}
/* (non-Javadoc)
* @see reborncore.api.recipe.IBaseRecipeType#getUserFreindlyName()
*/
@Override
public String getUserFreindlyName() {
return "Distillation Tower";
}
}

View file

@ -1,51 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class ExtractorRecipe extends BaseRecipe {
public ExtractorRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.EXTRACTOR_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
}
public ExtractorRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick, boolean useOreDic) {
this(input1, output1, tickTime, euPerTick);
setOreDict(useOreDic);
}
@Override
public String getUserFreindlyName() {
return "Extractor";
}
}

View file

@ -1,55 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class GrinderRecipe extends BaseRecipe {
public GrinderRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick) {
super(Reference.GRINDER_RECIPE, tickTime, euPerTick / 10); //Done to buff energy usage to be more in line with ic2
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
}
public GrinderRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick, boolean useOreDict) {
super(Reference.GRINDER_RECIPE, tickTime, euPerTick / 10); //Done to buff energy usage to be more in line with ic2
setOreDict(useOreDict);
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
}
@Override
public String getUserFreindlyName() {
return "Grinder";
}
}

View file

@ -1,50 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class ImplosionCompressorRecipe extends BaseRecipe {
public ImplosionCompressorRecipe(Object input1, Object input2, ItemStack output1, ItemStack output2,
int tickTime, int euPerTick) {
super(Reference.IMPLOSION_COMPRESSOR_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (input2 != null)
addInput(input2);
if (output1 != null)
addOutput(output1);
if (output2 != null)
addOutput(output2);
}
@Override
public String getUserFreindlyName() {
return "Implosion Compressor";
}
}

View file

@ -1,61 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class IndustrialElectrolyzerRecipe extends BaseRecipe {
public IndustrialElectrolyzerRecipe(Object inputCells, Object input2, ItemStack output1, ItemStack output2,
ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
super(Reference.INDUSTRIAL_ELECTROLYZER_RECIPE, 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 IndustrialElectrolyzerRecipe(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);
setOreDict(oreDict);
}
@Override
public String getUserFreindlyName() {
return "Industrial Electrolyzer";
}
}

View file

@ -1,64 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class IndustrialGrinderRecipe extends BaseRecipe {
public FluidStack fluidStack;
public IndustrialGrinderRecipe(Object input1, FluidStack fluidStack, ItemStack output1,
ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) {
super(Reference.INDUSTRIAL_GRINDER_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
if (output2 != null)
addOutput(output2);
if (output3 != null)
addOutput(output3);
if (output4 != null)
addOutput(output4);
this.fluidStack = fluidStack;
setOreDict(true);
}
public IndustrialGrinderRecipe(Object input1, FluidStack fluidStack, ItemStack output1,
ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick, boolean useOreDict) {
this(input1, fluidStack, output1, output2, output3, output4, tickTime, euPerTick);
setOreDict(useOreDict);
}
@Override
public String getUserFreindlyName() {
return "IndustrialGrinder";
}
}

View file

@ -1,71 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class IndustrialSawmillRecipe extends BaseRecipe {
public FluidStack fluidStack;
public IndustrialSawmillRecipe(ItemStack input1, FluidStack fluidStack, ItemStack output1,
ItemStack output2, ItemStack output3, int tickTime, int euPerTick) {
super(Reference.INDUSTRIAL_SAWMILL_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
if (output2 != null)
addOutput(output2);
if (output3 != null)
addOutput(output3);
this.fluidStack = fluidStack;
setOreDict(false);
}
public IndustrialSawmillRecipe(Object input1, FluidStack fluidStack, ItemStack output1,
ItemStack output2, ItemStack output3, int tickTime, int euPerTick, boolean canUseOreDict) {
super(Reference.INDUSTRIAL_SAWMILL_RECIPE, tickTime, euPerTick);
if (input1 != null)
addInput(input1);
if (output1 != null)
addOutput(output1);
if (output2 != null)
addOutput(output2);
if (output3 != null)
addOutput(output3);
this.fluidStack = fluidStack;
setOreDict(canUseOreDict);
}
@Override
public String getUserFreindlyName() {
return "Industrial Sawmill";
}
}

View file

@ -1,45 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.TechRebornAPI;
import techreborn.api.recipe.BaseRecipe;
//THIS is only here to trick JEI into showing recipes for the recycler
public class RecyclerRecipe extends BaseRecipe {
public RecyclerRecipe(ItemStack input) {
super(Reference.RECYCLER_RECIPE, 0, 0);
addInput(input);
addOutput(TechRebornAPI.subItemRetriever.getPartByName("scrap"));
}
@Override
public String getUserFreindlyName() {
return "Recycler";
}
}

View file

@ -1,47 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.TechRebornAPI;
import techreborn.api.recipe.BaseRecipe;
public class ScrapboxRecipe extends BaseRecipe {
public ScrapboxRecipe(ItemStack output, int tickTime, int euPerTick) {
super(Reference.SCRAPBOX_RECIPE, tickTime, euPerTick);
if (output != null) {
// TODO: Fix recipe
addInput(new ItemStack(TechRebornAPI.getItem("SCRAP_BOX")));
addOutput(output);
}
}
@Override
public String getUserFreindlyName() {
return "Scrapbox";
}
}

View file

@ -1,45 +0,0 @@
/*
* 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.api.recipe.machines;
import net.minecraft.item.ItemStack;
import techreborn.api.Reference;
import techreborn.api.recipe.BaseRecipe;
public class VacuumFreezerRecipe extends BaseRecipe {
public VacuumFreezerRecipe(Object input, ItemStack output, int tickTime, int euPerTick) {
super(Reference.VACUUM_FREEZER_RECIPE, tickTime, euPerTick);
if (input != null)
addInput(input);
if (output != null)
addOutput(output);
}
@Override
public String getUserFreindlyName() {
return "Vacuum Freezer";
}
}

View file

@ -0,0 +1,44 @@
package techreborn.api.recipe.recipes;
import com.google.gson.JsonObject;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.JsonUtils;
import net.minecraft.util.ResourceLocation;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeType;
import techreborn.tiles.machine.multiblock.TileIndustrialBlastFurnace;
public class BlastFurnaceRecipe extends Recipe {
int heat;
public BlastFurnaceRecipe(RecipeType type, ResourceLocation name) {
super(type, name);
}
@Override
public void deserialize(JsonObject jsonObject) {
super.deserialize(jsonObject);
heat = JsonUtils.getInt(jsonObject, "heat");
}
@Override
public void serialize(JsonObject jsonObject) {
super.serialize(jsonObject);
jsonObject.addProperty("heat", heat);
}
@Override
public boolean canCraft(final TileEntity tile) {
if (tile instanceof TileIndustrialBlastFurnace) {
final TileIndustrialBlastFurnace blastFurnace = (TileIndustrialBlastFurnace) tile;
return blastFurnace.getHeat() >= heat;
}
return false;
}
@Override
public boolean onCraft(final TileEntity tile) {
return true;
}
}

View file

@ -0,0 +1,66 @@
package techreborn.api.recipe.recipes;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeType;
import techreborn.tiles.machine.multiblock.TileIndustrialGrinder;
public class IndustrialGrinderRecipe extends Recipe {
//TODO 1.14 fluids
FluidStack fluidStack = null;
public IndustrialGrinderRecipe(RecipeType type, ResourceLocation name) {
super(type, name);
}
@Override
public boolean canCraft(final TileEntity tileEntity) {
TileIndustrialGrinder tile = (TileIndustrialGrinder) tileEntity;
if (!tile.getMultiBlock()) {
return false;
}
final FluidStack recipeFluid = fluidStack;
final FluidStack tankFluid = tile.tank.getFluid();
if (fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
return true;
}
}
return false;
}
@Override
public boolean onCraft(final TileEntity tileEntity) {
TileIndustrialGrinder tile = (TileIndustrialGrinder) tileEntity;
final FluidStack recipeFluid = fluidStack;
final FluidStack tankFluid = tile.tank.getFluid();
if (fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
if (tankFluid.amount == recipeFluid.amount) {
tile.tank.setFluid(null);
}
else {
tankFluid.amount -= recipeFluid.amount;
}
tile.syncWithAll();
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,65 @@
package techreborn.api.recipe.recipes;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeType;
import techreborn.tiles.machine.multiblock.TileIndustrialSawmill;
public class IndustrialSawmillRecipe extends Recipe {
//TODO 1.14 fluids
FluidStack fluidStack = null;
public IndustrialSawmillRecipe(RecipeType type, ResourceLocation name) {
super(type, name);
}
@Override
public boolean canCraft(TileEntity tileEntity) {
TileIndustrialSawmill tile = (TileIndustrialSawmill) tileEntity;
if (!tile.getMutliBlock()) {
return false;
}
final FluidStack recipeFluid = fluidStack;
final FluidStack tankFluid = tile.tank.getFluid();
if (fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
return true;
}
}
return false;
}
@Override
public boolean onCraft(TileEntity tileEntity) {
TileIndustrialSawmill tile = (TileIndustrialSawmill) tileEntity;
final FluidStack recipeFluid = fluidStack;
final FluidStack tankFluid = tile.tank.getFluid();
if (fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
if (tankFluid.amount == recipeFluid.amount) {
tile.tank.setFluid(null);
} else {
tankFluid.amount -= recipeFluid.amount;
}
tile.syncWithAll();
return true;
}
}
return false;
}
}

View file

@ -24,29 +24,41 @@
package techreborn.init;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeManager;
import reborncore.common.crafting.RecipeType;
import reborncore.common.registration.RebornRegister;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.GrinderRecipe;
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
import techreborn.items.ItemCells;
import techreborn.api.recipe.recipes.BlastFurnaceRecipe;
import techreborn.api.recipe.recipes.IndustrialGrinderRecipe;
import techreborn.api.recipe.recipes.IndustrialSawmillRecipe;
@RebornRegister(TechReborn.MOD_ID)
public class ModRecipes {
public static final RecipeType<Recipe> ALLOY_SMELTER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:alloy_smelter"));
public static final RecipeType<Recipe> ASSEMBLING_MACHINE = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:assembling_machine"));
public static final RecipeType<BlastFurnaceRecipe> BLAST_FURNACE = RecipeManager.newRecipeType(BlastFurnaceRecipe.class, new ResourceLocation("techreborn:blast_furnace"));
public static final RecipeType<Recipe> CENTRIFUGE = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:centrifuge"));
public static final RecipeType<Recipe> CHEMICAL_REACTOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:chemical_reactor"));
public static final RecipeType<Recipe> COMPRESSOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:compressor"));
public static final RecipeType<Recipe> DISTILLATION_TOWER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:distillation_tower"));
public static final RecipeType<Recipe> EXTRACTOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:extractor"));
public static final RecipeType<Recipe> GRINDER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:grinder"));
public static final RecipeType<Recipe> IMPLOSION_COMPRESSOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:implosion_compressor"));
public static final RecipeType<Recipe> INDUSTRIAL_ELECTROLYZER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:industrial_electrolyzer"));
public static final RecipeType<IndustrialGrinderRecipe> INDUSTRIAL_GRINDER = RecipeManager.newRecipeType(IndustrialGrinderRecipe.class, new ResourceLocation("techreborn:industrial_grinder"));
public static final RecipeType<IndustrialSawmillRecipe> INDUSTRIAL_SAWMILL = RecipeManager.newRecipeType(IndustrialSawmillRecipe.class, new ResourceLocation("techreborn:industrial_sawmill"));
public static final RecipeType<Recipe> RECYCLER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:recycler"));
public static final RecipeType<Recipe> SCRAPBOX = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:scrapbox"));
public static final RecipeType<Recipe> VACUUM_FREEZER = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:vacuum_freezer"));
public static final RecipeType<Recipe> FLUID_REPLICATOR = RecipeManager.newRecipeType(Recipe.class, new ResourceLocation("techreborn:fluid_replicator"));
@ -151,15 +163,15 @@ public class ModRecipes {
// new ItemStack(Items.DYE, 6, 15),
// 170, 19));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
new ItemStack(Blocks.COBBLESTONE),
new ItemStack(Blocks.SAND),
230, 23));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
new ItemStack(Blocks.GRAVEL),
new ItemStack(Items.FLINT),
200, 20));
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// new ItemStack(Blocks.COBBLESTONE),
// new ItemStack(Blocks.SAND),
// 230, 23));
//
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// new ItemStack(Blocks.GRAVEL),
// new ItemStack(Items.FLINT),
// 200, 20));
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// new ItemStack(Items.COAL),
@ -209,11 +221,11 @@ public class ModRecipes {
// new ItemStack(Blocks.OBSIDIAN),
// ItemDusts.getDustByName("obsidian", 4),
// 170, 19));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
new ItemStack(Items.BLAZE_ROD),
new ItemStack(Items.BLAZE_POWDER, 4),
170, 19));
//
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// new ItemStack(Items.BLAZE_ROD),
// new ItemStack(Items.BLAZE_POWDER, 4),
// 170, 19));
// if (OreUtil.doesOreExistAndValid("stoneMarble")) {
// ItemStack marbleStack = getOre("stoneMarble");
@ -231,25 +243,25 @@ public class ModRecipes {
// }
//See comments bellow, this allows the ore to go to the product when it sometimes goes straight to dust.
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
"oreCoal", new ItemStack(Items.COAL, 2),
270, 31));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
"oreDiamond", new ItemStack(Items.DIAMOND, 1),
270, 31));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
"oreEmerald", new ItemStack(Items.EMERALD, 1),
270, 31));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
"oreRedstone", new ItemStack(Items.REDSTONE, 8),
270, 31));
RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
"oreQuartz", new ItemStack(Items.QUARTZ, 2),
270, 31));
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// "oreCoal", new ItemStack(Items.COAL, 2),
// 270, 31));
//
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// "oreDiamond", new ItemStack(Items.DIAMOND, 1),
// 270, 31));
//
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// "oreEmerald", new ItemStack(Items.EMERALD, 1),
// 270, 31));
//
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// "oreRedstone", new ItemStack(Items.REDSTONE, 8),
// 270, 31));
//
// RecipeHandler.addRecipe(Reference.GRINDER_RECIPE, new GrinderRecipe(
// "oreQuartz", new ItemStack(Items.QUARTZ, 2),
// 270, 31));
// for (String oreDictionaryName : OreDictionary.getOreNames()) {
@ -294,17 +306,17 @@ public class ModRecipes {
}
static void addVacuumFreezerRecipes() {
RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE,
new VacuumFreezerRecipe(new ItemStack(Blocks.ICE, 2), new ItemStack(Blocks.PACKED_ICE), 60, 64));
// RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE,
// new VacuumFreezerRecipe(new ItemStack(Blocks.ICE, 2), new ItemStack(Blocks.PACKED_ICE), 60, 64));
// TODO: Fix recipe
// RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE, new VacuumFreezerRecipe(
// ItemIngots.getIngotByName("hot_tungstensteel"), ItemIngots.getIngotByName("tungstensteel"), 440, 64));
RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE, new VacuumFreezerRecipe(
ItemCells.getCellByName("heliumplasma"), ItemCells.getCellByName("helium"), 440, 64));
RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE,
new VacuumFreezerRecipe(ItemCells.getCellByName("water"), ItemCells.getCellByName("cell"), 60, 64));
// RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE, new VacuumFreezerRecipe(
// ItemCells.getCellByName("heliumplasma"), ItemCells.getCellByName("helium"), 440, 64));
//
// RecipeHandler.addRecipe(Reference.VACUUM_FREEZER_RECIPE,
// new VacuumFreezerRecipe(ItemCells.getCellByName("water"), ItemCells.getCellByName("cell"), 60, 64));
}

View file

@ -27,9 +27,6 @@ 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.Reference;
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
/**
* @author drcrazy
@ -61,7 +58,7 @@ public class ChemicalReactorRecipes extends RecipeMethods {
}
public static void register(ItemStack in1, ItemStack in2, ItemStack out, int tickTime, int euPerTick){
RecipeHandler.addRecipe(Reference.CHEMICAL_REACTOR_RECIPE, new ChemicalReactorRecipe(in1, in2, out, tickTime, euPerTick));
// RecipeHandler.addRecipe(Reference.CHEMICAL_REACTOR_RECIPE, new ChemicalReactorRecipe(in1, in2, out, tickTime, euPerTick));
}
public static void register (ItemStack in1, ItemStack in2, ItemStack out, int tickTime){

View file

@ -25,9 +25,6 @@
package techreborn.init.recipes;
import net.minecraft.item.ItemStack;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.DistillationTowerRecipe;
import techreborn.items.DynamicCell;
import techreborn.items.ItemCells;
@ -97,7 +94,7 @@ public class DistillationTowerRecipes extends RecipeMethods {
}
cells = DynamicCell.getEmptyCell(cellCount);
}
RecipeHandler.addRecipe(Reference.DISTILLATION_TOWER_RECIPE, new DistillationTowerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict));
// RecipeHandler.addRecipe(Reference.DISTILLATION_TOWER_RECIPE, new DistillationTowerRecipe(input, cells, output1, output2, output3, output4, ticks, euPerTick, oreDict));
}
static void register(ItemStack input, int ticks, int euPerTick, ItemStack... outputs) {

View file

@ -26,9 +26,6 @@ package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
import java.security.InvalidParameterException;
@ -77,6 +74,6 @@ public class ImplosionCompressorRecipes extends RecipeMethods {
throw new InvalidParameterException("Invalid implosion compressor darkAshes input: " + darkAshes);
}
RecipeHandler.addRecipe(Reference.IMPLOSION_COMPRESSOR_RECIPE, new ImplosionCompressorRecipe(input, getStack(Blocks.TNT, 16), output, getMaterial("dark_ashes", darkAshes, Type.DUST), 20, 32));
//RecipeHandler.addRecipe(Reference.IMPLOSION_COMPRESSOR_RECIPE, new ImplosionCompressorRecipe(input, getStack(Blocks.TNT, 16), output, getMaterial("dark_ashes", darkAshes, Type.DUST), 20, 32));
}
}

View file

@ -27,9 +27,6 @@ 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.Reference;
import techreborn.api.recipe.machines.CentrifugeRecipe;
import techreborn.items.DynamicCell;
import java.security.InvalidParameterException;
@ -174,7 +171,7 @@ public class IndustrialCentrifugeRecipes extends RecipeMethods {
}
cells = DynamicCell.getEmptyCell(cellCount);
}
RecipeHandler.addRecipe(Reference.CENTRIFUGE_RECIPE, new CentrifugeRecipe(input, cells, output1, output2, output3, output4, ticks, 5, oreDict));
//RecipeHandler.addRecipe(Reference.CENTRIFUGE_RECIPE, new CentrifugeRecipe(input, cells, output1, output2, output3, output4, ticks, 5, oreDict));
}
static void register(Object input, int ticks, ItemStack... outputs) {

View file

@ -28,9 +28,6 @@ import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ScrapboxRecipe;
import techreborn.init.TRContent;
import techreborn.items.DynamicCell;
import techreborn.utils.StackWIPHandler;
@ -216,7 +213,7 @@ public class ScrapboxRecipes extends RecipeMethods {
if(output == null || output.isEmpty()){
return;
}
RecipeHandler.addRecipe(Reference.SCRAPBOX_RECIPE, new ScrapboxRecipe(output, 20, 2));
//RecipeHandler.addRecipe(Reference.SCRAPBOX_RECIPE, new ScrapboxRecipe(output, 20, 2));
}

View file

@ -31,11 +31,10 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.crafting.Recipe;
import reborncore.common.util.WorldUtils;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import java.util.List;
@ -49,9 +48,9 @@ public class ItemScrapBox extends Item {
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
ItemStack stack = player.getHeldItemMainhand();
if (!world.isRemote) {
List<IBaseRecipeType> scrapboxRecipeList = RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE);
List<Recipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(world);
int random = world.rand.nextInt(scrapboxRecipeList.size());
ItemStack out = scrapboxRecipeList.get(random).getOutput(0);
ItemStack out = scrapboxRecipeList.get(random).getOutputs().get(0);
WorldUtils.dropItem(out, world, player.getPosition());
stack.shrink(1);
}

View file

@ -37,7 +37,7 @@ import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.items.DynamicCell;
@ -57,7 +57,7 @@ public class TileIndustrialCentrifuge extends TileGenericMachine implements ICon
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4, 5 };
this.inventory = new Inventory<>(7, "TileIndustrialCentrifuge", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.CENTRIFUGE_RECIPE, this, 2, 4, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.CENTRIFUGE, this, 2, 4, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -26,23 +26,22 @@ package techreborn.tiles.machine.iron;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import reborncore.api.IToolDrop;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.api.tile.ItemHandlerProvider;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.crafting.Recipe;
import reborncore.common.recipes.RecipeTranslator;
import reborncore.common.registration.RebornRegister;
import reborncore.common.tile.TileMachineBase;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
@ -118,21 +117,15 @@ public class TileIronAlloyFurnace extends TileMachineBase
}
}
public boolean hasAllInputs(final IBaseRecipeType recipeType) {
public boolean hasAllInputs(final Recipe recipeType) {
if (recipeType == null) {
return false;
}
for (final Object input : recipeType.getInputs()) {
for (Ingredient ingredient : recipeType.getIngredients()) {
boolean hasItem = false;
boolean useTags = 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,
useTags)) {
ItemStack stack = RecipeTranslator.getStackFromObject(input);
if (!checkSize || inventory.getStackInSlot(inputslot).getCount() >= stack.getCount()) {
hasItem = true;
}
if (ingredient.test(inventory.getStackInSlot(inputslot))) {
hasItem = true;
}
}
if (!hasItem)
@ -146,9 +139,9 @@ public class TileIronAlloyFurnace extends TileMachineBase
return false;
} else {
ItemStack itemstack = null;
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) {
for (final Recipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
if (this.hasAllInputs(recipeType)) {
itemstack = recipeType.getOutput(0);
itemstack = recipeType.getOutputs().get(0);
break;
}
}
@ -178,9 +171,9 @@ public class TileIronAlloyFurnace extends TileMachineBase
public void smeltItem() {
if (this.canSmelt()) {
ItemStack itemstack = ItemStack.EMPTY;
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) {
for (final Recipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
if (this.hasAllInputs(recipeType)) {
itemstack = recipeType.getOutput(0);
itemstack = recipeType.getOutputs().get(0);
break;
}
if (!itemstack.isEmpty()) {
@ -194,7 +187,7 @@ public class TileIronAlloyFurnace extends TileMachineBase
inventory.shrinkSlot(this.output, -itemstack.getCount());
}
for (final IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.ALLOY_SMELTER_RECIPE)) {
for (final Recipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
boolean hasAllRecipes = true;
if (this.hasAllInputs(recipeType)) {
@ -202,14 +195,11 @@ public class TileIronAlloyFurnace extends TileMachineBase
hasAllRecipes = false;
}
if (hasAllRecipes) {
for (Object input : recipeType.getInputs()) {
boolean useOreDict = input instanceof String || recipeType.useOreDic();
for (Ingredient ingredient : recipeType.getIngredients()) {
for (int inputSlot = 0; inputSlot < 2; inputSlot++) {
if (ItemUtils.isInputEqual(input, this.inventory.getStackInSlot(inputSlot), true, useOreDict)) {
if (ingredient.test(this.inventory.getStackInSlot(inputSlot))) {
int count = 1;
if (input instanceof ItemStack) {
count = RecipeTranslator.getStackFromObject(input).getCount();
}
//TODO also look into ingredient size here
inventory.shrinkSlot(inputSlot, count);
break;
}
@ -290,13 +280,9 @@ public class TileIronAlloyFurnace extends TileMachineBase
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)))
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(0).test(stack)))
.filterSlot(1, 65, 17,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true)))
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(1).test(stack)))
.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);

View file

@ -35,7 +35,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -55,7 +55,7 @@ public class TileDistillationTower extends TileGenericMachine implements IContai
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4, 5 };
this.inventory = new Inventory<>(7, "TileDistillationTower", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.DISTILLATION_TOWER_RECIPE, this, 2, 4, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.DISTILLATION_TOWER, this, 2, 4, this.inventory, inputs, outputs);
}
public boolean getMutliBlock() {

View file

@ -34,7 +34,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -54,7 +54,7 @@ public class TileImplosionCompressor extends TileGenericMachine implements ICont
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3 };
this.inventory = new Inventory<>(5, "TileImplosionCompressor", 64, this);
this.crafter = new RecipeCrafter(Reference.IMPLOSION_COMPRESSOR_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.IMPLOSION_COMPRESSOR, this, 2, 2, this.inventory, inputs, outputs);
}
public boolean getMutliBlock() {

View file

@ -40,10 +40,8 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.api.recipe.ITileRecipeHandler;
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
import techreborn.blocks.BlockMachineCasing;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.multiblocks.MultiBlockCasing;
@ -51,7 +49,7 @@ import techreborn.tiles.TileGenericMachine;
import techreborn.tiles.TileMachineCasing;
@RebornRegister(TechReborn.MOD_ID)
public class TileIndustrialBlastFurnace extends TileGenericMachine implements IContainerProvider, ITileRecipeHandler<BlastFurnaceRecipe> {
public class TileIndustrialBlastFurnace extends TileGenericMachine implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxInput", comment = "Industrial Blast Furnace Max Input (Value in EU)")
public static int maxInput = 128;
@ -66,7 +64,7 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3 };
this.inventory = new Inventory<>(5, "TileIndustrialBlastFurnace", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.BLAST_FURNACE_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.BLAST_FURNACE, this, 2, 2, this.inventory, inputs, outputs);
}
public int getHeat() {
@ -155,18 +153,4 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
.syncIntegerValue(this::getHeat, this::setHeat).addInventory().create(this);
}
// ITileRecipeHandler
@Override
public boolean canCraft(final TileEntity tile, final BlastFurnaceRecipe recipe) {
if (tile instanceof TileIndustrialBlastFurnace) {
final TileIndustrialBlastFurnace blastFurnace = (TileIndustrialBlastFurnace) tile;
return blastFurnace.getHeat() >= recipe.neededHeat;
}
return false;
}
@Override
public boolean onCraft(final TileEntity tile, final BlastFurnaceRecipe recipe) {
return true;
}
}

View file

@ -45,9 +45,7 @@ import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.Inventory;
import reborncore.common.util.Tank;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.api.recipe.ITileRecipeHandler;
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -55,7 +53,7 @@ import techreborn.tiles.TileGenericMachine;
import javax.annotation.Nullable;
@RebornRegister(TechReborn.MOD_ID)
public class TileIndustrialGrinder extends TileGenericMachine implements IContainerProvider, ITileRecipeHandler<IndustrialGrinderRecipe> {
public class TileIndustrialGrinder extends TileGenericMachine implements IContainerProvider{
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxInput", comment = "Industrial Grinder Max Input (Value in EU)")
public static int maxInput = 128;
@ -72,7 +70,7 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] {2, 3, 4, 5};
this.inventory = new Inventory<>(8, "TileIndustrialGrinder", 64, this, getInventoryAccess());
this.crafter = new RecipeCrafter(Reference.INDUSTRIAL_GRINDER_RECIPE, this, 1, 4, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_GRINDER, this, 1, 4, this.inventory, inputs, outputs);
this.tank = new Tank("TileIndustrialGrinder", TileIndustrialGrinder.TANK_CAPACITY, this);
this.ticksSinceLastChange = 0;
}
@ -155,50 +153,4 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
.syncEnergyValue().syncCrafterValue().addInventory().create(this);
}
// ITileRecipeHandler
@Override
public boolean canCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) {
if (!getMultiBlock()) {
return false;
}
final FluidStack recipeFluid = recipe.fluidStack;
final FluidStack tankFluid = tank.getFluid();
if (recipe.fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
return true;
}
}
return false;
}
@Override
public boolean onCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) {
final FluidStack recipeFluid = recipe.fluidStack;
final FluidStack tankFluid = tank.getFluid();
if (recipe.fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
if (tankFluid.amount == recipeFluid.amount) {
tank.setFluid(null);
}
else {
tankFluid.amount -= recipeFluid.amount;
}
syncWithAll();
return true;
}
}
return false;
}
}

View file

@ -45,9 +45,8 @@ import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.Inventory;
import reborncore.common.util.Tank;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.api.recipe.ITileRecipeHandler;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -55,7 +54,7 @@ import techreborn.tiles.TileGenericMachine;
import javax.annotation.Nullable;
@RebornRegister(TechReborn.MOD_ID)
public class TileIndustrialSawmill extends TileGenericMachine implements IContainerProvider, ITileRecipeHandler<IndustrialSawmillRecipe> {
public class TileIndustrialSawmill extends TileGenericMachine implements IContainerProvider {
@ConfigRegistry(config = "machines", category = "industrial_sawmill", key = "IndustrialSawmillMaxInput", comment = "Industrial Sawmill Max Input (Value in EU)")
public static int maxInput = 128;
@ -72,7 +71,7 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4 };
this.inventory = new Inventory<>(7, "TileSawmill", 64, this, getInventoryAccess());
this.crafter = new RecipeCrafter(Reference.INDUSTRIAL_SAWMILL_RECIPE, this, 1, 3, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_SAWMILL, this, 1, 3, this.inventory, inputs, outputs);
this.tank = new Tank("TileSawmill", TileIndustrialSawmill.TANK_CAPACITY, this);
this.ticksSinceLastChange = 0;
}
@ -156,49 +155,4 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
.addInventory().create(this);
}
// ITileRecipeHandler
@Override
public boolean canCraft(TileEntity tile, IndustrialSawmillRecipe recipe) {
if (!getMutliBlock()) {
return false;
}
final FluidStack recipeFluid = recipe.fluidStack;
final FluidStack tankFluid = tank.getFluid();
if (recipe.fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
return true;
}
}
return false;
}
@Override
public boolean onCraft(TileEntity tile, IndustrialSawmillRecipe recipe) {
final FluidStack recipeFluid = recipe.fluidStack;
final FluidStack tankFluid = tank.getFluid();
if (recipe.fluidStack == null) {
return true;
}
if (tankFluid == null) {
return false;
}
if (tankFluid.isFluidEqual(recipeFluid)) {
if (tankFluid.amount >= recipeFluid.amount) {
if (tankFluid.amount == recipeFluid.amount) {
tank.setFluid(null);
} else {
tankFluid.amount -= recipeFluid.amount;
}
syncWithAll();
return true;
}
}
return false;
}
}

View file

@ -34,7 +34,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -54,7 +54,7 @@ public class TileVacuumFreezer extends TileGenericMachine implements IContainerP
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new Inventory<>(3, "TileVacuumFreezer", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.VACUUM_FREEZER_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.VACUUM_FREEZER, this, 2, 1, this.inventory, inputs, outputs);
}
public boolean getMultiBlock() {

View file

@ -25,7 +25,6 @@
package techreborn.tiles.machine.tier1;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.api.recipe.RecipeHandler;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
@ -33,10 +32,8 @@ import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -54,7 +51,7 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2 };
this.inventory = new Inventory<>(4, "TileAlloySmelter", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.ALLOY_SMELTER_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.ALLOY_SMELTER, this, 2, 1, this.inventory, inputs, outputs);
}
// IContainerProvider
@ -63,13 +60,9 @@ public class TileAlloySmelter extends TileGenericMachine implements IContainerPr
return new ContainerBuilder("alloysmelter").player(player.inventory).inventory().hotbar()
.addInventory().tile(this)
.filterSlot(0, 34, 47,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isInputEqual(recipe.getInputs().get(0), stack, true, true)))
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(0).test(stack)))
.filterSlot(1, 126, 47,
stack -> RecipeHandler.recipeList.stream()
.anyMatch(recipe -> recipe instanceof AlloySmelterRecipe
&& ItemUtils.isInputEqual(recipe.getInputs().get(1), stack, true, true)))
stack -> ModRecipes.ALLOY_SMELTER.getRecipes(player.world).stream().anyMatch(recipe -> recipe.getIngredients().get(1).test(stack)))
.outputSlot(2, 80, 47).energySlot(3, 8, 72).syncEnergyValue().syncCrafterValue().addInventory()
.create(this);
}

View file

@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -51,7 +51,7 @@ public class TileAssemblingMachine extends TileGenericMachine implements IContai
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2 };
this.inventory = new Inventory<>(4, "TileAssemblingMachine", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.ASSEMBLING_MACHINE_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.ASSEMBLING_MACHINE, this, 2, 2, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -51,7 +51,7 @@ public class TileChemicalReactor extends TileGenericMachine implements IContaine
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2 };
this.inventory = new Inventory<>(4, "TileChemicalReactor", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.CHEMICAL_REACTOR_RECIPE, this, 2, 2, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.CHEMICAL_REACTOR, this, 2, 2, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -51,7 +51,7 @@ public class TileCompressor extends TileGenericMachine implements IContainerProv
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new Inventory<>(3, "TileCompressor", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.COMPRESSOR_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.COMPRESSOR, this, 2, 1, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -51,7 +51,7 @@ public class TileExtractor extends TileGenericMachine implements IContainerProvi
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new Inventory<>(3, "TileExtractor", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.EXTRACTOR_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.EXTRACTOR, this, 2, 1, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -33,7 +33,7 @@ import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.tiles.TileGenericMachine;
@ -51,7 +51,7 @@ public class TileGrinder extends TileGenericMachine implements IContainerProvide
final int[] inputs = new int[] { 0 };
final int[] outputs = new int[] { 1 };
this.inventory = new Inventory<>(3, "TileGrinder", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.GRINDER_RECIPE, this, 2, 1, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.GRINDER, this, 2, 1, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -34,7 +34,7 @@ import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import techreborn.init.TRContent;
import techreborn.init.TRTileEntities;
import techreborn.items.DynamicCell;
@ -53,7 +53,7 @@ public class TileIndustrialElectrolyzer extends TileGenericMachine implements IC
final int[] inputs = new int[] { 0, 1 };
final int[] outputs = new int[] { 2, 3, 4, 5 };
this.inventory = new Inventory<>(7, "TileIndustrialElectrolyzer", 64, this).withConfiguredAccess();
this.crafter = new RecipeCrafter(Reference.INDUSTRIAL_ELECTROLYZER_RECIPE, this, 2, 4, this.inventory, inputs, outputs);
this.crafter = new RecipeCrafter(ModRecipes.INDUSTRIAL_ELECTROLYZER, this, 2, 4, this.inventory, inputs, outputs);
}
// IContainerProvider

View file

@ -32,12 +32,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityDispenser;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.crafting.Recipe;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import techreborn.TechReborn;
import techreborn.api.Reference;
import techreborn.init.ModRecipes;
import java.util.List;
import java.util.Random;
@ -51,9 +50,9 @@ public class BehaviorDispenseScrapbox extends BehaviorDefaultDispenseItem {
@Override
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
if (dispenseScrapboxes) {
List<IBaseRecipeType> scrapboxRecipeList = RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE);
List<Recipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(source.getWorld());
int random = new Random().nextInt(scrapboxRecipeList.size());
ItemStack out = scrapboxRecipeList.get(random).getOutput(0);
ItemStack out = scrapboxRecipeList.get(random).getOutputs().get(0);
stack.split(1);
TileEntityDispenser tile = source.getBlockTileEntity();