aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/core/xmod
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-07-16 01:25:59 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-07-16 01:25:59 +1000
commit4a13295a85f96b5506a0eaafe9a7f7ac8b0d7013 (patch)
tree3ec711e71aa1f6b8e2a4963b3ef9f4f3e9357bf6 /src/Java/miscutil/core/xmod
parentbc05626aaa3fc6898ecdbf9aeee0aac081dd7e99 (diff)
downloadGT5-Unofficial-4a13295a85f96b5506a0eaafe9a7f7ac8b0d7013.tar.gz
GT5-Unofficial-4a13295a85f96b5506a0eaafe9a7f7ac8b0d7013.tar.bz2
GT5-Unofficial-4a13295a85f96b5506a0eaafe9a7f7ac8b0d7013.zip
$ Fixed Mass Fabricator Recipe not working.
> Still yet to add a EU -> UUM recipe.
Diffstat (limited to 'src/Java/miscutil/core/xmod')
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java7
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java10
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java4
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java439
4 files changed, 310 insertions, 150 deletions
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java
index d2e5d3f120..eaa76c36e7 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java
@@ -1,5 +1,6 @@
package miscutil.core.xmod.gregtech.api.enums;
+import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
@@ -66,12 +67,12 @@ public class GregtechTextures {
@Override
public void run() {
- mIcon = CORE.GT_BlockIcons.registerIcon(CORE.RES_PATH_BLOCK + "iconsets/" + this);
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
}
-
+
@Override
public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture; //TODO
+ return TextureMap.locationBlocksTexture;
}
public static class CustomIcon implements IIconContainer, Runnable {
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
index 7c75489cef..7f31d30c89 100644
--- a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
+++ b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
@@ -183,7 +183,7 @@ public class GregtechRecipe {
break;
// Gas Turbine
case 1:
- //Gregtech_Recipe_Map.sTurbineFuels.addRecipe(this);
+ Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(this);
break;
// Thermal Generator
case 2:
@@ -302,11 +302,11 @@ public class GregtechRecipe {
*/
public static final Collection<Gregtech_Recipe_Map> sMappings = new ArrayList<Gregtech_Recipe_Map>();
//public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
- public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 2, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true);
//public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
-
+ public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
/**
* HashMap of Recipes based on their Items
@@ -416,6 +416,8 @@ public class GregtechRecipe {
}
return add(aRecipe);
}
+
+
/**
* Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
index b6a71c128c..55e5f28cb1 100644
--- a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -65,7 +65,7 @@ extends GregtechMetaCasingBlocksAbstract {
switch (aMeta) {
//Centrifuge
case 0:
- return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon();
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
//Coke Oven Frame
case 1:
return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon();
@@ -92,7 +92,7 @@ extends GregtechMetaCasingBlocksAbstract {
return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
//Matter Fabricator Casings
case 9:
- return Textures.BlockIcons.MACHINE_CASING_MAGIC.getIcon();
+ return Textures.BlockIcons.MACHINE_CASING_DRAGONEGG.getIcon();
//Iron Blast Fuance Textures
case 10:
return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
index 3c72955125..1650800116 100644
--- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
@@ -18,7 +18,9 @@ import java.util.Arrays;
import miscutil.core.block.ModBlocks;
import miscutil.core.util.Utils;
+import miscutil.core.util.item.UtilsItems;
import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
+import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
@@ -27,60 +29,168 @@ import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.ArrayUtils;
public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_MultiBlockBase {
-
+
public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3215;
- public static boolean sRequiresUUA = false;
- //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+ private int recipeCounter = 0;
+ private static Block IC2Glass = Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass"));
+ //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
- public GregtechMetaTileEntityMassFabricator(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
+ public GregtechMetaTileEntityMassFabricator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
- public GregtechMetaTileEntityMassFabricator(String aName) {
- super(aName);
- }
+ public GregtechMetaTileEntityMassFabricator(String aName) {
+ super(aName);
+ }
- public String[] getDescription() {
- return new String[]{
- "Controller Block for the Pyrolyse Oven",
- "Industrial Charcoal producer and Oil from Plants",
- "Size(WxHxD): 5x4x5, Controller (Bottom center)",
- "3x1x3 Kanthal Heating Coils (Inside bottom 5x1x5 layer)",
- "9x Kanthal Heating Coils (Centered 3x1x3 area in Bottom layer)",
- "1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)",
- "1x Output Hatch/Bus (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)",
- "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
- "1x Energy Hatch (Any bottom layer casing)",
- "ULV Machine Casings for the rest (60 at least!)"};
- }
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Pyrolyse Oven",
+ "Industrial Charcoal producer and Oil from Plants",
+ "Size(WxHxD): 5x4x5, Controller (Bottom center)",
+ "3x1x3 Kanthal Heating Coils (Inside bottom 5x1x5 layer)",
+ "9x Kanthal Heating Coils (Centered 3x1x3 area in Bottom layer)",
+ "1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)",
+ "1x Output Hatch/Bus (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)",
+ "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
+ "1x Energy Hatch (Any bottom layer casing)",
+ "ULV Machine Casings for the rest (60 at least!)"};
+ }
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
- }
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66]};
- }
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66]};
+ }
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
- public void onConfigLoad(GT_Config aConfig) {
- super.onConfigLoad(aConfig);
- sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
- sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
- sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
- sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
- Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
+ @Override
+ public void onConfigLoad(GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
+ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
+ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
+ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
+ Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
+ }
+ /*@Override
+ public boolean checkRecipe(ItemStack aStack) {
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ Utils.LOG_INFO("Stored Fluid Amount: "+tFluidList.size());
+ for (int i = 0; i < tFluidList.size(); i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+
+ for (FluidStack temp : tFluidList) {
+ Utils.LOG_INFO("Stored Fluid is: "+temp.getLocalizedName()+", There is "+temp.amount+"L of it.");
+ }
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ FluidStack tFluids = tFluidList.get(0);
+ FluidStack[] tFluids1 = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
+ if (tFluids.amount > 0) {
+ GT_Recipe tRecipe = GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids}, new ItemStack[]{});
+ if (tRecipe != null) {
+
+ for (FluidStack temp : tRecipe.mFluidOutputs) {
+ Utils.LOG_INFO("Variable Output Fluid is: "+temp.getLocalizedName()+", There is "+temp.amount+"L of it.");
+ }
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = tRecipe.mFluidOutputs.clone();
+ ArrayUtils.reverse(mOutputFluids);
+ updateSlots();
+ Utils.LOG_INFO("Good Recipe");
+ return true;
+ }
+
+ if (tFluids1.length > 0) {
+ for(int i = 0;i<tFluids1.length;i++){
+ GT_Recipe tRecipe1 = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids1[i]}, new ItemStack[]{});
+
+ if (tRecipe1 != null) {
+
+ for (FluidStack temp : tRecipe1.mFluidOutputs) {
+ Utils.LOG_INFO("Variable Output Fluid is: "+temp.getLocalizedName()+", There is "+temp.amount+"L of it.");
+ }
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe1.mEUt <= 16) {
+ this.mEUt = (tRecipe1.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe1.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe1.mEUt;
+ this.mMaxProgresstime = tRecipe1.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe1.getOutput(0)};
+ this.mOutputFluids = tRecipe1.mFluidOutputs.clone();
+ ArrayUtils.reverse(mOutputFluids);
+ updateSlots();
+ Utils.LOG_INFO("Good Recipe");
+ return true;
+ }
+ }
+ }
+ Utils.LOG_INFO("Bad Recipe");
+ }
+ if (tFluids.amount <= 0) {
+ Utils.LOG_INFO("Bad Fluid amount");
+ }
+ return false;
+ }*/
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
ArrayList<FluidStack> tFluidList = getStoredFluids();
for (int i = 0; i < tFluidList.size() - 1; i++) {
for (int j = i + 1; j < tFluidList.size(); j++) {
@@ -123,116 +233,163 @@ public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_Mult
this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
this.mOutputFluids = tRecipe.mFluidOutputs.clone();
ArrayUtils.reverse(mOutputFluids);
+ recipeCounter++;
updateSlots();
- Utils.LOG_INFO("Good Recipe");
+ Utils.LOG_INFO("Recipes Finished: "+recipeCounter);
return true;
}
}
+ else {
+ Utils.LOG_INFO("Invalid Recipe");
+ }
}
}
- Utils.LOG_INFO("Bad Recipe");
return false;
}
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
- for (int i = -2; i < 3; i++) {
- for (int j = -2; j < 3; j++) {
- for (int h = 0; h < 4; h++) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
- if (h == 0) {// innen boden (kantal coils)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- } else if (h == 3) {// innen decke (ulv casings + input + muffler)
- if ((!addInputToMachineList(tTileEntity, 66)) && (!addMufflerToMachineList(tTileEntity, 66))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- }
- } else {// innen air
- if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- }
- } else {// Au�erer 5x5 ohne h�he
- if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
- if ((!addMaintenanceToMachineList(tTileEntity, 66)) && (!addOutputToMachineList(tTileEntity, 66)) && (!addEnergyInputToMachineList(tTileEntity, 66))) {
- if ((xDir + i != 0) || (zDir + j != 0)) {//no controller
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- }
- }
- } else {// au�en �ber boden (ulv casings)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
- Utils.LOG_INFO("Multiblock Invalid.");
- return false;
- }
- }
- }
- }
- }
- }
- Utils.LOG_INFO("Multiblock Formed.");
- return true;
- }
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+ for (int i = -2; i < 3; i++) {
+ for (int j = -2; j < 3; j++) {
+ for (int h = 0; h < 4; h++) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ /*if (tTileEntity == Blocks.air) {
+ Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
+ double tX = tTileEntity.getXCoord();
+ double tY = tTileEntity.getYCoord();
+ double tZ = tTileEntity.getZCoord();
+ Utils.LOG_INFO("Found Air at X:"+tX+" Y:"+tY+" Z:"+tZ);
+ //return false;
+ }*/
+ if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
+ if (h == 0) {// innen boden (kantal coils)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ } else if (h == 3) {// innen decke (ulv casings + input + muffler)
+ if ((!addMufflerToMachineList(tTileEntity, 66))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ } else {// innen air
+ if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ } else {// Outer 5x5
+ if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
+ if ((!addMaintenanceToMachineList(tTileEntity, 66)) && (!addInputToMachineList(tTileEntity, 66)) && (!addOutputToMachineList(tTileEntity, 66)) && (!addEnergyInputToMachineList(tTileEntity, 66))) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {//no controller
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid.");
+ return false;
+ }
+ }
+ }
+ } else {// au�en �ber boden (ulv casings)
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
+ /*//Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
+ if (h == 1 || h == 2) {
+ //Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
+ //if ((i < 2 && i > -2) && (j == 0) || (i == 0) && (j < 2 && j > -2)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) {
+ double tX = tTileEntity.getXCoord();
+ double tY = tTileEntity.getYCoord();
+ double tZ = tTileEntity.getZCoord();
+ Utils.LOG_INFO("Found Not Glass at X:"+tX+" Y:"+tY+" Z:"+tZ);
+ Utils.LOG_INFO("Multiblock Invalid. No Glass.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ double tX = tTileEntity.getXCoord();
+ double tY = tTileEntity.getYCoord();
+ double tZ = tTileEntity.getZCoord();
+ Utils.LOG_INFO("Found Not Glass at X:"+tX+" Y:"+tY+" Z:"+tZ);
+ Utils.LOG_INFO("Multiblock Invalid. No Glass.");
+ return false;
+ }
+ //}
+ //Utils.LOG_INFO("h:"+h+" i:"+i+" j:"+j);
+ //if ((i == 2 || i == -2) && (j == 0) || (i == 0) && (j == 2 && j == -2)){
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid. No Corner Blocks.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid. No Corner Blocks.");
+ return false;
+ }
+ //}
+ } */
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Multiblock Invalid. 1");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Multiblock Invalid. 1");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ Utils.LOG_INFO("Multiblock Formed.");
+ return true;
+ }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 20;
- }
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
- @Override
- public int getAmountOfOutputs() {
- return 0;
- }
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 20;
+ }
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntityMassFabricator(this.mName);
- }
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityMassFabricator(this.mName);
+ }
} \ No newline at end of file