aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-05-12 11:09:03 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-05-12 11:09:03 +1000
commite5193543b16561e0f6b13ba0a347d94092d8a9b4 (patch)
tree3eb027829664acf287f4338e0023d416606296b4 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines
parent4109c9575dd6d8a89f03e1242493dca228255570 (diff)
downloadGT5-Unofficial-e5193543b16561e0f6b13ba0a347d94092d8a9b4.tar.gz
GT5-Unofficial-e5193543b16561e0f6b13ba0a347d94092d8a9b4.tar.bz2
GT5-Unofficial-e5193543b16561e0f6b13ba0a347d94092d8a9b4.zip
+ Thermal Boiler now pulls lava filters from an input bus.
+ Added some minor GUI functions to GregtechMeta_MultiBlockBase. + Added some new Reflection functions.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
index 5ab9cd9795..c55fe10829 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java
@@ -7,6 +7,7 @@ import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
@@ -19,6 +20,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
@@ -68,13 +70,29 @@ extends GregtechMeta_MultiBlockBase
@Override
public int getDamageToComponent(ItemStack aStack){
- Logger.INFO("Trying to damage component.");
+ //log("Trying to damage component.");
return ItemList.Component_LavaFilter.get(1L).getClass().isInstance(aStack) ? 1 : 0;
}
+
+ private static Item mLavaFilter;
@Override
- public boolean checkRecipe(final ItemStack aStack) {
+ public boolean checkRecipe(ItemStack aStack) {
this.mSuperEfficencyIncrease=0;
+
+ if (mLavaFilter == null) {
+ mLavaFilter = ItemList.Component_LavaFilter.getItem();
+ }
+
+ //Try reload new Lava Filter
+ if (aStack == null) {
+ ItemStack uStack = this.findItemInInventory(mLavaFilter);
+ if (uStack != null) {
+ this.setGUIItemStack(uStack);
+ aStack = this.getGUIItemStack();
+ }
+ }
+
for (GT_Recipe tRecipe : Recipe_GT.Gregtech_Recipe_Map.sThermalFuels.mRecipeList) {
FluidStack tFluid = tRecipe.mFluidInputs[0];
@@ -85,7 +103,7 @@ extends GregtechMeta_MultiBlockBase
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
int loot_MAXCHANCE = 100000;
- if (ItemList.Component_LavaFilter.get(1L).getClass().isInstance(aStack)) {
+ if (mLavaFilter.getClass().isInstance(aStack.getItem())) {
if ((tRecipe.getOutput(0) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(0))) {
this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(0) }) };
@@ -199,8 +217,9 @@ extends GregtechMeta_MultiBlockBase
"Size: 3x3x3 (Hollow)",
"Thermal Containment Casings (10 at least!)",
"Controller (front middle)",
- "2x Input Hatch",
+ "2x Input Hatch (Water/Thermal Fluid)",
"1x Output Hatch (Steam)",
+ "1x Input Bus (Supplies controller with Lava Filters, optional)",
"1x Output Bus (Filter results, optional)",
};
}
@@ -234,7 +253,7 @@ extends GregtechMeta_MultiBlockBase
if (!isValidBlockForStructure(tTileEntity, 1, true, aBlock, aMeta,
ModBlocks.blockCasings2Misc, 11)) {
- Logger.INFO("Bad Thermal Boiler casing");
+ log("Bad Thermal Boiler casing");
return false;
}
++tAmount;