aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-05-14 10:25:14 +0200
committerTechnus <daniel112092@gmail.com>2017-05-14 10:25:14 +0200
commit2251b83addc77486de618ffa7203a31590205e01 (patch)
tree02806af28cd43a2f347c3df5ea316b76e610b5b4 /src/main/java/com
parentdbce082ed4391e40af905ed26cf09ee416b2fec6 (diff)
downloadGT5-Unofficial-2251b83addc77486de618ffa7203a31590205e01.tar.gz
GT5-Unofficial-2251b83addc77486de618ffa7203a31590205e01.tar.bz2
GT5-Unofficial-2251b83addc77486de618ffa7203a31590205e01.zip
MORE MULTIBLOCK STRUCTURES
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeMap.java26
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java32
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java31
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java30
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java25
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java35
6 files changed, 120 insertions, 59 deletions
diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeMap.java b/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeMap.java
index 6301127472..fc88726b43 100644
--- a/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeMap.java
+++ b/src/main/java/com/github/technus/tectech/elementalMatter/classes/rElementalRecipeMap.java
@@ -30,27 +30,31 @@ public class rElementalRecipeMap {//TODO FIX
put(recipe);
}
- public rElementalRecipe remove(cElementalInstanceStackMap map, short id) {
- return recipes.get(map).remove(id);
+ public rElementalRecipe remove(cElementalStackMap map, short id) {
+ return recipes.get(map).remove(id);//suspicious but ok, equals and hashcode methods are adjusted for that
}
- public HashMap<Short, rElementalRecipe> remove(cElementalInstanceStackMap map) {
- return recipes.remove(map);
+ public HashMap<Short, rElementalRecipe> remove(cElementalStackMap map) {
+ return recipes.remove(map);//suspicious but ok, equals and hashcode methods are adjusted for that
}
- //Recipe founding should not check amounts
-
+ //Recipe founding should not check amounts - this checks if the types of matter in map are equal to any recipe!
+ //Return a recipeShortMap when the content of input is equal (ignoring amounts and instance data)
+ @Deprecated
public HashMap<Short, rElementalRecipe> findExact(cElementalStackMap in) {
- return recipes.get(in);//suspicious but ok
+ return recipes.get(in);//suspicious but ok, equals and hashcode methods are adjusted for that
}
public HashMap<Short, rElementalRecipe> findExact(cElementalInstanceStackMap in) {
- return recipes.get(in);//suspicious but ok
+ return recipes.get(in.toDefinitionMapForComparison());//suspicious but ok, equals and hashcode methods are adjusted for that
}
- public HashMap<Short, rElementalRecipe> findMatch(cElementalMutableDefinitionStackMap in) {
+ //this does check if the map contains all the requirements for any recipe, and the required amounts
+ //Return a recipeShortMap when the content of input matches the recipe input - does not ignore amounts but ignores instance data!
+ @Deprecated
+ public HashMap<Short, rElementalRecipe> findMatch(cElementalMutableDefinitionStackMap in, boolean testOnlyTruePreferred) {
for (cElementalDefinitionStackMap requirement : recipes.keySet())
- if (in.removeAllAmounts(true, requirement))
+ if (in.removeAllAmounts(testOnlyTruePreferred, requirement))
return recipes.get(requirement);
return null;
}
@@ -61,4 +65,6 @@ public class rElementalRecipeMap {//TODO FIX
return recipes.get(requirement);
return null;
}
+
+ //To check for instance data and other things use recipe extensions!
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java
index 62bfb8b752..13ecbdb149 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java
@@ -1,25 +1,41 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBlockCasingsTT;
+import static gregtech.api.enums.GT_Values.E;
+
/**
* Created by danie_000 on 17.12.2016.
*/
public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_MultiblockBase_EM {
+ //region structure
private static final String[][] shape = new String[][]{
- {"",//left to right top
- "",
- ""},//front
- {},//behind front
- {} //behind
+ {E,E,E,"D000","C0 0","C0 + 0","C0 0","D000",E,E,E,},
+ {"C01A10","C01A10","D1A1","00B101B00","11111111111","C01110","11111111111","00B101B00","D1A1","C01A10","C01A10",},
+ {"C01A10","A223222322","A244242442","03442424430","12225252221","A244222442","12225252221","03442424430","A244242442","A223222322","C01A10",},
+ {"D111","A244222442","A4G4","A4G4","12G21","12G21","12G21","A4G4","A4G4","A244222442","D111",},
+ {"A0C0C0","03444244430","A4G4","A4G4","A4G4","02G20","A4G4","A4G4","A4G4","03444244430","A0C0C0",},
+ {"00C!C00","02444544420","A4G4","A4G4","A4G4","!5G5!","A4G4","A4G4","A4G4","02444544420","00C!C00",},
+ {"A0C0C0","03444244430","A4G4","A4G4","A4G4","02G20","A4G4","A4G4","A4G4","03444244430","A0C0C0",},
+ {"D111","A244222442","A4G4","A4G4","12G21","12G21","12G21","A4G4","A4G4","A244222442","D111",},
+ {"C01A10","A223222322","A244242442","03442424430","12225252221","A244222442","12225252221","03442424430","A244242442","A223222322","C01A10",},
+ {"C01A10","C01A10","D1A1","00B101B00","11111111111","C01110","11111111111","00B101B00","D1A1","C01A10","C01A10",},
+ {E,E,E,"D000","C0 0","C0 0","C0 0","D000",E,E,E,},
};
- private static final Block[] blockType = new Block[]{};
- private static final byte[] blockMeta = new byte[]{};
+ private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT};
+ private static final byte[] blockMeta = new byte[]{4, 5, 12, 6, 0, 10};
+ private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"};
+ private static final byte[] casingTextures = new byte[]{textureOffset, textureOffset + 4};
+ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMetaFallback = new byte[]{0, 4};
+ //endregion
public GT_MetaTileEntity_EM_annihilation(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -35,7 +51,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl
@Override
public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return false;
+ return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 5, 5, 0);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java
index d515174887..579e2467ae 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafter.java
@@ -1,25 +1,40 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBlockCasingsTT;
+
/**
* Created by danie_000 on 17.12.2016.
*/
public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBase_EM {
+ //region structure
private static final String[][] shape = new String[][]{
- {"",//left to right top
- "",
- ""},//front
- {},//behind front
- {} //behind
+ {"A000","0 0","0 + 0","0 0","A000",},
+ {"00000","00000","00000","00000","00000",},
+ {"0C0","A!!!","A!1!","A!!!","0C0",},
+ {"22222","22222","22122","22222","22222",},
+ {"23432","33333","43134","33333","23432",},
+ {"23332","33333","33533","33333","23332",},
+ {"23432","33333","43134","33333","23432",},
+ {"22222","22222","22122","22222","22222",},
+ {"0C0","A!!!","A!1!","A!!!","0C0",},
+ {"00000","00000","00000","00000","00000",},
+ {"A000","0 0","0 0","0 0","A000",},
};
- private static final Block[] blockType = new Block[]{};
- private static final byte[] blockMeta = new byte[]{};
+ private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT , QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMeta = new byte[]{4, 10, 5, 0, 6, 9};
+ private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"};
+ private static final byte[] casingTextures = new byte[]{textureOffset, textureOffset + 4};
+ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMetaFallback = new byte[]{0, 4};
+ //endregion
public GT_MetaTileEntity_EM_crafter(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -35,7 +50,7 @@ public class GT_MetaTileEntity_EM_crafter extends GT_MetaTileEntity_MultiblockBa
@Override
public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return false;
+ return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
index 27e873af98..2c0d4c5349 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
@@ -15,22 +15,22 @@ import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBl
public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase_EM {
//region structure
private static final String[][] shape = new String[][]{
- {"0C0", "A ", "A + ", "A ", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"00000", "01110", "01110", "01110", "00000",},
- {"0\"\"\"0", "\"111\"", "\"111\"", "\"111\"", "0\"\"\"0",},
- {"00000", "01110", "01110", "01110", "00000",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A ", "A ", "A ", "0C0",},
+ {"0C0","A ","A + ","A ","0C0",},
+ {"00000","00000","00000","00000","00000",},
+ {"0C0","A!!!","A!0!","A!!!","0C0",},
+ {"01110","12221","12221","12221","01110",},
+ {"01310","12221","32223","12221","01310",},
+ {"01110","12221","12221","12221","01110",},
+ {"0C0","A!!!","A!0!","A!!!","0C0",},
+ {"00000","00000","00000","00000","00000",},
+ {"0C0","A ","A ","A ","0C0",},
};
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 8};
- private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList", "addElementalMufflerToMachineList"};
- private static final byte[] casingTextures = new byte[]{textureOffset, textureOffset + 4, textureOffset + 4};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMetaFallback = new byte[]{0, 4, 4};
+ private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT};
+ private static final byte[] blockMeta = new byte[]{4, 5, 8, 6};
+ private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"};
+ private static final byte[] casingTextures = new byte[]{textureOffset, textureOffset + 4};
+ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMetaFallback = new byte[]{0, 4};
//endregion
public GT_MetaTileEntity_EM_decay(int aID, String aName, String aNameRegional) {
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java
index 88754398f4..dba8688cce 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java
@@ -1,25 +1,34 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBlockCasingsTT;
+
/**
* Created by danie_000 on 17.12.2016.
*/
public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM {
+ //region structure
private static final String[][] shape = new String[][]{
- {"",//left to right top
- "",
- ""},//front
- {},//behind front
- {} //behind
+ {"A010","0 0","1 + 1","0 0","A010",},
+ {"23232","32223","22222","32223","23232",},
+ {"12!21","22422","!444!","22422","12!21",},
+ {"23232","32223","22222","32223","23232",},
+ {"A010","0 0","1 1","0 0","A010",},
};
- private static final Block[] blockType = new Block[]{};
- private static final byte[] blockMeta = new byte[]{};
+ private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT ,sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9};
+ private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"};
+ private static final byte[] casingTextures = new byte[]{textureOffset, textureOffset + 4};
+ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMetaFallback = new byte[]{0, 4};
+ //endregion
public GT_MetaTileEntity_EM_stabilizer(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -35,7 +44,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc
@Override
public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return false;
+ return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0);
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
index 11bf4dff44..d3dddc4c86 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java
@@ -1,6 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -11,23 +12,37 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import static com.github.technus.tectech.thing.casing.GT_Container_CasingsTT.sBlockCasingsTT;
+import static gregtech.api.enums.GT_Values.E;
+
/**
* Created by danie_000 on 17.12.2016.
*/
-public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM {
+public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM {//TODO MAKE COMPATIBLE WITH STARGATES XD
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
- //use multi A energy inputs, use less power the longer it runs
+ //region structure
private static final String[][] shape = new String[][]{
- {"",//left to right top
- "",
- ""},//front
- {},//behind front
- {} //behind
+ {E,E,E,"C ","C + ","C ",E,E,E,},
+ {E,E,"D0","C000","B00100","C000","D0",E,E,},
+ {E,E,"D0","C2A2","B0C0","C2A2","D0",E,E,},
+ {E,"D0","D0",E,"A00C00",E,"D0","D0",E,},
+ {E,"D0",E,E,"A0E0",E,E,"D0",E,},
+ {"D0","D0",E,E,"00E00",E,E,"D0","D0",},
+ {"B00000","A0033300","003C300","03E30","03E30","03E30","003C300","A0033300","B00000",},
+ {"B0!!!0","A 31113 ","031222130","!12C21!","!12C21!","!12C21!","031222130","A 31113 ","B0!!!0",},
+ {"B0!!!0","A 31113 ","031444130","!14C41!","!14C41!","!14C41!","031444130","A 31113 ","B0!!!0",},
+ {"B0!!!0","A 31113 ","031222130","!12C21!","!12C21!","!12C21!","031222130","A 31113 ","B0!!!0",},
+ {"B00000","A0033300","003C300","03E30","03E30","03E30","003C300","A0033300","B00000",},
};
- private static final Block[] blockType = new Block[]{};
- private static final byte[] blockMeta = new byte[]{};
+ private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE ,sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMeta = new byte[]{12, 10, 0, 5, 11};
+ private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"};
+ private static final byte[] casingTextures = new byte[]{textureOffset, textureOffset + 4};
+ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT};
+ private static final byte[] blockMetaFallback = new byte[]{0, 4};
+ //endregion
public GT_MetaTileEntity_EM_wormhole(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -58,7 +73,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB
@Override
public boolean EM_checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return false;
+ return EM_StructureCheckAdvanced(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 4, 4, 0);
}
@Override