Fluid replicator
This commit is contained in:
parent
4645c365c2
commit
83483ce8d3
11 changed files with 343 additions and 895 deletions
|
@ -1,137 +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.fluidreplicator;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipe implements Cloneable {
|
||||
|
||||
/**
|
||||
* This is the UU matter amount that is required as input
|
||||
* <p>
|
||||
* This cannot be null
|
||||
*/
|
||||
@Nonnull
|
||||
private final int input;
|
||||
|
||||
/**
|
||||
* This is the fluid we will produce
|
||||
* <p>
|
||||
* This cannot be null
|
||||
*/
|
||||
@Nonnull
|
||||
private final Fluid output;
|
||||
|
||||
/**
|
||||
* This is the time in ticks that the recipe takes to complete
|
||||
*/
|
||||
private final int tickTime;
|
||||
|
||||
/**
|
||||
* This is the EU that charges every tick to replicate fluid.
|
||||
*/
|
||||
private final int euPerTick;
|
||||
|
||||
/**
|
||||
* @param input int Amount of UU-matter per bucket
|
||||
* @param output Fluid Fluid to replicate
|
||||
* @param tickTime int Production time for recipe
|
||||
* @param euPerTick int EU amount per tick
|
||||
*/
|
||||
public FluidReplicatorRecipe(int input, Fluid output, int tickTime, int euPerTick) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
this.tickTime = tickTime;
|
||||
this.euPerTick = euPerTick;
|
||||
}
|
||||
|
||||
public int getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
public Fluid getFluid() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public int getTickTime() {
|
||||
return tickTime;
|
||||
}
|
||||
|
||||
public int getEuTick() {
|
||||
return euPerTick;
|
||||
}
|
||||
|
||||
public List<Object> getInputs() {
|
||||
ArrayList<Object> inputs = new ArrayList<>();
|
||||
inputs.add(TRContent.Parts.UU_MATTER.getStack(input));
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public boolean useOreDic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canCraft(FluidReplicatorBlockEntity blockEntity) {
|
||||
if (!blockEntity.getMultiBlock()) {
|
||||
return false;
|
||||
}
|
||||
final BlockPos hole = blockEntity.getPos().offset(blockEntity.getFacing().getOpposite(), 2);
|
||||
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(blockEntity.getWorld().getBlockState(hole).getBlock());
|
||||
if (fluid == null) {
|
||||
return false;
|
||||
}
|
||||
if (!FluidUtils.fluidEquals(fluid, output)) {
|
||||
return false;
|
||||
}
|
||||
final Fluid tankFluid = blockEntity.tank.getFluid();
|
||||
if (tankFluid != null && !FluidUtils.fluidEquals(tankFluid, fluid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onCraft(FluidReplicatorBlockEntity blockEntity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Cloneable
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
}
|
|
@ -1,201 +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.fluidreplicator;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import io.github.prospector.silk.fluid.FluidInstance;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
|
||||
|
||||
public FluidReplicatorRecipe currentRecipe;
|
||||
int ticksSinceLastChange;
|
||||
|
||||
/**
|
||||
* RecipeCrafter for Fluid Replicator
|
||||
*
|
||||
* @param parent BlockEntity Reference to the blockEntity having this crafter
|
||||
* @param inventory Inventory reference to inventory used for crafting
|
||||
* @param inputSlots This is the list of the slots that the crafting logic should look for the input UU-Matter.
|
||||
* @param outputSlots This is the list of slots that the crafting logic should look for output fluid
|
||||
*/
|
||||
public FluidReplicatorRecipeCrafter(BlockEntity parent, RebornInventory<?> inventory, int[] inputSlots, int[] outputSlots) {
|
||||
super(ModRecipes.FLUID_REPLICATOR, parent, 1, 1, inventory, inputSlots, outputSlots);
|
||||
}
|
||||
|
||||
/**
|
||||
* FluidReplicatorRecipe version of hasAllInputs
|
||||
*/
|
||||
private boolean hasAllInputs(FluidReplicatorRecipe recipe) {
|
||||
if (recipe == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack inputStack = inventory.getInvStack(inputSlots[0]);
|
||||
if (!inputStack.isItemEqualIgnoreDamage(TRContent.Parts.UU_MATTER.getStack())) {
|
||||
return false;
|
||||
}
|
||||
if (inputStack.getCount() < recipe.getInput()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setCurrentRecipe(FluidReplicatorRecipe recipe) {
|
||||
try {
|
||||
this.currentRecipe = (FluidReplicatorRecipe) recipe.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// RecipeCrafter
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (blockEntity.getWorld().isClient) {
|
||||
return;
|
||||
}
|
||||
ticksSinceLastChange++;
|
||||
// Force a has changed every second
|
||||
if (ticksSinceLastChange >= 20) {
|
||||
setInvDirty(true);
|
||||
ticksSinceLastChange = 0;
|
||||
}
|
||||
// It will now look for new recipes.
|
||||
if (currentRecipe == null && isInvDirty()) {
|
||||
updateCurrentRecipe();
|
||||
}
|
||||
if(currentRecipe != null) {
|
||||
// If it doesn't have all the inputs reset
|
||||
if (isInvDirty() && !hasAllInputs()) {
|
||||
currentRecipe = null;
|
||||
currentTickTime = 0;
|
||||
setIsActive();
|
||||
}
|
||||
// If it has reached the recipe tick time
|
||||
if (currentRecipe != null && currentTickTime >= currentNeededTicks && hasAllInputs()) {
|
||||
FluidReplicatorBlockEntity blockEntityFluidReplicator = (FluidReplicatorBlockEntity) blockEntity;
|
||||
// Checks to see if it can fit the output
|
||||
// And fill tank with replicated fluid
|
||||
if (blockEntityFluidReplicator.tank.canFit(currentRecipe.getFluid(), 1000) && currentRecipe.onCraft(blockEntityFluidReplicator)) {
|
||||
blockEntityFluidReplicator.tank.getFluidInstance().setFluid(currentRecipe.getFluid());
|
||||
blockEntityFluidReplicator.tank.getFluidInstance().addAmount(1000);
|
||||
// This uses all the inputs
|
||||
useAllInputs();
|
||||
// Reset
|
||||
currentRecipe = null;
|
||||
currentTickTime = 0;
|
||||
updateCurrentRecipe();
|
||||
//Update active state if the blockEntity isnt going to start crafting again
|
||||
if(currentRecipe == null){
|
||||
setIsActive();
|
||||
}
|
||||
}
|
||||
} else if (currentRecipe != null && currentTickTime < currentNeededTicks) {
|
||||
// This uses the power
|
||||
if (energy.canUseEnergy(getEuPerTick(currentRecipe.getEuTick()))) {
|
||||
energy.useEnergy(getEuPerTick(currentRecipe.getEuTick()));
|
||||
// Increase the ticktime
|
||||
currentTickTime ++;
|
||||
if(currentTickTime == 1 || currentTickTime % 20 == 0 && soundHanlder != null){
|
||||
soundHanlder.playSound(false, blockEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setInvDirty(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCurrentRecipe() {
|
||||
FluidReplicatorBlockEntity blockEntityFluidReplicator = (FluidReplicatorBlockEntity) blockEntity;
|
||||
for (FluidReplicatorRecipe recipe : FluidReplicatorRecipeList.recipes) {
|
||||
if (recipe.canCraft(blockEntityFluidReplicator) && hasAllInputs(recipe)) {
|
||||
if (!blockEntityFluidReplicator.tank.canFit(recipe.getFluid(), 1000)) {
|
||||
this.currentRecipe = null;
|
||||
currentTickTime = 0;
|
||||
setIsActive();
|
||||
return;
|
||||
}
|
||||
setCurrentRecipe(recipe);
|
||||
currentNeededTicks = Math.max((int) (currentRecipe.getTickTime()* (1.0 - getSpeedMultiplier())), 1);
|
||||
currentTickTime = 0;
|
||||
setIsActive();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAllInputs() {
|
||||
if (this.currentRecipe == null) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return hasAllInputs(this.currentRecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useAllInputs() {
|
||||
if (currentRecipe == null) {
|
||||
return;
|
||||
}
|
||||
if (hasAllInputs(currentRecipe)) {
|
||||
inventory.shrinkSlot(inputSlots[0], currentRecipe.getInput());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraftAgain() {
|
||||
FluidReplicatorBlockEntity blockEntityFluidReplicator = (FluidReplicatorBlockEntity) blockEntity;
|
||||
for (FluidReplicatorRecipe recipe : FluidReplicatorRecipeList.recipes) {
|
||||
if (recipe.canCraft(blockEntityFluidReplicator) && hasAllInputs(recipe)) {
|
||||
if (!blockEntityFluidReplicator.tank.canFit(recipe.getFluid(), 1000)) {
|
||||
return false;
|
||||
}
|
||||
if (energy.getEnergy() < recipe.getEuTick()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -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.fluidreplicator;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public class FluidReplicatorRecipeList {
|
||||
|
||||
/**
|
||||
* This is the list of all the recipes
|
||||
*/
|
||||
public static ArrayList<FluidReplicatorRecipe> recipes = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Register your Fluid Replicator recipe
|
||||
*
|
||||
* @param recipe FluidReplicatorRecipe The recipe you want to add
|
||||
*/
|
||||
public static void addRecipe(FluidReplicatorRecipe recipe) {
|
||||
Validate.notNull(recipe);
|
||||
Validate.isTrue(!recipes.contains(recipe));
|
||||
Validate.validState(recipe.getInput() >= 1);
|
||||
Validate.validState(!getRecipeForFluid(recipe.getFluid()).isPresent());
|
||||
|
||||
recipes.add(recipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fluid Replicator recipe you want to remove
|
||||
*
|
||||
* @param recipe FluidReplicatorRecipe Recipe to remove
|
||||
* @return boolean true if recipe was removed from list of recipes
|
||||
*/
|
||||
public static boolean removeRecipe(FluidReplicatorRecipe recipe) {
|
||||
return recipes.remove(recipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there is a Fluid Replicator recipe for that fluid
|
||||
*
|
||||
* @param fluid Fluid Fluid to search for
|
||||
* @return FluidReplicatorRecipe Recipe for fluid provided
|
||||
*/
|
||||
public static Optional<FluidReplicatorRecipe> getRecipeForFluid(Fluid fluid) {
|
||||
return recipes.stream().filter(recipe -> FluidUtils.fluidEquals(recipe.getFluid(), fluid)).findAny();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package techreborn.api.recipe.recipes;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.crafting.RebornFluidRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
|
||||
import techreborn.utils.FluidUtils;
|
||||
|
||||
public class FluidReplicatorRecipe extends RebornFluidRecipe {
|
||||
|
||||
public FluidReplicatorRecipe(RebornRecipeType<?> type, Identifier name) {
|
||||
super(type, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tank getTank(BlockEntity be) {
|
||||
FluidReplicatorBlockEntity blockEntity = (FluidReplicatorBlockEntity) be;
|
||||
return blockEntity.getTank();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(BlockEntity be) {
|
||||
FluidReplicatorBlockEntity blockEntity = (FluidReplicatorBlockEntity) be;
|
||||
if (!blockEntity.getMultiBlock()) {
|
||||
return false;
|
||||
}
|
||||
final BlockPos hole = blockEntity.getPos().offset(blockEntity.getFacing().getOpposite(), 2);
|
||||
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(blockEntity.getWorld().getBlockState(hole).getBlock());
|
||||
if (fluid == Fluids.EMPTY) {
|
||||
return true;
|
||||
}
|
||||
if (!FluidUtils.fluidEquals(fluid, getFluidInstance().getFluid())) {
|
||||
return false;
|
||||
}
|
||||
final Fluid tankFluid = blockEntity.tank.getFluid();
|
||||
if (tankFluid != Fluids.EMPTY && !FluidUtils.fluidEquals(tankFluid, fluid)) {
|
||||
return false;
|
||||
}
|
||||
return blockEntity.tank.canFit(getFluidInstance().getFluid(), getFluidInstance().getAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(BlockEntity be) {
|
||||
FluidReplicatorBlockEntity blockEntity = (FluidReplicatorBlockEntity) be;
|
||||
if (blockEntity.tank.canFit(getFluidInstance().getFluid(), getFluidInstance().getAmount())) {
|
||||
blockEntity.tank.setFluid(getFluidInstance().getFluid());
|
||||
blockEntity.tank.getFluidInstance().addAmount(getFluidInstance().getAmount());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ import reborncore.common.util.IInventoryAccess;
|
|||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.fluidreplicator.FluidReplicatorRecipeCrafter;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.blockentity.GenericMachineBlockEntity;
|
||||
|
@ -65,9 +65,8 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
|
|||
|
||||
public FluidReplicatorBlockEntity() {
|
||||
super(TRBlockEntities.FLUID_REPLICATOR, "FluidReplicator", maxInput, maxEnergy, TRContent.Machine.FLUID_REPLICATOR.block, 3);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
this.inventory = new RebornInventory<>(4, "FluidReplicatorBlockEntity", 64, this, getInventoryAccess());
|
||||
this.crafter = new FluidReplicatorRecipeCrafter(this, this.inventory, inputs, null);
|
||||
this.crafter = new RecipeCrafter(ModRecipes.FLUID_REPLICATOR, this, 1, 0, this.inventory, new int[] {0}, null);
|
||||
this.tank = new Tank("FluidReplicatorBlockEntity", FluidReplicatorBlockEntity.TANK_CAPACITY, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,16 +28,13 @@ import net.minecraft.util.Identifier;
|
|||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import reborncore.common.crafting.RecipeManager;
|
||||
import reborncore.common.registration.RebornRegister;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.api.recipe.recipes.BlastFurnaceRecipe;
|
||||
import techreborn.api.recipe.recipes.FluidReplicatorRecipe;
|
||||
import techreborn.api.recipe.recipes.IndustrialGrinderRecipe;
|
||||
import techreborn.api.recipe.recipes.IndustrialSawmillRecipe;
|
||||
|
||||
@RebornRegister(TechReborn.MOD_ID)
|
||||
public class ModRecipes {
|
||||
|
||||
|
||||
public static final RebornRecipeType<RebornRecipe> ALLOY_SMELTER = RecipeManager.newRecipeType(RebornRecipe.class, new Identifier("techreborn:alloy_smelter"));
|
||||
public static final RebornRecipeType<RebornRecipe> ASSEMBLING_MACHINE = RecipeManager.newRecipeType(RebornRecipe.class, new Identifier("techreborn:assembling_machine"));
|
||||
public static final RebornRecipeType<BlastFurnaceRecipe> BLAST_FURNACE = RecipeManager.newRecipeType(BlastFurnaceRecipe.class, new Identifier("techreborn:blast_furnace"));
|
||||
|
@ -54,28 +51,6 @@ public class ModRecipes {
|
|||
public static final RebornRecipeType<RebornRecipe> RECYCLER = RecipeManager.newRecipeType(RebornRecipe.class, new Identifier("techreborn:recycler"));
|
||||
public static final RebornRecipeType<RebornRecipe> SCRAPBOX = RecipeManager.newRecipeType(RebornRecipe.class, new Identifier("techreborn:scrapbox"));
|
||||
public static final RebornRecipeType<RebornRecipe> VACUUM_FREEZER = RecipeManager.newRecipeType(RebornRecipe.class, new Identifier("techreborn:vacuum_freezer"));
|
||||
public static final RebornRecipeType<RebornRecipe> FLUID_REPLICATOR = RecipeManager.newRecipeType(RebornRecipe.class, new Identifier("techreborn:fluid_replicator"));
|
||||
|
||||
|
||||
|
||||
public static void init() {
|
||||
|
||||
/*
|
||||
|
||||
RollingMachineRecipes.init();
|
||||
FluidGeneratorRecipes.init();
|
||||
|
||||
IndustrialElectrolyzerRecipes.init();
|
||||
ScrapboxRecipes.init();
|
||||
|
||||
FusionReactorRecipes.init();
|
||||
|
||||
FluidReplicatorRecipes.init();
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
public static final RebornRecipeType<FluidReplicatorRecipe> FLUID_REPLICATOR = RecipeManager.newRecipeType(FluidReplicatorRecipe.class, new Identifier("techreborn:fluid_replicator"));
|
||||
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.inventory.Inventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import reborncore.common.fluid.container.GenericFluidContainer;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import reborncore.common.fluid.container.ItemFluidInfo;
|
||||
|
@ -41,6 +42,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class FluidUtils {
|
||||
|
||||
@NonNull
|
||||
public static Fluid fluidFromBlock(Block block){
|
||||
if(block instanceof FluidBlockExtensions){
|
||||
return ((FluidBlockExtensions) block).getFluid();
|
||||
|
@ -136,11 +138,11 @@ public class FluidUtils {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static boolean fluidEquals(Fluid fluid, Fluid fluid1) {
|
||||
return false;
|
||||
public static boolean fluidEquals(@NonNull Fluid fluid, @NonNull Fluid fluid1) {
|
||||
return fluid == fluid1;
|
||||
}
|
||||
|
||||
public static FluidInstance getFluidStackInContainer(ItemStack invStack) {
|
||||
public static FluidInstance getFluidStackInContainer(@NonNull ItemStack invStack) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue