Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Adds Input Filters to TT Multis
Browse files Browse the repository at this point in the history
  • Loading branch information
bartimaeusnek committed Jan 11, 2021
1 parent d1ffbd2 commit 305cc46
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ protected TT_Abstract_GT_Replacement(String aName) {
super(aName);
}

protected void setInputFilters() {
this.mInputBusses.forEach(x -> x.mRecipeMap = this.getRecipeMap());
this.mInputHatches.forEach(x -> x.mRecipeMap = this.getRecipeMap());
}

@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", ePowerPass,false,true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,15 @@ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemS

this.mHeatingCapacity = (int) this.getCoilHeat().getHeat();
this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
setInputFilters();
return ret;
}

@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
}

@Override
public void construct(ItemStack itemStack, boolean b) {
this.structureBuild_EM("main", 1,3,0, b, itemStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemS
.noneMatch(x -> x == this.getExtendedFacing().getRelativeUpInWorld().ordinal()))
return false;

setInputFilters();
return ret;
}

@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
}

@Override
public void construct(ItemStack itemStack, boolean b) {
this.structureBuild_EM("main", 1,1,0, b, itemStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,27 @@

package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement;

import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference;
import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder;
import com.github.bartimaeusnek.crossmod.tectech.helper.IHasCoils;
import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.structure.IStructureDefinition;
import com.github.technus.tectech.mechanics.structure.StructureDefinition;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import gregtech.api.GregTech_API;
import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.ITurnable;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.*;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;

import java.util.ArrayList;

Expand Down Expand Up @@ -142,9 +132,15 @@ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemS

this.mLevel = this.getCoilHeat().getLevel();
this.mCostDiscount = this.getCoilHeat().getCostDiscount();
setInputFilters();
return ret;
}

@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes;
}

@Override
public void construct(ItemStack itemStack, boolean b) {
this.structureBuild_EM("main", 1,2,0, b, itemStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,14 @@ public final boolean addMiddleFluidHatch(IGregTechTileEntity aTileEntity, int aB
protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
this.setCoilHeat(HeatingCoilLevel.None);
this.blocks = 0;
return this.structureCheck_EM("main", 2,1,0)
&& this.blocks >= 18;
boolean ret = this.structureCheck_EM("main", 2,1,0);
setInputFilters();
return ret && this.blocks >= 18;
}

@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return GT_Recipe.GT_Recipe_Map.sCrakingRecipes;
}

public final boolean addOutputFluidHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,15 @@ public String[] getDescription() {
@Override
protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
this.blocks = 0;
return this.structureCheck_EM("main", 1,1,0)
boolean ret = this.structureCheck_EM("main", 1,1,0)
&& this.blocks >= 16;
setInputFilters();
return ret;
}

@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
return GT_Recipe.GT_Recipe_Map.sVacuumRecipes;
}

@SideOnly(Side.CLIENT)
Expand Down

0 comments on commit 305cc46

Please sign in to comment.