distillation tower

This commit is contained in:
DrMangoTea
2023-09-17 16:10:54 +02:00
parent c1c5a17fbc
commit db1907f09e
84 changed files with 2221 additions and 106 deletions

View File

@@ -83,10 +83,11 @@ public abstract class FluidProcessingBlockEntity extends KineticBlockEntity {
protected <C extends Container> boolean matchItemlessRecipe(Recipe<C> recipe) {
if (recipe == null)
return false;
Optional<DistilleryControllerBlockEntity> basin = getController();
if (!basin.isPresent())
Optional<DistilleryControllerBlockEntity> controller = getController();
if (!controller.isPresent())
return false;
return ItemlessRecipe.match(basin.get(), recipe);
return ItemlessRecipe.match(controller.get(), recipe);
}
@@ -105,7 +106,7 @@ public abstract class FluidProcessingBlockEntity extends KineticBlockEntity {
protected abstract void onBasinRemoved();
protected Optional<DistilleryControllerBlockEntity> getController() {
public Optional<DistilleryControllerBlockEntity> getController() {
if (level == null)
return Optional.empty();
BlockEntity basinTE = level.getBlockEntity(worldPosition.below(1));

View File

@@ -0,0 +1,99 @@
package com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower;
import com.drmangotea.tfmg.content.machines.tanks.SteelTankBlock;
import com.drmangotea.tfmg.registry.TFMGBlockEntities;
import com.simibubi.create.content.equipment.wrench.IWrenchable;
import com.simibubi.create.foundation.block.IBE;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.PathComputationType;
import com.simibubi.create.AllShapes;
import com.simibubi.create.content.equipment.wrench.IWrenchable;
import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
import com.simibubi.create.foundation.block.IBE;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.FaceAttachedHorizontalDirectionalBlock;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.state.StateDefinition;
public class DistillationControllerBlock extends FaceAttachedHorizontalDirectionalBlock
implements IWrenchable, IBE<DistillationControllerBlockEntity> {
public DistillationControllerBlock(Properties properties) {
super(properties);
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
super.createBlockStateDefinition(pBuilder.add(FACE, FACING));
}
@Override
public boolean canSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) {
return canAttach(pLevel, pPos, getConnectedDirection(pState).getOpposite());
}
public static boolean canAttach(LevelReader pReader, BlockPos pPos, Direction pDirection) {
return true;
}
@Override
public void onPlace(BlockState pState, Level pLevel, BlockPos pPos, BlockState pOldState, boolean pIsMoving) {
SteelTankBlock.updateTowerState(pState, pLevel, pPos.relative(getFacing(pState).getOpposite()));
}
@Override
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean pIsMoving) {
if (state.hasBlockEntity() && (!state.is(newState.getBlock()) || !newState.hasBlockEntity()))
world.removeBlockEntity(pos);
SteelTankBlock.updateTowerState(state, world, pos.relative(getFacing(state).getOpposite()));
}
@Override
public boolean isPathfindable(BlockState state, BlockGetter reader, BlockPos pos, PathComputationType type) {
return false;
}
public static Direction getFacing(BlockState sideState) {
return getConnectedDirection(sideState);
}
@Override
public Class<DistillationControllerBlockEntity> getBlockEntityClass() {
return DistillationControllerBlockEntity.class;
}
@Override
public BlockEntityType<? extends DistillationControllerBlockEntity> getBlockEntityType() {
return TFMGBlockEntities.STEEL_DISTILLATION_CONTROLLER.get();
}
}

View File

@@ -0,0 +1,228 @@
package com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryControllerBlockEntity;
import com.drmangotea.tfmg.content.machines.tanks.SteelTankBlockEntity;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.LangBuilder;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import javax.annotation.Nullable;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Optional;
public class DistillationControllerBlockEntity extends DistilleryControllerBlockEntity implements IHaveGoggleInformation {
public WeakReference<SteelTankBlockEntity> source;
public int towerLevel =0;
public boolean hasTank = false;
public boolean isTallEnough = true;
public boolean hasMainOutput = false;
public DistillationOutputBlockEntity mainOutput;
public DistillationControllerBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}
@Override
public void tick() {
source = new WeakReference<>(null);
super.tick();
BlockEntity entityAbove = level.getBlockEntity(getBlockPos().above());
if(entityAbove instanceof DistillationOutputBlockEntity){
mainOutput = (DistillationOutputBlockEntity) entityAbove;
hasMainOutput = true;
}else {
hasMainOutput = false;
}
@Nullable
SteelTankBlockEntity tank = getTank();
if(tank==null){
hasTank=false;
towerLevel = 0;
return;
}
hasTank = true;
towerLevel = tank.tower.towerLevel;
}
@Override
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
LangBuilder mb = Lang.translate("generic.unit.millibuckets");
Lang.translate("goggles.distillation_tower.status")
.style(ChatFormatting.GRAY)
.space()
.forGoggles(tooltip, 1);
if(!hasTank) {
Lang.translate("goggles.distillation_tower.tank_not_found")
.style(ChatFormatting.DARK_RED)
.forGoggles(tooltip);
return true;
}else {
if(towerLevel<4) {
Lang.translate("goggles.distillation_tower.level", this.towerLevel)
.style(ChatFormatting.DARK_RED)
.forGoggles(tooltip, 1);
return true;
}
if(!hasMainOutput) {
Lang.translate("goggles.distillation_tower.no_outputs")
.style(ChatFormatting.DARK_RED)
.forGoggles(tooltip, 1);
return true;
}
// if(getTank().getHeight()<((DistillationOutputBlockEntity)level.getBlockEntity(getBlockPos().above())).foundOutputs*2) {
// Lang.translate("goggles.distillation_tower.not_tall_enough")
// .style(ChatFormatting.DARK_RED)
// .forGoggles(tooltip, 1);
// return true;
// }
Lang.translate("goggles.distillation_tower.level", this.towerLevel)
.style(ChatFormatting.GREEN)
.forGoggles(tooltip, 1);
Lang.translate("goggles.distillation_tower.found_outputs", this.getOutputCount())
.style(ChatFormatting.GREEN)
.space()
.forGoggles(tooltip, 1);
}
///////////////////////////////////////////
LazyOptional<IFluidHandler> handler = this.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY);
Optional<IFluidHandler> resolve = handler.resolve();
if (!resolve.isPresent())
return false;
IFluidHandler tank = resolve.get();
if (tank.getTanks() == 0)
return false;
Lang.translate("goggles.fluid_in_tank")
.style(ChatFormatting.GRAY)
.forGoggles(tooltip);
boolean isEmpty = true;
for (int i = 0; i < tank.getTanks(); i++) {
FluidStack fluidStack = tank.getFluidInTank(i);
if (fluidStack.isEmpty())
continue;
Lang.fluidName(fluidStack)
.style(ChatFormatting.GRAY)
.forGoggles(tooltip, 1);
Lang.builder()
.add(Lang.number(fluidStack.getAmount())
.add(mb)
.style(ChatFormatting.GOLD))
.text(ChatFormatting.GRAY, " / ")
.add(Lang.number(tank.getTankCapacity(i))
.add(mb)
.style(ChatFormatting.DARK_GRAY))
.forGoggles(tooltip, 1);
isEmpty = false;
}
if (tank.getTanks() > 1) {
if (isEmpty)
tooltip.remove(tooltip.size() - 1);
return true;
}
if (!isEmpty)
return true;
Lang.translate("gui.goggles.fluid_container.capacity")
.add(Lang.number(tank.getTankCapacity(0))
.add(mb)
.style(ChatFormatting.GOLD))
.style(ChatFormatting.DARK_GRAY)
.forGoggles(tooltip, 1);
return true;
}
public int getOutputCount(){
BlockPos checkedPos = this.getBlockPos().above(3);
int outputCount = 1;
for(int i = 0; i <5;i++){
if(
level.getBlockState(checkedPos).is(TFMGBlocks.STEEL_DISTILLATION_OUTPUT.get())&&
level.getBlockState(checkedPos.below()).is(TFMGBlocks.ALUMINUM_BLOCK.get())
){
outputCount++;
checkedPos = checkedPos.above(2);
continue;
}
return outputCount;
}
return outputCount;
}
public SteelTankBlockEntity getTank() {
SteelTankBlockEntity tank = source.get();
if (tank == null || tank.isRemoved()) {
if (tank != null)
source = new WeakReference<>(null);
Direction facing = DistillationControllerBlock.getFacing(getBlockState());
BlockEntity be = level.getBlockEntity(worldPosition.relative(facing.getOpposite()));
if (be instanceof SteelTankBlockEntity tankTe)
source = new WeakReference<>(tank = tankTe);
}
if (tank == null)
return null;
return (SteelTankBlockEntity) tank.getControllerBE();
}
}

View File

@@ -0,0 +1,42 @@
package com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower;
import com.drmangotea.tfmg.registry.TFMGBlockEntities;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IBE;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.PathComputationType;
public class DistillationOutputBlock extends Block implements IBE<DistillationOutputBlockEntity> {
public DistillationOutputBlock(Properties properties) {
super(properties);
}
@Override
public boolean canSurvive(BlockState state, LevelReader worldIn, BlockPos pos) {
return !AllBlocks.BASIN.has(worldIn.getBlockState(pos.below()));
}
@Override
public Class<DistillationOutputBlockEntity> getBlockEntityClass() {
return DistillationOutputBlockEntity.class;
}
@Override
public BlockEntityType<? extends DistillationOutputBlockEntity> getBlockEntityType() {
return TFMGBlockEntities.STEEL_DISTILLATION_OUTPUT.get();
}
@Override
public boolean isPathfindable(BlockState state, BlockGetter reader, BlockPos pos, PathComputationType type) {
return false;
}
}

View File

@@ -0,0 +1,393 @@
package com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryOutputBlockEntity;
import com.drmangotea.tfmg.recipes.distillation.ItemlessRecipe;
import com.drmangotea.tfmg.recipes.distillation.AdvancedDistillationRecipe;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
import com.simibubi.create.content.kinetics.press.MechanicalPressBlockEntity;
import com.simibubi.create.foundation.recipe.RecipeFinder;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Container;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.crafting.IShapedRecipe;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandler;
import org.checkerframework.checker.units.qual.C;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public class DistillationOutputBlockEntity extends DistilleryOutputBlockEntity implements IHaveGoggleInformation {
private static final Object AdvancedDistillationRecipesKey = new Object();
public int speed=3;
public int processTimer=0;
public int foundOutputs=0;
public int recipeOutputs=6;
public DistillationOutputBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}
protected <C extends Container> boolean matchItemlessRecipe(Recipe<C> recipe) {
if (recipe == null)
return false;
Optional<DistillationControllerBlockEntity> controller = getDistillationController();
if (!controller.isPresent())
return false;
return ItemlessRecipe.match2(controller.get(), recipe);
}
@Override
protected boolean updateController() {
if (level == null || level.isClientSide)
return true;
List<Recipe<?>> recipes = getMatchingRecipes();
if (recipes.isEmpty())
return true;
currentRecipe = recipes.get(0);
startProcessing();
sendData();
return true;
}
@Override
public void tick() {
super.tick();
if (level != null) {
if ((!level.isClientSide || isVirtual())) {
process();
sendData();
}
}
if (syncCooldown > 0) {
syncCooldown--;
if (syncCooldown == 0 && queuedSync)
sendData();
}
}
@Override
protected void process() {
updateController();
if (currentRecipe == null)
return;
// if((currentRecipe instanceof ShapelessRecipe))
// return;
BlockEntity above1 = level.getBlockEntity(this.getBlockPos().above(2));
BlockEntity above2 = level.getBlockEntity(this.getBlockPos().above(4));
BlockEntity above3 = level.getBlockEntity(this.getBlockPos().above(6));
BlockEntity above4 = level.getBlockEntity(this.getBlockPos().above(8));
BlockEntity above5 = level.getBlockEntity(this.getBlockPos().above(10));
Optional<DistillationControllerBlockEntity> optionalController = getDistillationController();
if (!optionalController.isPresent())
return;
foundOutputs = 1;
if(above1 instanceof DistillationOutputBlockEntity)
foundOutputs = 2;
if(above2 instanceof DistillationOutputBlockEntity) {
if(foundOutputs==2) {
foundOutputs = 3;
}else foundOutputs = 1;
}
if(above3 instanceof DistillationOutputBlockEntity) {
if(foundOutputs==3) {
foundOutputs = 4;
}else foundOutputs = 2;
}
if(above4 instanceof DistillationOutputBlockEntity) {
if(foundOutputs==4) {
foundOutputs = 5;
}else foundOutputs = 3;
}
if(above5 instanceof DistillationOutputBlockEntity) {
if(foundOutputs==5) {
foundOutputs = 6;
}else foundOutputs = 4;
}
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe)currentRecipe)>foundOutputs)
return;
FluidStack fluidInRecipe1=null;
FluidStack fluidInRecipe2=null;
FluidStack fluidInRecipe3=null;
FluidStack fluidInRecipe4=null;
FluidStack fluidInRecipe5=null;
FluidStack fluidInRecipe6=null;
fluidInRecipe1 = ((AdvancedDistillationRecipe) currentRecipe).getFirstFluidResult();
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=2)
fluidInRecipe2 = ((AdvancedDistillationRecipe) currentRecipe).getSecondFluidResult();
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=3)
fluidInRecipe3 = ((AdvancedDistillationRecipe) currentRecipe).getThirdFluidResult();
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=4)
fluidInRecipe4 = ((AdvancedDistillationRecipe) currentRecipe).getFourthFluidResult();
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=5)
fluidInRecipe5 = ((AdvancedDistillationRecipe) currentRecipe).getFifthFluidResult();
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=6)
fluidInRecipe6 = ((AdvancedDistillationRecipe) currentRecipe).getSixthFluidResult();
if(!hasIndustrialPipes(foundOutputs))
return;
//
if (fluidInRecipe1.getFluid() != this.tankInventory.getFluid().getFluid()
&& tankInventory.getFluidAmount()!=0
)
return;
if(fluidInRecipe2!=null)
if(above1 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=2)
if (fluidInRecipe2.getFluid() != (((DistillationOutputBlockEntity) above1).tankInventory.getFluid().getFluid())
&&((DistillationOutputBlockEntity) above1).tankInventory.getFluidAmount()!=0
)
return;
if(fluidInRecipe3!=null)
if(above2 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=3)
if (fluidInRecipe3.getFluid() != (((DistillationOutputBlockEntity) above2).tankInventory.getFluid().getFluid())
&&((DistillationOutputBlockEntity) above2).tankInventory.getFluidAmount()!=0
)
return;
if(fluidInRecipe4!=null)
if(above3 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=4)
if (fluidInRecipe4.getFluid() != (((DistillationOutputBlockEntity) above3).tankInventory.getFluid().getFluid())
&&((DistillationOutputBlockEntity) above3).tankInventory.getFluidAmount()!=0
)
return;
if(fluidInRecipe5!=null)
if(above4 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=5)
if (fluidInRecipe5.getFluid() != (((DistillationOutputBlockEntity) above4).tankInventory.getFluid().getFluid())
&&((DistillationOutputBlockEntity) above4).tankInventory.getFluidAmount()!=0
)
return;
if(fluidInRecipe6!=null)
if(above5 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=6)
if (fluidInRecipe6.getFluid() != (((DistillationOutputBlockEntity) above5).tankInventory.getFluid().getFluid())
&&((DistillationOutputBlockEntity) above5).tankInventory.getFluidAmount()!=0
)
return;
//
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=1)
if(tankInventory.getFluidAmount()+((AdvancedDistillationRecipe) currentRecipe).getFirstFluidResult().getAmount()>8000)
return;
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=2)
if(((DistillationOutputBlockEntity)above1).tankInventory.getFluidAmount()+((AdvancedDistillationRecipe) currentRecipe).getSecondFluidResult().getAmount()>8000)
return;
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=3)
if(((DistillationOutputBlockEntity)above2).tankInventory.getFluidAmount()+((AdvancedDistillationRecipe) currentRecipe).getThirdFluidResult().getAmount()>8000)
return;
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=4)
if(((DistillationOutputBlockEntity)above3).tankInventory.getFluidAmount()+((AdvancedDistillationRecipe) currentRecipe).getFourthFluidResult().getAmount()>8000)
return;
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=5)
if(((DistillationOutputBlockEntity)above4).tankInventory.getFluidAmount()+((AdvancedDistillationRecipe) currentRecipe).getFifthFluidResult().getAmount()>8000)
return;
if(((AdvancedDistillationRecipe) currentRecipe).getOutputCount((AdvancedDistillationRecipe) currentRecipe)>=6)
if(((DistillationOutputBlockEntity)above5).tankInventory.getFluidAmount()+((AdvancedDistillationRecipe) currentRecipe).getSixthFluidResult().getAmount()>8000)
return;
if(getDistillationController().get().getTanks().get(true).getPrimaryHandler().getFluid().getFluid() != ((AdvancedDistillationRecipe) currentRecipe).getInputFluid().getMatchingFluidStacks().get(0).getFluid())
return;
DistillationControllerBlockEntity controller = optionalController.get();
if (!controller.getTanks().get(true).isEmpty()) {
if(!level.isClientSide) {
// if(((AdvancedDistillationRecipe)currentRecipe).getInputFluid().getMatchingFluidStacks().get(0).getFluid() != TFMGFluids.HEAVY_OIL.get())
// return;
if(!controller.hasTank)
return;
if(controller.towerLevel<4)
return;
if(controller.towerLevel>=12) {
speed = 1;
} else speed=3;
if(processTimer<speed){
processTimer++;
return;
}
processTimer=0;
int desiredHeight = (foundOutputs*2)+1;
if(controller.getTank().height<desiredHeight)
return;
controller.getTanks().get(true).getPrimaryHandler().drain(((AdvancedDistillationRecipe) currentRecipe).getFluidIngredients().get(0).getRequiredAmount(), IFluidHandler.FluidAction.EXECUTE);
tankInventory.setFluid(new FluidStack(((AdvancedDistillationRecipe) currentRecipe).getFirstFluidResult().getFluid(), ((AdvancedDistillationRecipe) currentRecipe).getFirstFluidResult().getAmount() + this.tankInventory.getFluidAmount()));
if(above1 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=2)
if (((AdvancedDistillationRecipe) currentRecipe).getResults().toArray().length>1)
((DistillationOutputBlockEntity) above1).tankInventory.setFluid(new FluidStack(((AdvancedDistillationRecipe) currentRecipe).getSecondFluidResult().getFluid(), ((AdvancedDistillationRecipe) currentRecipe).getSecondFluidResult().getAmount() + ((DistillationOutputBlockEntity) above1).tankInventory.getFluidAmount()));
if(above2 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=3)
if (((AdvancedDistillationRecipe) currentRecipe).getResults().toArray().length>2)
((DistillationOutputBlockEntity) above2).tankInventory.setFluid(new FluidStack(((AdvancedDistillationRecipe) currentRecipe).getThirdFluidResult().getFluid(), ((AdvancedDistillationRecipe) currentRecipe).getThirdFluidResult().getAmount() + ((DistillationOutputBlockEntity) above2).tankInventory.getFluidAmount()));
if(above3 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=4)
if (((AdvancedDistillationRecipe) currentRecipe).getResults().toArray().length>3)
((DistillationOutputBlockEntity) above3).tankInventory.setFluid(new FluidStack(((AdvancedDistillationRecipe) currentRecipe).getFourthFluidResult().getFluid(), ((AdvancedDistillationRecipe) currentRecipe).getFourthFluidResult().getAmount() + ((DistillationOutputBlockEntity) above3).tankInventory.getFluidAmount()));
if(above4 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=5)
if (((AdvancedDistillationRecipe) currentRecipe).getResults().toArray().length>4)
((DistillationOutputBlockEntity) above4).tankInventory.setFluid(new FluidStack(((AdvancedDistillationRecipe) currentRecipe).getFifthFluidResult().getFluid(), ((AdvancedDistillationRecipe) currentRecipe).getFifthFluidResult().getAmount() + ((DistillationOutputBlockEntity) above4).tankInventory.getFluidAmount()));
if(above5 instanceof DistillationOutputBlockEntity)
if(foundOutputs>=6)
if (((AdvancedDistillationRecipe) currentRecipe).getResults().toArray().length>5)
((DistillationOutputBlockEntity) above5).tankInventory.setFluid(new FluidStack(((AdvancedDistillationRecipe) currentRecipe).getSixthFluidResult().getFluid(), ((AdvancedDistillationRecipe) currentRecipe).getSixthFluidResult().getAmount() + ((DistillationOutputBlockEntity) above5).tankInventory.getFluidAmount()));
}
/*
if(!(((AdvancedDistillationRecipe) currentRecipe).getThirdItemResult().isEmpty()))
controller.outputInventory.setItem(2,((AdvancedDistillationRecipe) currentRecipe).getFirstItemResult());
*/
controller.notifyChangeOfContents();
}
}
@Override
protected List<Recipe<?>> getMatchingRecipes() {
List<Recipe<?>> list = RecipeFinder.get(getRecipeCacheKey(), level, this::matchStaticFilters);
return list.stream()
.filter(this::matchItemlessRecipe)
.sorted((r1, r2) -> r2.getIngredients()
.size()
- r1.getIngredients()
.size())
.collect(Collectors.toList());
}
@Override
protected <C extends Container> boolean matchStaticFilters(Recipe<C> r) {
return ((r instanceof CraftingRecipe && !(r instanceof IShapedRecipe<?>)
&& r.getIngredients()
.size() > 1
&& !MechanicalPressBlockEntity.canCompress(r)) && !AllRecipeTypes.shouldIgnoreInAutomation(r)
|| r.getType() == TFMGRecipeTypes.ADVANCED_DISTILLATION.getType());
}
@Override
public void startProcessing() {
if (running )
return;
super.startProcessing();
running = true;
}
@Override
public boolean continueWithPreviousRecipe() {
return true;
}
@Override
protected void onBasinRemoved() {
if (!running)
return;
running = false;
}
@Override
protected Object getRecipeCacheKey() {
return AdvancedDistillationRecipesKey;
}
@Override
protected boolean isRunning() {
return running;
}
/*
@Override
protected Optional<CreateAdvancement> getProcessedRecipeTrigger() {
return Optional.of(AllAdvancements.MIXER);
}
*/
public Optional<DistillationControllerBlockEntity> getDistillationController() {
if (level == null)
return Optional.empty();
BlockEntity basinTE = level.getBlockEntity(worldPosition.below(1));
if (!(basinTE instanceof DistillationControllerBlockEntity))
return Optional.empty();
return Optional.of((DistillationControllerBlockEntity) basinTE);
}
public boolean hasIndustrialPipes(int outputAmount){
BlockPos checkedPos = this.getBlockPos().above();
Block checkedBlock;
for(int i = 0;i<(outputAmount-1);i++){
checkedBlock = level.getBlockState(checkedPos).getBlock();
if(checkedBlock == TFMGBlocks.ALUMINUM_BLOCK.get()){
checkedPos=checkedPos.above(2);
continue;
}
return false;
}
return true;
}
}

View File

@@ -0,0 +1,400 @@
package com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower;
import com.drmangotea.tfmg.content.machines.tanks.SteelTankBlock;
import com.drmangotea.tfmg.content.machines.tanks.SteelTankBlockEntity;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGFluids;
import com.simibubi.create.Create;
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
import com.simibubi.create.content.fluids.tank.BoilerHeaters;
import com.simibubi.create.foundation.utility.Components;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.animation.LerpedFloat;
import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser;
import joptsimple.internal.Strings;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.util.Mth;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandler;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
import java.util.List;
import static com.simibubi.create.foundation.fluid.FluidHelper.convertToStill;
public class DistillationTowerData {
static final int SAMPLE_RATE = 1;
private static final int waterSupplyPerLevel = 10;
private static final float passiveEngineEfficiency = 0;
private SteelTankBlockEntity tank;
// pooled water supply
int gatheredSupply;
float[] supplyOverTime = new float[10];
int ticksUntilNextSample;
int currentIndex;
// heat score
public boolean needsHeatLevelUpdate;
public boolean passiveHeat;
public int activeHeat;
public float oilSupply;
public int attachedControllers;
public int attachedWhistles;
// display
public int maxHeatForSize = 0;
private int maxHeatForOil = 0;
private int minValue = 0;
private int maxValue = 0;
public int towerLevel = Math.min(activeHeat, maxHeatForSize);
public LerpedFloat gauge = LerpedFloat.linear();
public void tick(SteelTankBlockEntity controller) {
towerLevel = Math.min(activeHeat, maxHeatForSize);
tank=controller;
// tank.tankInventory.drain(2, IFluidHandler.FluidAction.EXECUTE);
if (controller.getLevel().isClientSide) {
gauge.tickChaser();
float current = gauge.getValue(1);
if (current > 1 && Create.RANDOM.nextFloat() < 1 / 2f)
gauge.setValueNoUpdate(current + Math.min(-(current - 1) * Create.RANDOM.nextFloat(), 0));
return;
}
if (needsHeatLevelUpdate && updateTemperature(controller))
controller.notifyUpdate();
ticksUntilNextSample--;
if (ticksUntilNextSample > 0)
return;
int capacity = controller.tankInventory.getCapacity();
if (capacity == 0)
return;
ticksUntilNextSample = SAMPLE_RATE;
supplyOverTime[currentIndex] = gatheredSupply / (float) SAMPLE_RATE;
oilSupply = Math.max(oilSupply, supplyOverTime[currentIndex]);
currentIndex = (currentIndex + 1) % supplyOverTime.length;
gatheredSupply = 0;
if (currentIndex == 0) {
oilSupply = 0;
for (float i : supplyOverTime)
oilSupply = Math.max(i, oilSupply);
}
/*
if (getActualHeat(controller.getTotalTankSize()) == 18)
controller.award(AllAdvancements.STEAM_ENGINE_MAXED);
*/
controller.notifyUpdate();
}
public int getTheoreticalHeatLevel() {
return activeHeat;
}
public int getMaxHeatLevelForBoilerSize(int towerSize) {
return (int) Math.min(12, towerSize / 4);
}
public int getMaxHeatLevelForOilSupply() {
return (int) Math.min(12, Mth.ceil(oilSupply) / waterSupplyPerLevel);
}
public boolean isPassive() {
return passiveHeat && maxHeatForSize > 0 && maxHeatForOil > 0;
}
public boolean isPassive(int towerSize) {
calcMinMaxForSize(towerSize);
return isPassive();
}
public float getTowerEfficiency(int towerSize) {
if (isPassive(towerSize))
return 0;
if (activeHeat == 0)
return 0;
int actualHeat = getActualHeat(towerSize);
return this.towerLevel;
}
public int getActualHeat(int towerSize) {
int forBoilerSize = getMaxHeatLevelForBoilerSize(towerSize);
int forWaterSupply = getMaxHeatLevelForOilSupply();
int actualHeat = Math.min(activeHeat, Math.min(forWaterSupply, forBoilerSize));
return actualHeat;
}
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking, int towerSize) {
if (!isActive())
return false;
Component indent = Components.literal(IHaveGoggleInformation.spacing);
Component indent2 = Components.literal(IHaveGoggleInformation.spacing + " ");
calcMinMaxForSize(towerSize);
tooltip.add(indent.plainCopy()
.append(
Lang.translateDirect("distillation_tower.status", getHeatLevelTextComponent().withStyle(ChatFormatting.AQUA))));
tooltip.add(indent2.plainCopy()
.append(getSizeComponent(true, false)));
// tooltip.add(indent2.plainCopy()
//.append(getOilComponent(true, false)));
tooltip.add(indent2.plainCopy()
.append(getHeatComponent(true, false)));
if (attachedControllers == 0)
return true;
int boilerLevel = Math.min(activeHeat, maxHeatForSize);
tooltip.add(Components.immutableEmpty());
return true;
}
public void calcMinMaxForSize(int towerSize) {
maxHeatForSize = getMaxHeatLevelForBoilerSize(towerSize);
maxHeatForOil = getMaxHeatLevelForOilSupply();
minValue = Math.min(passiveHeat ? 1 : activeHeat, Math.min(maxHeatForOil, maxHeatForSize));
maxValue = Math.max(passiveHeat ? 1 : activeHeat, Math.max(maxHeatForOil, maxHeatForSize));
}
@NotNull
public MutableComponent getHeatLevelTextComponent() {
int boilerLevel = Math.min(activeHeat, Math.min(maxHeatForOil, maxHeatForSize));
return isPassive() ? Lang.translateDirect("boiler.passive")
: (boilerLevel == 0 ? Lang.translateDirect("boiler.idle")
: boilerLevel == 18 ? Lang.translateDirect("boiler.max_lvl")
: Lang.translateDirect("boiler.lvl", String.valueOf(boilerLevel)));
}
public MutableComponent getSizeComponent(boolean forGoggles, boolean useBlocksAsBars, ChatFormatting... styles) {
return componentHelper("size", maxHeatForSize, forGoggles, useBlocksAsBars, styles);
}
/*
public MutableComponent getOilComponent(boolean forGoggles, boolean useBlocksAsBars, ChatFormatting... styles) {
return componentHelper("crude_oil", maxHeatForOil, forGoggles, useBlocksAsBars, styles);
}
*/
public MutableComponent getHeatComponent(boolean forGoggles, boolean useBlocksAsBars, ChatFormatting... styles) {
return componentHelper("heat", passiveHeat ? 1 : activeHeat, forGoggles, useBlocksAsBars, styles);
}
private MutableComponent componentHelper(String label, int level, boolean forGoggles, boolean useBlocksAsBars,
ChatFormatting... styles) {
MutableComponent base = useBlocksAsBars ? blockComponent(level) : barComponent(level);
if (!forGoggles)
return base;
ChatFormatting style1 = styles.length >= 1 ? styles[0] : ChatFormatting.GRAY;
ChatFormatting style2 = styles.length >= 2 ? styles[1] : ChatFormatting.DARK_GRAY;
return Lang.translateDirect("distillation_tower." + label)
.withStyle(style1)
.append(Lang.translateDirect("boiler." + label + "_dots")
.withStyle(style2))
.append(base);
}
private MutableComponent blockComponent(int level) {
return Components.literal(
"" + "\u2588".repeat(minValue) + "\u2592".repeat(level - minValue) + "\u2591".repeat(maxValue - level));
}
private MutableComponent barComponent(int level) {
return Components.empty()
.append(bars(Math.max(0, minValue - 1), ChatFormatting.DARK_GREEN))
.append(bars(minValue > 0 ? 1 : 0, ChatFormatting.GREEN))
.append(bars(Math.max(0, level - minValue), ChatFormatting.DARK_GREEN))
.append(bars(Math.max(0, maxValue - level), ChatFormatting.DARK_RED))
.append(bars(Math.max(0, Math.min(18 - maxValue, ((maxValue / 5 + 1) * 5) - maxValue)),
ChatFormatting.DARK_GRAY));
}
private MutableComponent bars(int level, ChatFormatting format) {
return Components.literal(Strings.repeat('|', level)).withStyle(format);
}
public boolean evaluate(SteelTankBlockEntity controller) {
BlockPos controllerPos = controller.getBlockPos();
Level level = controller.getLevel();
int prevEngines = attachedControllers;
int prevWhistles = attachedWhistles;
attachedControllers = 0;
attachedWhistles = 0;
for (int yOffset = 0; yOffset < controller.height; yOffset++) {
for (int xOffset = 0; xOffset < controller.width; xOffset++) {
for (int zOffset = 0; zOffset < controller.width; zOffset++) {
BlockPos pos = controllerPos.offset(xOffset, yOffset, zOffset);
BlockState blockState = level.getBlockState(pos);
if (!SteelTankBlock.isTank(blockState))
continue;
for (Direction d : Iterate.directions) {
BlockPos attachedPos = pos.relative(d);
BlockState attachedState = level.getBlockState(attachedPos);
if (TFMGBlocks.STEEL_DISTILLATION_CONTROLLER.has(attachedState) && DistillationControllerBlock.getFacing(attachedState) == d)
attachedControllers++;
}
}
}
}
needsHeatLevelUpdate = true;
return prevEngines != attachedControllers || prevWhistles != attachedWhistles;
}
public boolean updateTemperature(SteelTankBlockEntity controller) {
BlockPos controllerPos = controller.getBlockPos();
Level level = controller.getLevel();
needsHeatLevelUpdate = false;
boolean prevPassive = passiveHeat;
int prevActive = activeHeat;
passiveHeat = false;
activeHeat = 0;
for (int xOffset = 0; xOffset < controller.width; xOffset++) {
for (int zOffset = 0; zOffset < controller.width; zOffset++) {
BlockPos pos = controllerPos.offset(xOffset, -1, zOffset);
BlockState blockState = level.getBlockState(pos);
float heat = BoilerHeaters.getActiveHeat(level, pos, blockState);
if (heat == 0) {
passiveHeat = true;
} else if (heat > 0) {
activeHeat += heat;
}
}
}
passiveHeat &= activeHeat == 0;
return prevActive != activeHeat || prevPassive != passiveHeat;
}
public boolean isActive() {
return attachedControllers == 1;
}
public void clear() {
oilSupply = 0;
activeHeat = 0;
passiveHeat = false;
attachedControllers = 0;
Arrays.fill(supplyOverTime, 0);
}
public CompoundTag write() {
CompoundTag nbt = new CompoundTag();
nbt.putFloat("Supply", oilSupply);
nbt.putInt("ActiveHeat", activeHeat);
nbt.putBoolean("PassiveHeat", passiveHeat);
nbt.putInt("Engines", attachedControllers);
nbt.putInt("Whistles", attachedWhistles);
nbt.putBoolean("Update", needsHeatLevelUpdate);
return nbt;
}
public void read(CompoundTag nbt, int towerSize) {
oilSupply = nbt.getFloat("Supply");
activeHeat = nbt.getInt("ActiveHeat");
passiveHeat = nbt.getBoolean("PassiveHeat");
attachedControllers = nbt.getInt("Engines");
attachedWhistles = nbt.getInt("Whistles");
needsHeatLevelUpdate = nbt.getBoolean("Update");
Arrays.fill(supplyOverTime, (int) oilSupply);
int forBoilerSize = getMaxHeatLevelForBoilerSize(towerSize);
int forOilSupply = getMaxHeatLevelForOilSupply();
int actualHeat = Math.min(activeHeat, Math.min(forOilSupply, forBoilerSize));
float target = isPassive(towerSize) ? 1 / 8f : forBoilerSize == 0 ? 0 : actualHeat / (forBoilerSize * 1f);
gauge.chase(target, 0.125f, Chaser.EXP);
}
public DistillationFluidHandler createHandler() {
return new DistillationFluidHandler();
}
public class DistillationFluidHandler implements IFluidHandler {
@Override
public int getTanks() {
return 1;
}
@Override
public FluidStack getFluidInTank(int tank) {
return FluidStack.EMPTY;
}
@Override
public int getTankCapacity(int tank) {
return 10000;
}
@Override
public boolean isFluidValid(int tank, FluidStack stack) {
return false;
}
public static boolean isOil(Fluid fluid) {
return convertToStill(fluid) == TFMGFluids.CRUDE_OIL.get();
}
@Override
public int fill(FluidStack resource, FluidAction action) {
if (!isFluidValid(0, resource))
return 0;
int amount = resource.getAmount();
if (action.execute())
gatheredSupply += amount;
return amount;
}
@Override
public FluidStack drain(FluidStack resource, FluidAction action) {
return FluidStack.EMPTY;
}
@Override
public FluidStack drain(int maxDrain, FluidAction action) {
return FluidStack.EMPTY;
}
}
}

View File

@@ -40,17 +40,17 @@ import java.util.*;
public class DistilleryControllerBlockEntity extends SmartBlockEntity implements IHaveGoggleInformation {
public SmartFluidTankBehaviour inputTank;
protected SmartInventory outputInventory;
protected SmartFluidTankBehaviour outputTank;
public SmartInventory outputInventory;
public SmartFluidTankBehaviour outputTank;
private boolean contentsChanged;
public boolean contentsChanged;
private Couple<SmartFluidTankBehaviour> tanks;
public Couple<SmartFluidTankBehaviour> tanks;
public LazyOptional<IItemHandlerModifiable> itemCapability;
protected LazyOptional<IFluidHandler> fluidCapability;
int recipeBackupCheck;
public int recipeBackupCheck;
public DistilleryControllerBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
@@ -182,7 +182,7 @@ public class DistilleryControllerBlockEntity extends SmartBlockEntity implements
private Optional<FluidProcessingBlockEntity> getOperator() {
protected Optional<FluidProcessingBlockEntity> getOperator() {
if (level == null)
return Optional.empty();
BlockEntity te = level.getBlockEntity(worldPosition.above());

View File

@@ -3,6 +3,7 @@ package com.drmangotea.tfmg.content.machines.oil_processing.distillation.distill
import com.drmangotea.tfmg.CreateTFMG;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.FluidProcessingBlockEntity;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationOutputBlockEntity;
import com.drmangotea.tfmg.recipes.distillation.DistillationRecipe;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
import com.simibubi.create.AllRecipeTypes;
@@ -132,7 +133,8 @@ public class DistilleryOutputBlockEntity extends FluidProcessingBlockEntity impl
@Override
public void tick() {
super.tick();
if(this instanceof DistillationOutputBlockEntity)
return;
if (level != null) {
@@ -214,15 +216,19 @@ if(above1 !=null&& above2 !=null
)
return;
if(
tankInventory.getFluidAmount()+((DistillationRecipe) currentRecipe).getFirstFluidResult().getAmount()>8000||
((DistilleryOutputBlockEntity)above1).tankInventory.getFluidAmount()+((DistillationRecipe) currentRecipe).getFirstFluidResult().getAmount()>8000||
((DistilleryOutputBlockEntity)above2).tankInventory.getFluidAmount()+((DistillationRecipe) currentRecipe).getFirstFluidResult().getAmount()>8000
)
return;
if(getController().get().getTanks().get(true).getPrimaryHandler().getFluid().getFluid() != ((DistillationRecipe) currentRecipe).getInputFluid().getMatchingFluidStacks().get(0).getFluid())
return;
DistilleryControllerBlockEntity controller = optionalController.get();
IFluidHandler availableFluids = controller.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
.orElse(null);
if(controller.outputInventory.getStackInSlot(0).getCount()>=1||
controller.outputInventory.getStackInSlot(1).getCount()>=1||
@@ -318,12 +324,6 @@ if(!(((DistillationRecipe) currentRecipe).getThirdItemResult().isEmpty()))
protected boolean isRunning() {
return running;
}
/*
@Override
protected Optional<CreateAdvancement> getProcessedRecipeTrigger() {
return Optional.of(AllAdvancements.MIXER);
}
*/
@@ -340,7 +340,6 @@ if(!(((DistillationRecipe) currentRecipe).getThirdItemResult().isEmpty()))
}
@Override
public void sendData() {
if (syncCooldown > 0) {

View File

@@ -1,6 +1,7 @@
package com.drmangotea.tfmg.content.machines.tanks;
import com.drmangotea.tfmg.registry.TFMGPartialModels;
import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
@@ -29,8 +30,8 @@ public class SteelFluidTankRenderer extends SafeBlockEntityRenderer<SteelTankBlo
if (!te.isController())
return;
if (!te.window) {
//// if (te.tower.isActive())
//// renderAsBoiler(te, partialTicks, ms, buffer, light, overlay);
if (te.tower.isActive())
renderAsBoiler(te, partialTicks, ms, buffer, light, overlay);
return;
}
@@ -86,16 +87,16 @@ public class SteelFluidTankRenderer extends SafeBlockEntityRenderer<SteelTankBlo
msr.translate(te.width / 2f, 0.5, te.width / 2f);
float dialPivot = 5.75f / 16;
//// float progress = te.tower.gauge.getValue(partialTicks);
float progress = te.tower.gauge.getValue(partialTicks);
for (Direction d : Iterate.horizontalDirections) {
ms.pushPose();
//// CachedBufferer.partial(CIPartialModels.TOWER_GAUGE, blockState)
//// .rotateY(d.toYRot())
//// .unCentre()
//// .translate(te.width / 2f - 6 / 16f, 0, 0)
//// .light(light)
//// .renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.TOWER_GAUGE, blockState)
.rotateY(d.toYRot())
.unCentre()
.translate(te.width / 2f - 6 / 16f, 0, 0)
.light(light)
.renderInto(ms, vb);
CachedBufferer.partial(AllPartialModels.BOILER_GAUGE_DIAL, blockState)
.rotateY(d.toYRot())
.unCentre()

View File

@@ -1,6 +1,7 @@
package com.drmangotea.tfmg.content.machines.tanks;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationTowerData;
import com.simibubi.create.api.connectivity.ConnectivityHandler;
import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation;
import com.simibubi.create.content.fluids.tank.FluidTankBlockEntity;
@@ -53,7 +54,7 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
public int gaugeRotation=0;
////public DistillationTowerData tower;
public DistillationTowerData tower;
private static final int SYNC_RATE = 8;
protected int syncCooldown;
@@ -72,7 +73,7 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
window = true;
height = 1;
width = 1;
////// tower = new DistillationTowerData();
tower = new DistillationTowerData();
refreshCapability();
}
@@ -115,8 +116,8 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
updateConnectivity();
if (fluidLevel != null)
fluidLevel.tickChaser();
//// if (isController())
//// tower.tick(this);
if (isController())
tower.tick(this);
}
@Override
@@ -222,7 +223,7 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
controller = null;
width = 1;
height = 1;
//// tower.clear();
tower.clear();
onFluidStackChanged(tankInventory.getFluid());
BlockState state = getBlockState();
@@ -242,8 +243,8 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
SteelTankBlockEntity te = getControllerBE();
if (te == null)
return;
//// if (te.tower.isActive())
//// return;
if (te.tower.isActive())
return;
te.setWindows(!te.window);
}
@@ -251,9 +252,9 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
SteelTankBlockEntity te = getControllerBE();
if (te == null)
return;
//// if (!te.tower.isActive())
//// return;
//// te.tower.needsHeatLevelUpdate = true;
if (!te.tower.isActive())
return;
te.tower.needsHeatLevelUpdate = true;
}
public void sendDataImmediately() {
@@ -311,25 +312,25 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
if (!isController())
return;
//// boolean wasBoiler = tower.isActive();
//// boolean changed = tower.evaluate(this);
boolean wasBoiler = tower.isActive();
boolean changed = tower.evaluate(this);
//// if (wasBoiler != tower.isActive()) {
//// //// if (tower.isActive())
//// //// setWindows(false);
if (wasBoiler != tower.isActive()) {
if (tower.isActive())
setWindows(false);
//// for (int yOffset = 0; yOffset < height; yOffset++)
//// for (int xOffset = 0; xOffset < width; xOffset++)
//// for (int zOffset = 0; zOffset < width; zOffset++)
//// if (level.getBlockEntity(
//// worldPosition.offset(xOffset, yOffset, zOffset))instanceof SteelTankBlockEntity fte)
//// fte.refreshCapability();
//// }
for (int yOffset = 0; yOffset < height; yOffset++)
for (int xOffset = 0; xOffset < width; xOffset++)
for (int zOffset = 0; zOffset < width; zOffset++)
if (level.getBlockEntity(
worldPosition.offset(xOffset, yOffset, zOffset))instanceof SteelTankBlockEntity fte)
fte.refreshCapability();
}
/// if (changed) {
/// notifyUpdate();
if (changed) {
notifyUpdate();
/// }
}
}
@Override
@@ -352,13 +353,13 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
private IFluidHandler handlerForCapability() {
return tankInventory;////isController()
////? tower.isActive()
////? tower.createHandler()
return isController()
? tower.isActive()
? tower.createHandler()
////: tankInventory
////: getControllerBE() != null ? getControllerBE().handlerForCapability()
////: new FluidTank(0);
: tankInventory
: getControllerBE() != null ? getControllerBE().handlerForCapability()
: new FluidTank(0);
}
@Override
@@ -387,8 +388,8 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
SteelTankBlockEntity controllerTE = getControllerBE();
if (controllerTE == null)
return false;
/////// if (controllerTE.tower.addToGoggleTooltip(tooltip, isPlayerSneaking, controllerTE.getTotalTankSize()))
/////// return true;
if (controllerTE.tower.addToGoggleTooltip(tooltip, isPlayerSneaking, controllerTE.getTotalTankSize()))
return true;
return containedFluidTooltip(tooltip, isPlayerSneaking,
controllerTE.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY));
}
@@ -422,7 +423,7 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
tankInventory.drain(-tankInventory.getSpace(), FluidAction.EXECUTE);
}
///// tower.read(compound.getCompound("Boiler"), width * width * height);
tower.read(compound.getCompound("Boiler"), width * width * height);
if (compound.contains("ForceFluidLevel") || fluidLevel == null)
fluidLevel = LerpedFloat.linear()
@@ -456,16 +457,16 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
fluidLevel.chase(fluidLevel.getChaseTarget(), 0.125f, Chaser.EXP);
}
public void getGaugeRotation(){
////// int level=tower.towerLevel;
int level=tower.towerLevel;
////// if(level>=13){
////// gaugeRotation=90;
////// } else
////// if(level>=4){
////// gaugeRotation=45;
////// } else{
////// gaugeRotation=0;
////// }
if(level>=12){
gaugeRotation=90;
} else
if(level>=4){
gaugeRotation=45;
} else{
gaugeRotation=0;
}
}
@@ -478,7 +479,7 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
if (updateConnectivity)
compound.putBoolean("Uninitialized", true);
/////// compound.put("Boiler", tower.write());
compound.put("Boiler", tower.write());
if (lastKnownPos != null)
compound.put("LastKnownPos", NbtUtils.writeBlockPos(lastKnownPos));
if (!isController())
@@ -490,8 +491,6 @@ public class SteelTankBlockEntity extends FluidTankBlockEntity implements IHaveG
compound.putInt("Height", height);
}
compound.putInt("Luminosity", luminosity);
// super.write(compound, clientPacket);
//super.saveAdditional(compound);
forEachBehaviour(tb -> tb.write(compound, clientPacket));

View File

@@ -1,11 +1,11 @@
package com.drmangotea.tfmg.recipes.distillation.advanced;
package com.drmangotea.tfmg.recipes.distillation;
import com.drmangotea.tfmg.recipes.distillation.ItemlessRecipe;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder;
import com.simibubi.create.foundation.fluid.FluidIngredient;
import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
@@ -38,13 +38,22 @@ public class AdvancedDistillationRecipe extends ItemlessRecipe {
return fluidResults.get(5);
}
public ItemStack getFirstItemResult(){
return results.get(0).getStack();
public int getOutputCount(AdvancedDistillationRecipe recipe){
return recipe.fluidResults.toArray().length;
}
public ItemStack getSecondItemResult(){
return results.get(1).getStack();
public NonNullList<FluidStack> getResults(){
return fluidResults;
}
public ItemStack getThirdItemResult(){
return results.get(2).getStack();
@Override
protected int getMaxFluidOutputCount() {
return 6;
}
@Override
protected int getMaxOutputCount() {
return 0;
}
}

View File

@@ -1,5 +1,6 @@
package com.drmangotea.tfmg.recipes.distillation;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationControllerBlockEntity;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryControllerBlockEntity;
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
import com.simibubi.create.content.processing.recipe.ProcessingRecipe;
@@ -10,7 +11,6 @@ import com.simibubi.create.foundation.item.SmartInventory;
import com.simibubi.create.foundation.recipe.IRecipeTypeInfo;
import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.level.Level;
import net.minecraftforge.fluids.FluidStack;
@@ -22,7 +22,6 @@ import net.minecraftforge.items.IItemHandler;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
public class ItemlessRecipe extends ProcessingRecipe<SmartInventory> {
@@ -33,9 +32,6 @@ public class ItemlessRecipe extends ProcessingRecipe<SmartInventory> {
if(recipe instanceof ItemlessRecipe) {
return apply(controller, recipe, true);
}
@@ -44,8 +40,8 @@ public class ItemlessRecipe extends ProcessingRecipe<SmartInventory> {
}
public static boolean apply(DistilleryControllerBlockEntity basin, Recipe<?> recipe) {
return apply(basin, recipe, false);
public static boolean apply(DistilleryControllerBlockEntity controller, Recipe<?> recipe) {
return apply(controller, recipe, false);
}
private static boolean apply(DistilleryControllerBlockEntity controller, Recipe<?> recipe, boolean test) {
@@ -133,8 +129,102 @@ public class ItemlessRecipe extends ProcessingRecipe<SmartInventory> {
return true;
}
public static boolean match2(DistillationControllerBlockEntity controller, Recipe<?> recipe) {
if(recipe instanceof ItemlessRecipe) {
return apply(controller, recipe, true);
}
return false;
}
private static boolean apply2(DistillationControllerBlockEntity controller, Recipe<?> recipe, boolean test) {
boolean isItemlessRecipe = recipe instanceof ItemlessRecipe;
IItemHandler availableItems = controller.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
.orElse(null);
IFluidHandler availableFluids = controller.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
.orElse(null);
if (availableItems == null || availableFluids == null)
return false;
BlazeBurnerBlock.HeatLevel heat = DistilleryControllerBlockEntity.getHeatLevelOf(controller.getLevel()
.getBlockState(controller.getBlockPos()
.below(1)));
if (isItemlessRecipe && !((ItemlessRecipe) recipe).getRequiredHeat()
.testBlazeBurner(heat))
return false;
List<ItemStack> recipeOutputItems = new ArrayList<>();
List<FluidStack> recipeOutputFluids = new ArrayList<>();
List<FluidIngredient> fluidIngredients =
isItemlessRecipe ? ((ItemlessRecipe) recipe).getFluidIngredients() : Collections.emptyList();
if(!fluidIngredients.isEmpty())
for (boolean simulate : Iterate.trueAndFalse) {
if (!simulate && test)
return true;
int[] extractedFluidsFromTank = new int[availableFluids.getTanks()];
boolean fluidsAffected = false;
FluidIngredients: for (int i = 0; i < fluidIngredients.size(); i++) {
FluidIngredient fluidIngredient = fluidIngredients.get(i);
int amountRequired = fluidIngredient.getRequiredAmount();
for (int tank = 0; tank < availableFluids.getTanks(); tank++) {
FluidStack fluidStack = availableFluids.getFluidInTank(tank);
if (simulate && fluidStack.getAmount() <= extractedFluidsFromTank[tank])
continue;
if (!fluidIngredient.test(fluidStack))
continue;
int drainedAmount = Math.min(amountRequired, fluidStack.getAmount());
if (!simulate) {
fluidStack.shrink(drainedAmount);
fluidsAffected = true;
}
amountRequired -= drainedAmount;
if (amountRequired != 0)
continue;
extractedFluidsFromTank[tank] += drainedAmount;
continue FluidIngredients;
}
// something wasn't found
return false;
}
if (fluidsAffected) {
controller.getBehaviour(SmartFluidTankBehaviour.INPUT)
.forEach(SmartFluidTankBehaviour.TankSegment::onFluidStackChanged);
controller.getBehaviour(SmartFluidTankBehaviour.OUTPUT)
.forEach(SmartFluidTankBehaviour.TankSegment::onFluidStackChanged);
}
if (simulate) {
if (recipe instanceof ItemlessRecipe ItemlessRecipe) {
recipeOutputItems.addAll(ItemlessRecipe.rollResults());
recipeOutputFluids.addAll(ItemlessRecipe.getFluidResults());
} else {
recipeOutputItems.add(recipe.getResultItem());
}
}
}
return true;
}
protected ItemlessRecipe(IRecipeTypeInfo type, ProcessingRecipeBuilder.ProcessingRecipeParams params) {
super(type, params);
@@ -158,7 +248,7 @@ public class ItemlessRecipe extends ProcessingRecipe<SmartInventory> {
@Override
protected int getMaxFluidOutputCount() {
return 6;
return 3;
}
@Override

View File

@@ -0,0 +1,78 @@
package com.drmangotea.tfmg.recipes.jei;
import com.drmangotea.tfmg.recipes.distillation.AdvancedDistillationRecipe;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
import com.simibubi.create.foundation.fluid.FluidIngredient;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import mezz.jei.api.forge.ForgeTypes;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
import mezz.jei.api.recipe.IFocusGroup;
import mezz.jei.api.recipe.RecipeIngredientRole;
import net.minecraft.world.item.ItemStack;
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
public class AdvancedDistillationCategory extends CreateRecipeCategory<AdvancedDistillationRecipe> {
private final AnimatedDistiller distiller = new AnimatedDistiller();
public AdvancedDistillationCategory(Info<AdvancedDistillationRecipe> info) {
super(info);
}
@Override
public void setRecipe(IRecipeLayoutBuilder builder, AdvancedDistillationRecipe recipe, IFocusGroup focuses) {
FluidIngredient fluidIngredient=recipe.getInputFluid();
builder
.addSlot(RecipeIngredientRole.INPUT, 2, 75)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredients(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getInputFluid().getMatchingFluidStacks()))
.addTooltipCallback(addFluidTooltip(recipe.getInputFluid().getRequiredAmount()));
builder
.addSlot(RecipeIngredientRole.OUTPUT,150, 55)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getFirstFluidResult()))
.addTooltipCallback(addFluidTooltip(recipe.getFirstFluidResult().getAmount()));
builder
.addSlot(RecipeIngredientRole.OUTPUT,150, 33)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getSecondFluidResult()))
.addTooltipCallback(addFluidTooltip(recipe.getSecondFluidResult().getAmount()));
builder
.addSlot(RecipeIngredientRole.OUTPUT,150, 12)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getThirdFluidResult()))
.addTooltipCallback(addFluidTooltip(recipe.getThirdFluidResult().getAmount()));
}
@Override
public void draw(AdvancedDistillationRecipe recipe, IRecipeSlotsView iRecipeSlotsView, PoseStack matrixStack, double mouseX, double mouseY) {
distiller
.draw(matrixStack, 65, 27);
AllGuiTextures.JEI_ARROW.render(matrixStack, 20, 80);
AllGuiTextures.JEI_ARROW.render(matrixStack, 100, 14);
AllGuiTextures.JEI_ARROW.render(matrixStack, 100, 35);
AllGuiTextures.JEI_ARROW.render(matrixStack, 100, 57);
AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 100, 79);
}
}

View File

@@ -2,6 +2,7 @@ package com.drmangotea.tfmg.recipes.jei;
import com.drmangotea.tfmg.recipes.distillation.DistillationRecipe;
import com.drmangotea.tfmg.recipes.distillation.AdvancedDistillationRecipe;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGFluids;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
@@ -60,7 +61,18 @@ public class TFMGJei implements IModPlugin {
.catalyst(TFMGBlocks.CAST_IRON_DISTILLATION_CONTROLLER::get)
.itemIcon(TFMGFluids.CRUDE_OIL.getBucket().get())
.emptyBackground(177, 123)
.build("distillation", DistillationCategory::new);
.build("distillation", DistillationCategory::new)
,
advancedDistillation = builder(AdvancedDistillationRecipe.class)
.addTypedRecipes(TFMGRecipeTypes.ADVANCED_DISTILLATION)
.catalyst(TFMGBlocks.CAST_IRON_DISTILLATION_CONTROLLER::get)
.itemIcon(TFMGFluids.KEROSENE.getBucket().get())
.emptyBackground(177, 123)
.build("advanced_distillation", AdvancedDistillationCategory::new)
;
}

View File

@@ -7,6 +7,8 @@ import com.drmangotea.tfmg.content.decoration.doors.TFMGSlidingDoorRenderer;
import com.drmangotea.tfmg.content.deposits.FluidDepositBlockEntity;
import com.drmangotea.tfmg.content.deposits.surface_scanner.SurfaceScannerRenderer;
import com.drmangotea.tfmg.content.deposits.surface_scanner.SurfaceScannerTileEntity;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationControllerBlockEntity;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationOutputBlockEntity;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryControllerBlockEntity;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryOutputBlockEntity;
import com.drmangotea.tfmg.content.machines.pipes.normal.LockablePipeBlockEntity;
@@ -103,15 +105,25 @@ public class TFMGBlockEntities {
public static final BlockEntityEntry<DistilleryOutputBlockEntity> CAST_IRON_DISTILLATION_OUTPUT = REGISTRATE
.blockEntity("distiller", DistilleryOutputBlockEntity::new)
.blockEntity("distillery", DistilleryOutputBlockEntity::new)
.validBlocks(TFMGBlocks.CAST_IRON_DISTILLATION_OUTPUT)
.register();
public static final BlockEntityEntry<DistilleryControllerBlockEntity> CAST_IRON_DISTILLATION_CONTROLLER = REGISTRATE
.blockEntity("distiller_controller", DistilleryControllerBlockEntity::new)
.blockEntity("distillery_controller", DistilleryControllerBlockEntity::new)
.validBlocks(TFMGBlocks.CAST_IRON_DISTILLATION_CONTROLLER)
.register();
public static final BlockEntityEntry<DistillationOutputBlockEntity> STEEL_DISTILLATION_OUTPUT = REGISTRATE
.blockEntity("distillation_tower_output", DistillationOutputBlockEntity::new)
.validBlocks(TFMGBlocks.STEEL_DISTILLATION_OUTPUT)
.register();
public static final BlockEntityEntry<DistillationControllerBlockEntity> STEEL_DISTILLATION_CONTROLLER = REGISTRATE
.blockEntity("distillation_tower_controller", DistillationControllerBlockEntity::new)
.validBlocks(TFMGBlocks.STEEL_DISTILLATION_CONTROLLER)
.register();
public static void register() {}
}

View File

@@ -10,6 +10,8 @@ import com.drmangotea.tfmg.content.gadgets.explosives.napalm.NapalmBombBlock;
import com.drmangotea.tfmg.content.items.CoalCokeBlockItem;
import com.drmangotea.tfmg.content.items.FossilstoneItem;
import com.drmangotea.tfmg.content.deposits.surface_scanner.SurfaceScannerBlock;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationControllerBlock;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillation_tower.DistillationOutputBlock;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryControllerBlock;
import com.drmangotea.tfmg.content.machines.oil_processing.distillation.distillery.DistilleryOutputBlock;
import com.drmangotea.tfmg.content.machines.pipes.normal.steel.EncasedSteelPipeBlock;
@@ -255,7 +257,21 @@ public class TFMGBlocks {
.build()
.register();
//
public static final BlockEntry<DistillationOutputBlock> STEEL_DISTILLATION_OUTPUT =
REGISTRATE.block("steel_distillation_output", DistillationOutputBlock::new)
.initialProperties(SharedProperties::copperMetal)
.properties(p -> p.color(MaterialColor.STONE))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(axeOrPickaxe())
.item(AssemblyOperatorBlockItem::new)
.build()
.register();
public static final BlockEntry<DistillationControllerBlock> STEEL_DISTILLATION_CONTROLLER =
REGISTRATE.block("steel_distillation_controller", DistillationControllerBlock::new)
.initialProperties(SharedProperties::copperMetal)
.item()
.build()
.register();
//////

View File

@@ -18,6 +18,7 @@ import java.util.Map;
public class TFMGPartialModels {
public static final PartialModel
TOWER_GAUGE = block("distillation_tower/gauge"),
STEEL_FLUID_PIPE_CASING = block("steel_pipe/casing"),
SURFACE_SCANNER_DIAL = block("surface_scanner/dial"),
SURFACE_SCANNER_FLAG = block("surface_scanner/flag"),

View File

@@ -3,7 +3,7 @@ package com.drmangotea.tfmg.registry;
import com.drmangotea.tfmg.CreateTFMG;
import com.drmangotea.tfmg.recipes.distillation.DistillationRecipe;
import com.drmangotea.tfmg.recipes.distillation.advanced.AdvancedDistillationRecipe;
import com.drmangotea.tfmg.recipes.distillation.AdvancedDistillationRecipe;
import com.google.common.collect.ImmutableSet;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder.ProcessingRecipeFactory;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeSerializer;

View File

@@ -5,9 +5,16 @@
"create.goggles.misc.dot_one": ".",
"create.goggles.misc.dot_two": "..",
"create.goggles.misc.dot_three": "...",
"create.goggles.fluid_in_tank": "Fluid In Tank:",
"create.goggles.surface_scanner.no_rotation": "No Rotation Provided",
"create.goggles.surface_scanner.no_deposit": "No Deposit Found",
"create.goggles.surface_scanner.deposit_found": "Found Deposit",
"create.goggles.surface_scanner.distance": "Distance: %1$s Blocks",
"create.goggles.surface_scanner.scanning_surface": "Scanning Surface"
"create.goggles.surface_scanner.scanning_surface": "Scanning Surface",
"create.goggles.distillation_tower.status": "Distillation Tower Info:",
"create.goggles.distillation_tower.tank_not_found": "Steel Fluid Tank Not Found",
"create.goggles.distillation_tower.not_tall_enough": "Distillation Tower is Not Tall Enough",
"create.goggles.distillation_tower.level": "Distillation Tower Level: %1$s",
"create.goggles.distillation_tower.found_outputs": "Found Outputs: %1$s",
"create.goggles.distillation_tower.no_outputs": "No Output Blocks Found"
}

View File

@@ -0,0 +1,37 @@
{
"credit": "Made with Blockbench",
"textures": {
"1": "tfmg:block/gauge",
"2": "create:block/gauge",
"particle": "tfmg:block/gauge"
},
"elements": [
{
"name": "GaugeButton",
"from": [15.5, 5.2, 5.2],
"to": [16.5, 6.3, 6.3],
"rotation": {"angle": 0, "axis": "y", "origin": [10, 8, 8]},
"faces": {
"north": {"uv": [0, 9.5, 0.5, 10], "texture": "#2"},
"east": {"uv": [0, 9.5, 0.5, 10], "texture": "#2"},
"south": {"uv": [0, 9.5, 0.5, 10], "texture": "#2"},
"west": {"uv": [0, 9.5, 0.5, 10], "texture": "#2"},
"up": {"uv": [0, 9.5, 0.5, 10], "texture": "#2"},
"down": {"uv": [0, 9.5, 0.5, 10], "texture": "#2"}
}
},
{
"name": "GuageMetalBack",
"from": [14, 3.05, 3.05],
"to": [15.95, 12.95, 12.95],
"rotation": {"angle": 0, "axis": "y", "origin": [9, 8, 8]},
"faces": {
"north": {"uv": [11, 0, 13, 10], "texture": "#1"},
"east": {"uv": [0, 0, 10, 10], "texture": "#1"},
"south": {"uv": [11, 0, 13, 10], "rotation": 180, "texture": "#1"},
"up": {"uv": [11, 0, 13, 10], "rotation": 180, "texture": "#1"},
"down": {"uv": [11, 0, 13, 10], "rotation": 180, "texture": "#1"}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,39 @@
{
"type": "tfmg:advanced_distillation",
"ingredients": [
{
"fluid": "tfmg:heavy_oil",
"nbt": {},
"amount": 90
}
],
"results": [
{
"fluid": "tfmg:diesel",
"amount": 30
},
{
"fluid": "tfmg:lubrication_oil",
"amount": 30
},
{
"fluid": "tfmg:lubrication_oil",
"amount": 30
},
{
"fluid": "tfmg:lubrication_oil",
"amount": 30
},
{
"fluid": "tfmg:lubrication_oil",
"amount": 30
},
{
"fluid": "tfmg:lubrication_oil",
"amount": 30
}
]
}

View File

@@ -0,0 +1,32 @@
{
"type": "tfmg:advanced_distillation",
"ingredients": [
{
"fluid": "tfmg:naphtha",
"nbt": {},
"amount": 9
}
],
"results": [
{
"fluid": "tfmg:propylene",
"amount": 3
},
{
"fluid": "tfmg:ethylene",
"amount": 3
},
{
"fluid": "tfmg:ethylene",
"amount": 3
}
,
{
"fluid": "tfmg:ethylene",
"amount": 3
}
]
}

View File

@@ -0,0 +1,19 @@
{
"type": "tfmg:advanced_distillation",
"ingredients": [
{
"fluid": "tfmg:diesel",
"nbt": {},
"amount": 5
}
],
"results": [
{
"fluid": "tfmg:propylene",
"amount": 3
}
]
}