aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorhuajijam <strhuaji@gmail.com>2019-02-02 23:00:59 +0800
committerhuajijam <strhuaji@gmail.com>2019-02-02 23:00:59 +0800
commit465d11f475ff755fa3965239da4efd43cc427c94 (patch)
tree99c4124ed041e191279c2cc629b7f3a65a55b6f6 /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
parent491e53a2017f5d77e9146255966625545882736c (diff)
parent754e8ab095531069181152cf9ca24c85defc1eac (diff)
downloadGT5-Unofficial-465d11f475ff755fa3965239da4efd43cc427c94.tar.gz
GT5-Unofficial-465d11f475ff755fa3965239da4efd43cc427c94.tar.bz2
GT5-Unofficial-465d11f475ff755fa3965239da4efd43cc427c94.zip
Merge remote-tracking branch 'Gt++/master'
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java41
2 files changed, 58 insertions, 16 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
index 833c1bfcc0..96df4dbfd0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
@@ -168,14 +168,31 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In
return;
}
- PlayerUtils.messagePlayer(aPlayer, "This Super Bus (I) contains:");
- for (String s : aNames) {
- if (s.startsWith(" ")) {
- s = s.substring(1);
- }
- //Logger.INFO("Trying to display Super Input Bus contents. "+s);
- PlayerUtils.messagePlayer(aPlayer, s);
- }
+ PlayerUtils.messagePlayer(aPlayer, "This Super Bus (I) contains: ["+getRealInventory().length+"]");
+
+ if (aNames.length <= 12) {
+ for (String s : aNames) {
+ if (s.startsWith(" ")) {
+ s = s.substring(1);
+ }
+ //Logger.INFO("Trying to display Super Input Bus contents. "+s);
+ PlayerUtils.messagePlayer(aPlayer, s);
+ }
+ }
+ else {
+
+ String superString = "";
+
+ for (String s : aNames) {
+ if (s.startsWith(" ")) {
+ s = s.substring(1);
+ }
+ superString += (s+"\r\n");
+ }
+ PlayerUtils.messagePlayer(aPlayer, superString);
+ }
+
+
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 39666a2d3b..892f8f332a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -912,7 +912,10 @@ GT_MetaTileEntity_MultiBlockBase {
return 0;
}
- public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
+ public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() {
+ if (this.mControlCoreBus == null || this.mControlCoreBus.isEmpty()) {
+ return null;
+ }
GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0);
if (x != null) {
log("getControlCore(ok)");
@@ -1506,11 +1509,8 @@ GT_MetaTileEntity_MultiBlockBase {
public final boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- boolean aStructureCheck = checkMultiblock(aBaseMetaTileEntity, aStack);
-
- boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores;
-
- boolean aHasCore = (aCoresConfig ? (this.getControlCoreBus() != null) : true);
+ boolean aStructureCheck = checkMultiblock(aBaseMetaTileEntity, aStack);
+ boolean aHasCore = (requireControlCores ? (this.getControlCoreBus() != null) : true);
return aStructureCheck && aHasCore;
}
@@ -1526,10 +1526,34 @@ GT_MetaTileEntity_MultiBlockBase {
return true;
}
else {
+ int aMetaTileID = aBaseMetaTileEntity.getMetaTileID();
//Found a controller
- if (aFoundMeta > 0 && aFoundMeta < 1000 && aFoundBlock == GregTech_API.sBlockMachines) {
+ if (aMetaTileID >= 750 && aMetaTileID < 1000 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ //Vanilla Hatches/Busses
+ else if (aMetaTileID >= 10 && aMetaTileID <= 99 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ //Adv Mufflers
+ else if (aMetaTileID >= 30001 && aMetaTileID <= 30009 && aFoundBlock == GregTech_API.sBlockMachines) {
return true;
}
+ //Control Core, Super IO
+ else if (aMetaTileID >= 30020 && aMetaTileID <= 30040 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ //Auto maint
+ else if (aMetaTileID == 111 && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ //Data Ports
+ else if ((aMetaTileID == 131 || aMetaTileID == 132) && aFoundBlock == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ else {
+ Logger.INFO("Found meta Tile: "+aMetaTileID);
+ }
}
}
if (!isHatch) {
@@ -1537,7 +1561,8 @@ GT_MetaTileEntity_MultiBlockBase {
return true;
}
else if (aFoundBlock != aExpectedBlock) {
- Logger.INFO("A1 - Found: "+aFoundBlock.getLocalizedName()+", Expected: "+aExpectedBlock.getLocalizedName());
+ Logger.INFO("A1 - Found: "+aFoundBlock.getLocalizedName()+":"+aFoundMeta+", Expected: "+aExpectedBlock.getLocalizedName()+":"+aExpectedMeta);
+ Logger.INFO("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
return false;
}
else if (aFoundMeta != aExpectedMeta) {