aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-12-28 14:49:46 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-12-28 14:49:46 +0000
commitae46cb2fab01f82ab49b1e63172da88e0adde212 (patch)
tree89b23a834721a94b66359342b65663eac12e7a58 /src/Java/gtPlusPlus/xmod/gregtech/common
parent3033ac1f6f071dbb8d2a5227957ccc6800616baa (diff)
downloadGT5-Unofficial-ae46cb2fab01f82ab49b1e63172da88e0adde212.tar.gz
GT5-Unofficial-ae46cb2fab01f82ab49b1e63172da88e0adde212.tar.bz2
GT5-Unofficial-ae46cb2fab01f82ab49b1e63172da88e0adde212.zip
% More work on Blueprints.
> Industrial Electrolyzer constructs as expected using new system, time to test this with more complex multis.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java43
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java33
2 files changed, 27 insertions, 49 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java
index af7a1ad97d..ca7cbca5f8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java
@@ -1,39 +1,42 @@
package gtPlusPlus.xmod.gregtech.common.blueprint;
-import gregtech.api.GregTech_API;
+import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.xmod.gregtech.api.objects.MultiblockBlueprint;
import gtPlusPlus.xmod.gregtech.api.objects.MultiblockLayer;
+import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
public class Blueprint_Generic_3x3 extends MultiblockBlueprint {
- public Blueprint_Generic_3x3(int aTextureID) {
+ public Blueprint_Generic_3x3(Pair<Block, Integer> aCasing, int aTextureID) {
super(3, 3, 3, 10, aTextureID);
-
+
// Top/Bottom
- MultiblockLayer a0 = new MultiblockLayer(3, 3);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 0, 0, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 0, 1, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 0, 2, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 1, 0, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 1, 1, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 1, 2, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 2, 0, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 2, 1, true);
- a0.addBlockForPos(GregTech_API.sBlockCasings2, 4, 2, 1, true);
+ MultiblockLayer a0 = new MultiblockLayer(3, 3);
+ Block aCasingBlock_1 = aCasing.getKey();
+ int aMeta = aCasing.getValue();
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 0, 0, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 0, 1, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 0, 2, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 1, 0, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 1, 1, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 1, 2, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 2, 0, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 2, 1, true);
+ a0.addBlockForPos(aCasingBlock_1, aMeta, 2, 2, true);
a0.lock(true);
//Layer one
MultiblockLayer a1 = new MultiblockLayer(3, 3);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 0, 0, true);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 0, 1, true);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 0, 2, true);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 1, 0, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 0, 0, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 0, 1, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 0, 2, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 1, 0, true);
a1.addBlockForPos(Blocks.air, 0, 1, 1, true);
a1.addController(1, 2);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 2, 0, true);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 2, 1, true);
- a1.addBlockForPos(GregTech_API.sBlockCasings2, 4, 2, 1, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 2, 0, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 2, 1, true);
+ a1.addBlockForPos(aCasingBlock_1, aMeta, 2, 2, true);
a1.lock(true);
this.setLayer(a0, 0);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
index dd403207b7..7fc13c4ba5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java
@@ -8,6 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -91,7 +92,7 @@ extends GregtechMeta_MultiBlockBase {
private class Blueprint_Electrolyzer extends Blueprint_Generic_3x3 {
public Blueprint_Electrolyzer() {
- super(TAE.GTPP_INDEX(5));
+ super(new Pair<Block, Integer>(ModBlocks.blockCasingsMisc, 5), TAE.GTPP_INDEX(5));
}
@Override
@@ -116,36 +117,10 @@ extends GregtechMeta_MultiBlockBase {
}
- public Blueprint_Electrolyzer mBluePrint;
+ private static Blueprint_Electrolyzer mBluePrint;
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {/*
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) {
- final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(5))) && (!this.addMufflerToMachineList(tTileEntity, TAE.GTPP_INDEX(5))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(5))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(5))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(5)))) {
- final Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- final byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (((tBlock != ModBlocks.blockCasingsMisc) || (tMeta != 5))) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 10;
- */
-
+ public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
if (mBluePrint == null) {
mBluePrint = new Blueprint_Electrolyzer();
}