diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
2 files changed, 28 insertions, 11 deletions
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 2427815295..b55157e763 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 @@ -38,6 +38,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gtPlusPlus.GTplusplus; +import gtPlusPlus.GTplusplus.INIT_PHASE; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; @@ -904,10 +906,15 @@ GT_MetaTileEntity_MultiBlockBase { public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity, - final int aBaseCasingIndex) { + final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { - log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString()); + if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { + log("Adding " + aTileEntity.getInventoryName() + " at " + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString()); + } updateTexture(aTileEntity, aBaseCasingIndex); return aList.add((E) aTileEntity); } @@ -920,13 +927,17 @@ GT_MetaTileEntity_MultiBlockBase { BlockPos aPos = new BlockPos(b); if (b != null && aPos != null) { if (aCurPos.equals(aPos)) { - log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString()); + if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { + log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString()); + } return false; } } } if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { - log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString()); + if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { + log("Adding " + aCur.getInventoryName() + " at " + aCurPos.getLocationString()); + } updateTexture(aTileEntity, aBaseCasingIndex); return aList.add((E) aTileEntity); } @@ -1607,7 +1618,9 @@ GT_MetaTileEntity_MultiBlockBase { } else if (aFoundBlock != aExpectedBlock) { log("A1 - Found: "+aFoundBlock.getLocalizedName()+":"+aFoundMeta+", Expected: "+aExpectedBlock.getLocalizedName()+":"+aExpectedMeta); - log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString())); + if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { + log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString())); + } return false; } else if (aFoundMeta != aExpectedMeta) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index 25c14a68e7..f2e3b3c3c0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -17,7 +17,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; - import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.EntityUtils; @@ -457,7 +456,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } } - public BlockPos getTileEntityPosition(){ + public BlockPos getTileEntityPosition(){ return new BlockPos(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld()); } @@ -533,10 +532,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public void onServerStart() { mWirelessChargingMap.clear(); - mLocalChargingMap.clear(); - if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){ - mHasBeenMapped = true; - } + mLocalChargingMap.clear(); super.onServerStart(); } @@ -552,4 +548,12 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { super.doExplosion(aExplosionPower); } + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (!mHasBeenMapped && ChargingHelper.addEntry(getTileEntityPosition(), this)){ + mHasBeenMapped = true; + } + super.onPreTick(aBaseMetaTileEntity, aTick); + } + }
\ No newline at end of file |