coke oven

This commit is contained in:
DrMangoTea
2023-09-30 11:44:48 +02:00
parent 7b23739c4a
commit 2a21a5f629
56 changed files with 1774 additions and 31 deletions

View File

@@ -14,7 +14,6 @@ public class CreateTFMGClient {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
TFMGPartialModels.init();
modEventBus.register(this);
}

View File

@@ -11,6 +11,7 @@ import com.simibubi.create.foundation.utility.LangBuilder;
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.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
@@ -34,8 +35,7 @@ public class TFMGMachineBlockEntity extends SmartBlockEntity implements IHaveGo
public TFMGMachineBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
tank1.forbidExtraction();
tank2.forbidInsertion();
contentsChanged = true;
@@ -49,10 +49,9 @@ public class TFMGMachineBlockEntity extends SmartBlockEntity implements IHaveGo
.whenFluidUpdates(() -> contentsChanged = true);
tank2 = new SmartFluidTankBehaviour(SmartFluidTankBehaviour.OUTPUT, this, 1, 1000, true)
.whenFluidUpdates(() -> contentsChanged = true)
.forbidInsertion();
behaviours.add(tank1);
.whenFluidUpdates(() -> contentsChanged = true);
behaviours.add(tank1);
behaviours.add(tank2);
fluidCapability = LazyOptional.of(() -> {
LazyOptional<? extends IFluidHandler> inputCap = tank1.getCapability();
@@ -143,4 +142,6 @@ public class TFMGMachineBlockEntity extends SmartBlockEntity implements IHaveGo
return true;
}
}

View File

@@ -123,7 +123,6 @@ public class BlastFurnaceOutputBlockEntity extends TFMGMachineBlockEntity implem
@Override
protected void read(CompoundTag compound, boolean clientPacket) {
super.read(compound, clientPacket);
inputInventory.deserializeNBT(compound.getCompound("InputItems"));
fuelInventory.deserializeNBT(compound.getCompound("Fuel"));
}

View File

@@ -8,11 +8,14 @@ import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.world.level.block.state.BlockState;
import static net.minecraft.world.level.block.HorizontalDirectionalBlock.FACING;
public class BlastFurnaceRenderer extends SafeBlockEntityRenderer<BlastFurnaceOutputBlockEntity> {
public BlastFurnaceRenderer(BlockEntityRendererProvider.Context context) {}
@@ -27,7 +30,9 @@ public class BlastFurnaceRenderer extends SafeBlockEntityRenderer<BlastFurnaceOu
float coalCokeLevel = be.coalCokeHeight.getValue()/32;
this.renderNorth(be,partialTicks,ms,buffer,light,overlay,coalCokeLevel);
int lightInside = LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().above().relative(be.getBlockState().getValue(FACING).getOpposite()));
this.renderNorth(be,partialTicks,ms,buffer,lightInside,overlay,coalCokeLevel);

View File

@@ -0,0 +1,92 @@
package com.drmangotea.tfmg.content.machines.metal_processing.coke_oven;
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.util.StringRepresentable;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
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.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.EnumProperty;
public class CokeOvenBlock extends HorizontalDirectionalBlock implements IBE<CokeOvenBlockEntity>, IWrenchable {
public static final EnumProperty<ControllerType> CONTROLLER_TYPE = EnumProperty.create("controller_type", ControllerType.class);
public CokeOvenBlock(Properties p_54120_) {
super(p_54120_);
registerDefaultState(defaultBlockState().setValue(CONTROLLER_TYPE, ControllerType.CASUAL));
}
@Override
public InteractionResult onWrenched(BlockState state, UseOnContext context) {
Level level = context.getLevel();
BlockPos pos = context.getClickedPos();
BlockEntity be = level.getBlockEntity(pos);
if(be instanceof CokeOvenBlockEntity)
if(((CokeOvenBlockEntity) be).isValid()) {
((CokeOvenBlockEntity) be).isController = !((CokeOvenBlockEntity) be).isController;
level.setBlock(pos,state.setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.CASUAL),2);
if(level.getBlockEntity(pos.below())instanceof CokeOvenBlockEntity)
level.setBlock(pos.below(),level.getBlockState(pos.below()).setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.CASUAL).setValue(FACING,state.getValue(FACING)),2);
if(level.getBlockEntity(pos.above())instanceof CokeOvenBlockEntity)
level.setBlock(pos.above(),level.getBlockState(pos.above()).setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.CASUAL).setValue(FACING,state.getValue(FACING)),2);
}
return InteractionResult.SUCCESS;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
pBuilder.add(FACING,CONTROLLER_TYPE);
super.createBlockStateDefinition(pBuilder);
}
public BlockState getStateForPlacement(BlockPlaceContext p_48781_) {
return this.defaultBlockState().setValue(FACING, p_48781_.getHorizontalDirection().getOpposite()).setValue(CONTROLLER_TYPE,ControllerType.CASUAL);
}
@Override
public Class<CokeOvenBlockEntity> getBlockEntityClass() {
return CokeOvenBlockEntity.class;
}
@Override
public BlockEntityType<? extends CokeOvenBlockEntity> getBlockEntityType() {
return TFMGBlockEntities.COKE_OVEN.get();
}
public enum ControllerType implements StringRepresentable {
CASUAL("casual"),
TOP_OFF("top_off"),
TOP_ON("top_on"),
MIDDLE_OFF("middle_off"),
MIDDLE_ON("middle_on"),
BOTTOM_OFF("bottom_off"),
BOTTOM_ON("bottom_on");
private final String name;
ControllerType(String name) {
this.name = name;
}
@Override
public String getSerializedName() {
return this.name;
}
}
}

View File

@@ -0,0 +1,492 @@
package com.drmangotea.tfmg.content.machines.metal_processing.coke_oven;
import com.drmangotea.tfmg.content.machines.TFMGMachineBlockEntity;
import com.drmangotea.tfmg.recipes.coking.CokingRecipe;
import com.drmangotea.tfmg.registry.*;
import com.simibubi.create.content.equipment.wrench.IWrenchable;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
import com.simibubi.create.foundation.fluid.CombinedTankWrapper;
import com.simibubi.create.foundation.item.SmartInventory;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.animation.LerpedFloat;
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.world.entity.item.ItemEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.templates.FluidTank;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
import net.minecraftforge.items.wrapper.RecipeWrapper;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Optional;
import static com.drmangotea.tfmg.content.machines.metal_processing.coke_oven.CokeOvenBlock.CONTROLLER_TYPE;
import static net.minecraft.world.level.block.HorizontalDirectionalBlock.FACING;
public class CokeOvenBlockEntity extends TFMGMachineBlockEntity implements IWrenchable {
public boolean isController=false;
public CokeOvenBlockEntity controller;
public CokingRecipe lastRecipe;
int progress = 0;
public LerpedFloat visualDoorAngle = LerpedFloat.angular();
public int doorAngle = 0;
public int timer = -1;
public SmartInventory inputInventory;
public LazyOptional<IItemHandlerModifiable> itemCapability;
public final int CARBON_DIOXIDE_PRODUCTION = 9;
public CokeOvenBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
inputInventory = new SmartInventory(1, this)
.withMaxStackSize(64);
itemCapability = LazyOptional.of(() -> new CombinedInvWrapper(inputInventory));
tank2.forbidInsertion();
tank1.forbidInsertion();
}
public void tick(){
super.tick();
if(controller==null){
inputInventory.forbidInsertion();
} else {
inputInventory.allowInsertion();
}
visualDoorAngle.chase(doorAngle, 0.2f, LerpedFloat.Chaser.EXP);
visualDoorAngle.tickChaser();
// if(controller != null)
// refreshCapability();
if(isController){
controller = this;
}
setControllers();
if(controller!=null)
if(!controller.isController)
controller=null;
if(controller!=null)
if(!(level.getBlockEntity(controller.getBlockPos()) instanceof CokeOvenBlockEntity))
controller = null;
setBlockState();
setTimer();
if(lastRecipe!=null) {
if(timer == -1){
progress = 0;
}else {
progress = 100-(timer/(lastRecipe.getProcessingDuration()/100));
}
}
if(timer>=0&&timer<44){
doorAngle = 90;
}else doorAngle = 0;
if(timer==0) {
timer=-1;
process();
}
/////
RecipeWrapper inventoryIn = new RecipeWrapper(inputInventory);
if (lastRecipe == null || !lastRecipe.matches(inventoryIn, level)) {
Optional<CokingRecipe> recipe = TFMGRecipeTypes.COKING.find(inventoryIn, level);
if (!recipe.isPresent()) {
timer = -1;
sendData();
} else {
lastRecipe = recipe.get();
sendData();
}
return;
}
}
public void setBlockState(){
if(controller == null){
level.setBlock(getBlockPos(),this.getBlockState().setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.CASUAL),2);
}
if(!this.isController)
return;
if(timer==-1) {
level.setBlock(getBlockPos(),this.getBlockState().setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.MIDDLE_OFF),2);
if(level.getBlockEntity(getBlockPos().below())instanceof CokeOvenBlockEntity)
level.setBlock(getBlockPos().below(),level.getBlockState(getBlockPos().below()).setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.BOTTOM_OFF).setValue(FACING,this.getBlockState().getValue(FACING)),2);
if(level.getBlockEntity(getBlockPos().above())instanceof CokeOvenBlockEntity)
level.setBlock(getBlockPos().above(),level.getBlockState(getBlockPos().above()).setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.TOP_OFF).setValue(FACING,this.getBlockState().getValue(FACING)),2);
}else {
level.setBlock(getBlockPos(),this.getBlockState().setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.MIDDLE_ON),2);
if(level.getBlockEntity(getBlockPos().below())instanceof CokeOvenBlockEntity)
level.setBlock(getBlockPos().below(),level.getBlockState(getBlockPos().below()).setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.BOTTOM_ON).setValue(FACING,this.getBlockState().getValue(FACING)),2);
if(level.getBlockEntity(getBlockPos().above())instanceof CokeOvenBlockEntity)
level.setBlock(getBlockPos().above(),level.getBlockState(getBlockPos().above()).setValue(CONTROLLER_TYPE, CokeOvenBlock.ControllerType.TOP_ON).setValue(FACING,this.getBlockState().getValue(FACING)),2);
}
}
private void setTimer() {
if(lastRecipe!=null
&&isController
&&timer==-1
&&inputInventory.getItem(0).getCount()>=20&&
(tank2.getPrimaryHandler().getFluidAmount()+CARBON_DIOXIDE_PRODUCTION)<=tank2.getPrimaryHandler().getCapacity()&&
(tank1.getPrimaryHandler().getFluidAmount()+lastRecipe.getFluidResults().get(0).getAmount())<=tank1.getPrimaryHandler().getCapacity()
){
timer = lastRecipe.getProcessingDuration();
inputInventory.setItem(0,new ItemStack(inputInventory.getItem(0).getItem(),inputInventory.getItem(0).getCount()-20));
}
// if(lastRecipe != null)
// if((tank1.getPrimaryHandler().getFluidAmount()+lastRecipe.getFluidResults().get(0).getAmount())>tank1.getPrimaryHandler().getCapacity())
// timer = -1;
// if(lastRecipe != null)
// if((tank2.getPrimaryHandler().getFluidAmount()+CARBON_DIOXIDE_PRODUCTION)>tank2.getPrimaryHandler().getCapacity())
// timer = -1;
if(lastRecipe!=null
&&timer>0
&&isController&&
(tank2.getPrimaryHandler().getFluidAmount()+CARBON_DIOXIDE_PRODUCTION)<=tank2.getPrimaryHandler().getCapacity()&&
(tank1.getPrimaryHandler().getFluidAmount()+lastRecipe.getFluidResults().get(0).getAmount())<=tank1.getPrimaryHandler().getCapacity()
) {
timer--;
tank1.getPrimaryHandler().setFluid(new FluidStack(lastRecipe.getFluidResults().get(0), tank1.getPrimaryHandler().getFluidAmount()+lastRecipe.getFluidResults().get(0).getAmount()));
tank2.getPrimaryHandler().setFluid(new FluidStack(TFMGFluids.CARBON_DIOXIDE.getSource(),tank2.getPrimaryHandler().getFluidAmount()+CARBON_DIOXIDE_PRODUCTION));
}
}
public void process(){
if(level.isClientSide)
return;
if(!isController)
return;
RecipeWrapper inventoryIn = new RecipeWrapper(inputInventory);
if (lastRecipe == null || !lastRecipe.matches(inventoryIn, level)) {
Optional<CokingRecipe> recipe = TFMGRecipeTypes.COKING.find(inventoryIn, level);
if (!recipe.isPresent())
return;
lastRecipe = recipe.get();
}
BlockPos toSpawn = getBlockPos().below().relative(this.getBlockState().getValue(FACING));
//
ItemEntity itemToSpawn = new ItemEntity(level,toSpawn.getX()+0.5f,toSpawn.getY()+0.5f,toSpawn.getZ()+0.5f, lastRecipe.getResultItem().copy());
level.addFreshEntity(itemToSpawn);
}
@Override
protected AABB createRenderBoundingBox() {
return super.createRenderBoundingBox().expandTowards(0, -2, 0).expandTowards(0, 2, 0);
}
private void refreshCapability() {
if(this.controller ==null) {
return;
}
LazyOptional<IFluidHandler> oldFluidCapability = fluidCapability;
LazyOptional<IItemHandlerModifiable> oldItemCapability = itemCapability;
if(controller.tank1==null)
return;
if(controller.tank2==null)
return;
if(controller.inputInventory==null)
return;
fluidCapability = LazyOptional.of(() -> new CombinedTankWrapper(controller.tank1.getPrimaryHandler(), controller.tank2.getPrimaryHandler()));
itemCapability = LazyOptional.of(() -> new CombinedInvWrapper(controller.inputInventory));
oldFluidCapability.invalidate();
oldItemCapability.invalidate();
}
public void setControllers(){
if(!isValid())
return;
if(!isController)
return;
Direction facing = this.getBlockState().getValue(FACING);
BlockPos checkedPos=this.getBlockPos().above();
for(int i = 0; i<3;i++){
for(int y = 0; y<3;y++){
CokeOvenBlockEntity checkedBE = (CokeOvenBlockEntity) level.getBlockEntity(checkedPos);
checkedBE.controller = this;
checkedPos = checkedPos.below();
}
checkedPos = checkedPos.above(3);
checkedPos = checkedPos.relative(facing.getOpposite());
}
}
public boolean isValid(){
Direction facing = this.getBlockState().getValue(FACING);
BlockPos checkedPos=this.getBlockPos().above();
for(int i = 0; i<3;i++){
for(int y = 0; y<3;y++){
if(checkedPos == this.getBlockPos()){
if(!isCokeOvenBlock(checkedPos,true)) {
isController = false;
return false;
}
}else
if(!isCokeOvenBlock(checkedPos)) {
isController=false;
return false;
}
if(occupiedByOtherController(checkedPos)) {
isController = false;
return false;
}
checkedPos = checkedPos.below();
}
checkedPos = checkedPos.above(3);
checkedPos = checkedPos.relative(facing.getOpposite());
}
return true ;
}
public boolean isCokeOvenBlock(BlockPos pos){return isCokeOvenBlock(pos,false);}
public boolean isCokeOvenBlock(BlockPos pos, boolean controllerSensitive){
if(controllerSensitive)
if(level.getBlockState(pos).is(TFMGBlocks.COKE_OVEN.get()))
if(isController)
return false;
return level.getBlockState(pos).is(TFMGBlocks.COKE_OVEN.get());
}
public boolean occupiedByOtherController(BlockPos pos){
if(level.getBlockEntity(pos).getBlockState().is(TFMGBlocks.COKE_OVEN.get()))
if(((CokeOvenBlockEntity)level.getBlockEntity(pos)).controller == null||((CokeOvenBlockEntity)level.getBlockEntity(pos)).controller == this)
// if(((CokeOvenBlockEntity)level.getBlockEntity(pos)).controller != this)
return false;
return true;
}
@Override
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
//if(controller !=null)
// Lang.translate("goggles.surface_scanner.distance",controller.getBlockPos().getX())
// .style(ChatFormatting.DARK_BLUE)
// .forGoggles(tooltip,1);
//if(controller !=null)
// Lang.translate("goggles.surface_scanner.distance",controller.getBlockPos().getY())
// .style(ChatFormatting.DARK_BLUE)
// .forGoggles(tooltip,1);
//if(controller !=null)
// Lang.translate("goggles.surface_scanner.distance",controller.getBlockPos().getZ())
// .style(ChatFormatting.DARK_BLUE)
// .forGoggles(tooltip,1);
//
//if(controller==null){
// Lang.translate("aaaaaaaaaaaaaaaaaaaaaaaaaaa")
// .style(ChatFormatting.DARK_RED)
// .forGoggles(tooltip,1);
//
// return true;
// }
if(controller.getBlockPos() == getBlockPos()&&!isValid()){
Lang.translate("goggles.coke_oven.invalid")
.style(ChatFormatting.DARK_RED)
.forGoggles(tooltip,1);
return true;
}
if(!isController)
return false;
if(lastRecipe != null)
if((tank1.getPrimaryHandler().getFluidAmount()+lastRecipe.getFluidResults().get(0).getAmount())>tank1.getPrimaryHandler().getCapacity()
&&(tank2.getPrimaryHandler().getFluidAmount()+CARBON_DIOXIDE_PRODUCTION)>tank2.getPrimaryHandler().getCapacity()) {
Lang.translate("goggles.coke_oven.tank_full")
.style(ChatFormatting.DARK_RED)
.forGoggles(tooltip,1);
return true;
}
Lang.translate("goggles.coke_oven.status")
.style(ChatFormatting.GRAY)
.forGoggles(tooltip,1);
//
Lang.translate("goggles.coke_oven.progress", progress)
.add(Lang.translate("goggles.misc.percent_symbol"))
.style(ChatFormatting.DARK_PURPLE)
.forGoggles(tooltip,1);
//
Lang.translate("goggles.misc.storage_info")
.style(ChatFormatting.GRAY)
.forGoggles(tooltip,1);
// Lang.translate("goggles.coke_oven.fluid_amount_output",tank1.getPrimaryHandler().getCapacity())
// .style(ChatFormatting.DARK_AQUA)
// .forGoggles(tooltip,1);
// Lang.translate("goggles.coke_oven.fluid_amount_exhaust",tank2.getPrimaryHandler().getCapacity())
// .style(ChatFormatting.DARK_AQUA)
// .forGoggles(tooltip,1);
Lang.translate("goggles.coke_oven.item_count",inputInventory.getItem(0).getCount())
.style(ChatFormatting.GOLD)
.forGoggles(tooltip,1);
return true;
}
@Override
protected void read(CompoundTag compound, boolean clientPacket) {
super.read(compound, clientPacket);
inputInventory.deserializeNBT(compound.getCompound("InputItems"));
isController = compound.getBoolean("Is Controller");
timer = compound.getInt("Timer");
}
@Override
public void write(CompoundTag compound, boolean clientPacket) {
super.write(compound, clientPacket);
compound.put("InputItems", inputInventory.serializeNBT());
compound.putBoolean("Is Controller",isController);
compound.putInt("Timer", timer);
}
@Override
public void invalidate() {
super.invalidate();
itemCapability.invalidate();
}
@Nonnull
@Override
@SuppressWarnings("'net.minecraftforge.items.CapabilityItemHandler' is deprecated and marked for removal ")
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, Direction side) {
if(controller!=null)
refreshCapability();
if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
return itemCapability.cast();
if (cap == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
return fluidCapability.cast();
return super.getCapability(cap, side);
}
@Override
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
}
}

View File

@@ -0,0 +1,50 @@
package com.drmangotea.tfmg.content.machines.metal_processing.coke_oven;
import com.drmangotea.tfmg.CreateTFMG;
import com.simibubi.create.content.processing.basin.BasinBlock;
import com.simibubi.create.content.redstone.thresholdSwitch.ThresholdSwitchBlock;
import com.simibubi.create.foundation.data.AssetLookup;
import com.simibubi.create.foundation.data.SpecialBlockStateGen;
import com.simibubi.create.foundation.utility.Lang;
import com.tterrag.registrate.providers.DataGenContext;
import com.tterrag.registrate.providers.RegistrateBlockstateProvider;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraftforge.client.model.generators.ModelFile;
import java.util.function.Function;
import static com.drmangotea.tfmg.content.machines.metal_processing.coke_oven.CokeOvenBlock.CONTROLLER_TYPE;
import static com.simibubi.create.foundation.data.AssetLookup.partialBaseModel;
public class CokeOvenGenerator extends SpecialBlockStateGen {
@Override
protected int getXRotation(BlockState state) {
return 0;
}
@Override
protected int getYRotation(BlockState state) {
return horizontalAngle(state.getValue(CokeOvenBlock.FACING));
}
@Override
public <T extends Block> ModelFile getModel(DataGenContext<Block, T> ctx, RegistrateBlockstateProvider prov,
BlockState state) {
String path = "block/coke_oven/block_"
+ state.getValue(CONTROLLER_TYPE).getSerializedName()
;
return prov.models()
.getExistingFile(CreateTFMG.asResource(path));
}
}

View File

@@ -0,0 +1,239 @@
package com.drmangotea.tfmg.content.machines.metal_processing.coke_oven;
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;
import com.simibubi.create.content.contraptions.elevator.ElevatorPulleyBlockEntity;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import static net.minecraft.world.level.block.HorizontalDirectionalBlock.FACING;
public class CokeOvenRenderer extends SafeBlockEntityRenderer<CokeOvenBlockEntity> {
public CokeOvenRenderer(BlockEntityRendererProvider.Context context) {}
@Override
protected void renderSafe(CokeOvenBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) {
BlockState blockState = be.getBlockState();
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
ms.pushPose();
TransformStack msr = TransformStack.cast(ms);
msr.translate(1 / 2f, 0.5, 1 / 2f);
int lightInFront = Math.max(
LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().relative(be.getBlockState().getValue(FACING))),
Math.max(
LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().below().relative(be.getBlockState().getValue(FACING))),
LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().above().relative(be.getBlockState().getValue(FACING)))
)
)
;
if(be.isController) {
// CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT, blockState)
// .centre()
// .translate(-1,-1,-1)
// .rotateY(-be.visualDoorAngle.getValue())
// .light(light)
// .renderInto(ms, vb);
// CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT_TOP, blockState)
// .centre()
// .translate(-1,0,-1)
// .rotateY(-be.visualDoorAngle.getValue())
// .light(light)
// .renderInto(ms, vb);
if(be.getBlockState().getValue(FACING)== Direction.SOUTH) {
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT, blockState)
.centre()
.rotateY(be.visualDoorAngle.getValue())
.translate(-1, -2, -1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT_TOP, blockState)
.centre()
.rotateY(be.visualDoorAngle.getValue())
.translate(-1, -1, -1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT, blockState)
.centre()
.translateX(-1)
.rotateY(-be.visualDoorAngle.getValue())
.translate(0, -2, -1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT_TOP, blockState)
.centre()
.translateX(-1)
.rotateY(-be.visualDoorAngle.getValue())
.translate(0, -1, -1)
.light(lightInFront)
.renderInto(ms, vb);
}
if(be.getBlockState().getValue(FACING)== Direction.NORTH) {
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT, blockState)
.centre()
.translateZ(-1.01)
.rotateY(-be.visualDoorAngle.getValue())
.translate(-1, -2, -1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT_TOP, blockState)
.centre()
.translateZ(-1.01)
.rotateY(-be.visualDoorAngle.getValue())
.translate(-1, -1, -1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT, blockState)
.centre()
.translateZ(-1.01)
.translateX(-1)
.rotateY(be.visualDoorAngle.getValue())
.translate(0, -2, -1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT_TOP, blockState)
.centre()
.translateZ(-1.01)
.translateX(-1)
.rotateY(be.visualDoorAngle.getValue())
.translate(0, -1, -1)
.light(lightInFront)
.renderInto(ms, vb);
}
if(be.getBlockState().getValue(FACING)== Direction.WEST) {
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT, blockState)
.centre()
.translateX(-1)
.translateZ(-1)
.translateY(-2)
.rotateY(-be.visualDoorAngle.getValue()+90)
.translateZ(-1.01)
.translateX(-1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT_TOP, blockState)
.centre()
.translateX(-1)
.translateY(-1)
.translateZ(-1)
.rotateY(-be.visualDoorAngle.getValue()+90)
.translateZ(-1.01)
.translateX(-1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT, blockState)
.centre()
.translateX(-1)
.translateY(-2)
.rotateY(be.visualDoorAngle.getValue()+90)
.translateZ(-1.01)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT_TOP, blockState)
.centre()
.translateX(-1)
.translateY(-1)
.rotateY(be.visualDoorAngle.getValue()+90)
.translateZ(-1.01)
.light(lightInFront)
.renderInto(ms, vb);
}
if(be.getBlockState().getValue(FACING)== Direction.EAST) {
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT, blockState)
.centre()
//.translateX(-1)
.translateZ(-1)
.translateY(-2)
.rotateY(be.visualDoorAngle.getValue()+90)
.translateZ(-0.99)
.translateX(-1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_RIGHT_TOP, blockState)
.centre()
//.translateX(-1)
.translateY(-1)
.translateZ(-1)
.rotateY(be.visualDoorAngle.getValue()+90)
.translateZ(-0.99)
.translateX(-1)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT, blockState)
.centre()
//.translateX(-1)
.translateY(-2)
.rotateY(-be.visualDoorAngle.getValue()+90)
.translateZ(-0.99)
.light(lightInFront)
.renderInto(ms, vb);
CachedBufferer.partial(TFMGPartialModels.COKE_OVEN_DOOR_LEFT_TOP, blockState)
.centre()
// .translateX(-1)
.translateY(-1)
.rotateY(-be.visualDoorAngle.getValue()+90)
.translateZ(-0.99)
.light(lightInFront)
.renderInto(ms, vb);
}
}
ms.popPose();
}
@Override
public int getViewDistance() {
return 128;
}
}

View File

@@ -0,0 +1,40 @@
package com.drmangotea.tfmg.recipes.coking;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.content.processing.recipe.ProcessingRecipe;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder.ProcessingRecipeParams;
import com.simibubi.create.foundation.recipe.IRecipeTypeInfo;
import net.minecraft.world.level.Level;
import net.minecraftforge.items.wrapper.RecipeWrapper;
public class CokingRecipe extends ProcessingRecipe<RecipeWrapper> {
public CokingRecipe(ProcessingRecipeParams params) {
super(TFMGRecipeTypes.COKING, params);
}
@Override
protected int getMaxInputCount() {
return 1;
}
@Override
protected int getMaxOutputCount() {
return 1;
}
@Override
protected int getMaxFluidOutputCount() {
return 1;
}
@Override
public boolean matches(RecipeWrapper inv, Level worldIn) {
if (inv.isEmpty())
return false;
return ingredients.get(0)
.test(inv.getItem(0));
}
}

View File

@@ -0,0 +1,38 @@
package com.drmangotea.tfmg.recipes.industrial_blasting;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
import com.simibubi.create.content.processing.recipe.ProcessingRecipe;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder.ProcessingRecipeParams;
import net.minecraft.world.level.Level;
import net.minecraftforge.items.wrapper.RecipeWrapper;
public class IndustrialBlastingRecipe extends ProcessingRecipe<RecipeWrapper> {
public IndustrialBlastingRecipe(ProcessingRecipeParams params) {
super(TFMGRecipeTypes.INDUSTRIAL_BLASTING, params);
}
@Override
protected int getMaxInputCount() {
return 1;
}
@Override
protected int getMaxOutputCount() {
return 0;
}
@Override
protected int getMaxFluidOutputCount() {
return 2;
}
@Override
public boolean matches(RecipeWrapper inv, Level worldIn) {
if (inv.isEmpty())
return false;
return ingredients.get(0)
.test(inv.getItem(0));
}
}

View File

@@ -0,0 +1,78 @@
package com.drmangotea.tfmg.recipes.jei;
import com.drmangotea.tfmg.recipes.coking.CokingRecipe;
import com.drmangotea.tfmg.recipes.jei.machines.CokeOven;
import com.drmangotea.tfmg.recipes.jei.machines.Distillery;
import com.drmangotea.tfmg.registry.TFMGFluids;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
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 net.minecraftforge.fluids.FluidStack;
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
public class CokingCategory extends CreateRecipeCategory<CokingRecipe> {
private final CokeOven cokeOven = new CokeOven();
public CokingCategory(Info<CokingRecipe> info) {
super(info);
}
@Override
public void setRecipe(IRecipeLayoutBuilder builder, CokingRecipe recipe, IFocusGroup focuses) {
builder
.addSlot(RecipeIngredientRole.INPUT, 1, 13)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredients(recipe.getIngredients().get(0));
builder
.addSlot(RecipeIngredientRole.OUTPUT, 121, 90)
.setBackground(getRenderedSlot(), -1, -1)
.addItemStack(recipe.getResultItem());
//fluid
builder
.addSlot(RecipeIngredientRole.OUTPUT,160, 46)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(new FluidStack(TFMGFluids.CARBON_DIOXIDE.get(),5000)))
.addTooltipCallback(addFluidTooltip(5000));
builder
.addSlot(RecipeIngredientRole.OUTPUT,160, 22)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getFluidResults().get(0)))
.addTooltipCallback(addFluidTooltip(recipe.getFluidResults().get(0).getAmount()));
}
@Override
public void draw(CokingRecipe recipe, IRecipeSlotsView iRecipeSlotsView, PoseStack matrixStack, double mouseX, double mouseY) {
cokeOven
.draw(matrixStack, 65, 50);
AllGuiTextures.JEI_ARROW.render(matrixStack, 20, 15);
AllGuiTextures.JEI_ARROW.render(matrixStack, 115, 25);
AllGuiTextures.JEI_ARROW.render(matrixStack, 115, 50);
AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 115, 73);
}
}

View File

@@ -0,0 +1,76 @@
package com.drmangotea.tfmg.recipes.jei;
import com.drmangotea.tfmg.recipes.industrial_blasting.IndustrialBlastingRecipe;
import com.drmangotea.tfmg.recipes.jei.machines.BlastFurnace;
import com.drmangotea.tfmg.registry.TFMGFluids;
import com.drmangotea.tfmg.registry.TFMGItems;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
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 net.minecraftforge.fluids.FluidStack;
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
public class IndustrialBlastingCategory extends CreateRecipeCategory<IndustrialBlastingRecipe> {
private final BlastFurnace blastFurnace = new BlastFurnace();
public IndustrialBlastingCategory(Info<IndustrialBlastingRecipe> info) {
super(info);
}
@Override
public void setRecipe(IRecipeLayoutBuilder builder, IndustrialBlastingRecipe recipe, IFocusGroup focuses) {
builder
.addSlot(RecipeIngredientRole.INPUT, 25, 13)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredients(recipe.getIngredients().get(0));
builder
.addSlot(RecipeIngredientRole.INPUT, 5, 13)
.setBackground(getRenderedSlot(), -1, -1)
.addItemStack(new ItemStack(TFMGItems.COAL_COKE_DUST.get(),2));
//fluid
builder
.addSlot(RecipeIngredientRole.OUTPUT,140, 117)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getFluidResults().get(0)))
.addTooltipCallback(addFluidTooltip(recipe.getFluidResults().get(0).getAmount()));
builder
.addSlot(RecipeIngredientRole.OUTPUT,160, 117)
.setBackground(getRenderedSlot(), -1, -1)
.addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(recipe.getFluidResults().get(1)))
.addTooltipCallback(addFluidTooltip(recipe.getFluidResults().get(1).getAmount()));
}
@Override
public void draw(IndustrialBlastingRecipe recipe, IRecipeSlotsView iRecipeSlotsView, PoseStack matrixStack, double mouseX, double mouseY) {
blastFurnace
.draw(matrixStack, 50, 135);
AllGuiTextures.JEI_ARROW.render(matrixStack, 96, 121);
AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 45, 15);
}
}

View File

@@ -1,8 +1,10 @@
package com.drmangotea.tfmg.recipes.jei;
import com.drmangotea.tfmg.recipes.coking.CokingRecipe;
import com.drmangotea.tfmg.recipes.distillation.DistillationRecipe;
import com.drmangotea.tfmg.recipes.distillation.AdvancedDistillationRecipe;
import com.drmangotea.tfmg.recipes.industrial_blasting.IndustrialBlastingRecipe;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGFluids;
import com.drmangotea.tfmg.registry.TFMGRecipeTypes;
@@ -70,7 +72,21 @@ public class TFMGJei implements IModPlugin {
.catalyst(TFMGBlocks.STEEL_DISTILLATION_OUTPUT::get)
.itemIcon(TFMGBlocks.STEEL_DISTILLATION_CONTROLLER.get())
.emptyBackground(177, 150)
.build("advanced_distillation", AdvancedDistillationCategory::new)
.build("advanced_distillation", AdvancedDistillationCategory::new),
coking = builder(CokingRecipe.class)
.addTypedRecipes(TFMGRecipeTypes.COKING)
.catalyst(TFMGBlocks.COKE_OVEN::get)
.emptyBackground(177, 123)
.build("coking", CokingCategory::new),
industrial_blasting = builder(IndustrialBlastingRecipe.class)
.addTypedRecipes(TFMGRecipeTypes.INDUSTRIAL_BLASTING)
.catalyst(TFMGBlocks.BLAST_FURNACE_OUTPUT::get)
.catalyst(TFMGBlocks.FIREPROOF_BRICKS::get)
.itemIcon(TFMGBlocks.BLAST_FURNACE_OUTPUT.get())
.emptyBackground(177, 150)
.build("industrial_blasting", IndustrialBlastingCategory::new)
;

View File

@@ -0,0 +1,87 @@
package com.drmangotea.tfmg.recipes.jei.machines;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f;
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
import net.minecraft.world.level.block.state.properties.WallSide;
import static net.minecraft.world.level.block.WallBlock.*;
public class BlastFurnace extends AnimatedKinetics {
public BlastFurnace() {}
@Override
public void draw(PoseStack matrixStack, int xOffset, int yOffset) {
matrixStack.pushPose();
matrixStack.translate(xOffset, yOffset, 200);
matrixStack.mulPose(Vector3f.XP.rotationDegrees(-15.5f));
matrixStack.mulPose(Vector3f.YP.rotationDegrees(22.5f));
int scale = 23;
BlazeBurnerBlock.HeatLevel heatLevel = BlazeBurnerBlock.HeatLevel.SMOULDERING;
blockElement(TFMGBlocks.BLAST_FURNACE_OUTPUT.getDefaultState())
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICKS.getDefaultState())
.atLocal(0,0,-1)
.scale(scale)
.render(matrixStack);
for(int i = 0; i<4;i++) {
if(i !=0)
blockElement(TFMGBlocks.FIREPROOF_BRICKS.getDefaultState())
.atLocal(0, -i, 0)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICKS.getDefaultState())
.atLocal(0, -i, -2)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICKS.getDefaultState())
.atLocal(-1, -i, -1)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICKS.getDefaultState())
.atLocal(1, -i, -1)
.scale(scale)
.render(matrixStack);
if(i!=3){
blockElement(TFMGBlocks.FIREPROOF_BRICK_REINFORCEMENT.getDefaultState().setValue(NORTH_WALL, WallSide.TALL).setValue(WEST_WALL, WallSide.TALL))
.atLocal(1, -i, 0)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICK_REINFORCEMENT.getDefaultState().setValue(SOUTH_WALL, WallSide.TALL).setValue(WEST_WALL, WallSide.TALL))
.atLocal(1, -i, -2)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICK_REINFORCEMENT.getDefaultState().setValue(NORTH_WALL, WallSide.TALL).setValue(EAST_WALL, WallSide.TALL))
.atLocal(-1, -i, 0)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.FIREPROOF_BRICK_REINFORCEMENT.getDefaultState().setValue(SOUTH_WALL, WallSide.TALL).setValue(EAST_WALL, WallSide.TALL))
.atLocal(-1, -i, -2)
.scale(scale)
.render(matrixStack);
}
}
matrixStack.scale(scale, -scale, scale);
matrixStack.translate(0, -1.8, 0);
matrixStack.popPose();
}
}

View File

@@ -0,0 +1,84 @@
package com.drmangotea.tfmg.recipes.jei.machines;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.Mth;
import net.minecraft.world.level.block.Blocks;
public class CokeOven extends AnimatedKinetics {
public CokeOven() {}
@Override
public void draw(PoseStack matrixStack, int xOffset, int yOffset) {
matrixStack.pushPose();
matrixStack.translate(xOffset, yOffset, 200);
matrixStack.mulPose(Vector3f.XP.rotationDegrees(-15.5f));
matrixStack.mulPose(Vector3f.YP.rotationDegrees(22.5f));
int scale = 23;
BlazeBurnerBlock.HeatLevel heatLevel = BlazeBurnerBlock.HeatLevel.SMOULDERING;
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,0,1)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,0,2)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,1,0)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,1,1)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,1,2)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,-1,0)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,-1,1)
.scale(scale)
.render(matrixStack);
blockElement(TFMGBlocks.COKE_OVEN.getDefaultState())
.atLocal(0,-1,2)
.scale(scale)
.render(matrixStack);
matrixStack.scale(scale, -scale, scale);
matrixStack.translate(0, -1.8, 0);
matrixStack.popPose();
}
}

View File

@@ -25,9 +25,7 @@ public class Distillery extends AnimatedKinetics {
public Distillery() {
}
public Distillery() {}
@Override
public void draw(PoseStack matrixStack, int xOffset, int yOffset) {

View File

@@ -9,6 +9,8 @@ import com.drmangotea.tfmg.content.deposits.surface_scanner.SurfaceScannerRender
import com.drmangotea.tfmg.content.deposits.surface_scanner.SurfaceScannerTileEntity;
import com.drmangotea.tfmg.content.machines.metal_processing.blast_furnace.blast_furnace_output.BlastFurnaceOutputBlockEntity;
import com.drmangotea.tfmg.content.machines.metal_processing.blast_furnace.blast_furnace_output.BlastFurnaceRenderer;
import com.drmangotea.tfmg.content.machines.metal_processing.coke_oven.CokeOvenBlockEntity;
import com.drmangotea.tfmg.content.machines.metal_processing.coke_oven.CokeOvenRenderer;
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;
@@ -170,6 +172,12 @@ public class TFMGBlockEntities {
.validBlocks(TFMGBlocks.BLAST_FURNACE_OUTPUT)
.register();
public static final BlockEntityEntry<CokeOvenBlockEntity> COKE_OVEN = REGISTRATE
.blockEntity("coke_oven", CokeOvenBlockEntity::new)
.renderer(() -> CokeOvenRenderer::new)
.validBlocks(TFMGBlocks.COKE_OVEN)
.register();
public static void register() {}
}

View File

@@ -12,6 +12,8 @@ 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.metal_processing.blast_furnace.blast_furnace_output.BlastFurnaceOutputBlock;
import com.drmangotea.tfmg.content.machines.metal_processing.coke_oven.CokeOvenBlock;
import com.drmangotea.tfmg.content.machines.metal_processing.coke_oven.CokeOvenGenerator;
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;
@@ -41,6 +43,7 @@ import com.simibubi.create.content.fluids.pipes.SmartFluidPipeGenerator;
import com.simibubi.create.content.fluids.pipes.valve.FluidValveBlock;
import com.simibubi.create.content.kinetics.BlockStressDefaults;
import com.simibubi.create.content.processing.AssemblyOperatorBlockItem;
import com.simibubi.create.content.redstone.smartObserver.SmartObserverGenerator;
import com.simibubi.create.foundation.data.*;
import com.tterrag.registrate.util.entry.BlockEntry;
import net.minecraft.client.renderer.RenderType;
@@ -364,7 +367,16 @@ public static final BlockEntry<DistillationOutputBlock> STEEL_DISTILLATION_OUTPU
.register();
//////////
public static final BlockEntry<CokeOvenBlock> COKE_OVEN = REGISTRATE.block("coke_oven", CokeOvenBlock::new)
.initialProperties(() -> Blocks.BRICKS)
.properties(p -> p.color(MaterialColor.COLOR_RED))
.properties(p -> p.requiresCorrectToolForDrops())
.blockstate(new CokeOvenGenerator()::generate)
.transform(pickaxeOnly())
.item()
.transform(customItemModel())
.lang("Coke Oven")
.register();

View File

@@ -18,6 +18,11 @@ import java.util.Map;
public class TFMGPartialModels {
public static final PartialModel
COKE_OVEN_DOOR_LEFT = block("coke_oven/door_left"),
COKE_OVEN_DOOR_RIGHT = block("coke_oven/door_right"),
COKE_OVEN_DOOR_LEFT_TOP = block("coke_oven/door_left_top"),
COKE_OVEN_DOOR_RIGHT_TOP = block("coke_oven/door_right_top"),
COAL_COKE_DUST_LAYER = block("coal_coke_dust_layer"),
PUMPJACK_HAMMER = block("pumpjack/hammer_holder"),
PUMPJACK_FRONT_ROPE = block("pumpjack/pumpjack_front_rope"),

View File

@@ -2,8 +2,10 @@ package com.drmangotea.tfmg.registry;
import com.drmangotea.tfmg.CreateTFMG;
import com.drmangotea.tfmg.recipes.coking.CokingRecipe;
import com.drmangotea.tfmg.recipes.distillation.DistillationRecipe;
import com.drmangotea.tfmg.recipes.distillation.AdvancedDistillationRecipe;
import com.drmangotea.tfmg.recipes.industrial_blasting.IndustrialBlastingRecipe;
import com.google.common.collect.ImmutableSet;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder.ProcessingRecipeFactory;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeSerializer;
@@ -29,8 +31,11 @@ import java.util.function.Supplier;
public enum TFMGRecipeTypes implements IRecipeTypeInfo {
INDUSTRIAL_BLASTING(IndustrialBlastingRecipe::new),
COKING(CokingRecipe::new),
DISTILLATION(DistillationRecipe::new),
ADVANCED_DISTILLATION(AdvancedDistillationRecipe::new);
ADVANCED_DISTILLATION(AdvancedDistillationRecipe::new)
;
private final ResourceLocation id;
private final RegistryObject<RecipeSerializer<?>> serializerObject;

View File

@@ -2,9 +2,11 @@
"itemGroup.tfmg.base": "Create: The Factory Must Grow",
"itemGroup.tfmg.building": "Create: TFMG's Building Blocks",
"create.goggles.misc.number": "%1$s",
"create.goggles.misc.percent_symbol": "%",
"create.goggles.misc.dot_one": ".",
"create.goggles.misc.dot_two": "..",
"create.goggles.misc.dot_three": "...",
"create.goggles.misc.storage_info": "Storage Info:",
"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",
@@ -17,7 +19,7 @@
"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",
"create.goggles.blast_furnace.stats": "Blast Furnace Stats:",
"create.goggles.blast_furnace.stats": "Blast Furnace:",
"create.goggles.blast_furnace.size_stats": "Size Stats:",
"create.goggles.blast_furnace.fuel_amount": "Fuel Amount: %1$s",
"create.goggles.blast_furnace.item_count": "Item Count: %1$s",
@@ -27,5 +29,12 @@
"create.goggles.blast_furnace.status.running": "Status: Running",
"create.goggles.blast_furnace.status.finished": "Status: Process Finished",
"create.goggles.blast_furnace.diameter.one": "Diameter: 1",
"create.goggles.blast_furnace.diameter.two": "Diameter: 2"
"create.goggles.blast_furnace.diameter.two": "Diameter: 2",
"create.goggles.coke_oven.status": "Coke Oven:",
"create.goggles.coke_oven.fluid_amount_output": "Fluid Amount In Internal Tank: %1$s mb",
"create.goggles.coke_oven.fluid_amount_exhaust": "Carbon Dioxide: %1$s mb",
"create.goggles.coke_oven.item_count": "Item Count In Internal Storage: %1$s",
"create.goggles.coke_oven.invalid": "Coke Oven Invalid",
"create.goggles.coke_oven.tank_full": "One of Internal Tanks Is Full",
"create.goggles.coke_oven.progress": "Progress: %1$s"
}

View File

@@ -13,8 +13,7 @@
"east": {"uv": [0, 0, 16, 0], "texture": "#0"},
"south": {"uv": [0, 0, 16, 0], "texture": "#0"},
"west": {"uv": [0, 0, 16, 0], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
"up": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven_front_bottom_off"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven_front_bottom_on"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven_front_middle_off"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven_front_middle_on"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven_front_top_off"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "tfmg:block/coke_oven/controller",
"textures": {
"front": "tfmg:block/coke_oven_front_top_on"
}
}

View File

@@ -0,0 +1,12 @@
{
"parent": "minecraft:block/cube",
"textures": {
"particle": "tfmg:block/coke_oven",
"down": "tfmg:block/coke_oven",
"up": "tfmg:block/coke_oven",
"north": "tfmg:block/coke_oven",
"east": "tfmg:block/coke_oven",
"south": "#front",
"west": "tfmg:block/coke_oven"
}
}

View File

@@ -0,0 +1,21 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "tfmg:block/coke_oven_door",
"particle": "tfmg:block/coke_oven_door"
},
"elements": [
{
"from": [0, 0, 16.01],
"to": [8, 16, 16.01],
"faces": {
"north": {"uv": [12, 0, 16, 8], "texture": "#0"},
"east": {"uv": [0, 0, 0, 16], "texture": "#0"},
"south": {"uv": [8, 0, 12, 8], "texture": "#0"},
"west": {"uv": [0, 0, 0, 16], "texture": "#0"},
"up": {"uv": [0, 0, 8, 0], "texture": "#0"},
"down": {"uv": [0, 0, 8, 0], "texture": "#0"}
}
}
]
}

View File

@@ -0,0 +1,21 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "tfmg:block/coke_oven_door",
"particle": "tfmg:block/coke_oven_door"
},
"elements": [
{
"from": [0, 0, 16.01],
"to": [8, 32, 16.01],
"faces": {
"north": {"uv": [4, 0, 8, 16], "texture": "#0"},
"east": {"uv": [0, 0, 0, 16], "texture": "#0"},
"south": {"uv": [8, 0, 4, 16], "texture": "#0"},
"west": {"uv": [0, 0, 0, 16], "texture": "#0"},
"up": {"uv": [0, 0, 8, 0], "texture": "#0"},
"down": {"uv": [0, 0, 8, 0], "texture": "#0"}
}
}
]
}

View File

@@ -0,0 +1,21 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "tfmg:block/coke_oven_door",
"particle": "tfmg:block/coke_oven_door"
},
"elements": [
{
"from": [8, 0, 16.01],
"to": [16, 16, 16.01],
"faces": {
"north": {"uv": [16, 0, 12, 8], "texture": "#0"},
"east": {"uv": [0, 0, 0, 16], "texture": "#0"},
"south": {"uv": [12, 0, 16, 8], "texture": "#0"},
"west": {"uv": [0, 0, 0, 16], "texture": "#0"},
"up": {"uv": [0, 0, 8, 0], "texture": "#0"},
"down": {"uv": [0, 0, 8, 0], "texture": "#0"}
}
}
]
}

View File

@@ -0,0 +1,21 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "tfmg:block/coke_oven_door",
"particle": "tfmg:block/coke_oven_door"
},
"elements": [
{
"from": [8, 0, 16.01],
"to": [16, 32, 16.01],
"faces": {
"north": {"uv": [0, 0, 4, 16], "texture": "#0"},
"east": {"uv": [0, 0, 0, 16], "texture": "#0"},
"south": {"uv": [4, 0, 0, 16], "texture": "#0"},
"west": {"uv": [0, 0, 0, 16], "texture": "#0"},
"up": {"uv": [0, 0, 8, 0], "texture": "#0"},
"down": {"uv": [0, 0, 8, 0], "texture": "#0"}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

View File

@@ -0,0 +1,22 @@
{
"type": "tfmg:coking",
"ingredients": [
{
"count": 20,
"item": "minecraft:coal"
}
],
"processingTime": 200,
"results": [
{
"count": 20,
"item": "tfmg:coal_coke"
}
,
{
"fluid": "tfmg:heavy_oil",
"amount": 4
}
]
}

View File

@@ -0,0 +1,19 @@
{
"type": "tfmg:coking",
"ingredients": [
{
"item": "minecraft:sand"
}
],
"processingTime": 200,
"results": [
{
"item": "minecraft:red_sand"
},
{
"fluid": "tfmg:creosote",
"amount": 30
}
]
}

View File

@@ -0,0 +1,21 @@
{
"type": "tfmg:industrial_blasting",
"ingredients": [
{
"count": 20,
"item": "minecraft:coal"
}
],
"processingTime": 200,
"results": [
{
"fluid": "tfmg:creosote",
"amount": 30
},
{
"fluid": "tfmg:heavy_oil",
"amount": 4
}
]
}

View File

@@ -0,0 +1,20 @@
{
"type": "tfmg:industrial_blasting",
"ingredients": [
{
"item": "minecraft:sand"
}
],
"processingTime": 200,
"results": [
{
"fluid": "tfmg:creosote",
"amount": 30
},
{
"fluid": "tfmg:creosote",
"amount": 30
}
]
}