Might fix SHIT with wires.
This commit is contained in:
parent
0caffe3365
commit
cc08c02610
1 changed files with 16 additions and 4 deletions
|
@ -40,7 +40,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
||||||
public final boolean mInsulated, mCanShock;
|
public final boolean mInsulated, mCanShock;
|
||||||
public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
|
public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
|
||||||
public long mRestRF;
|
public long mRestRF;
|
||||||
public short mOverheat;
|
public short mOverheat,mLastOverheat;
|
||||||
|
|
||||||
public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
|
public GT_MetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
|
||||||
super(aID, aName, aNameRegional, 0);
|
super(aID, aName, aNameRegional, 0);
|
||||||
|
@ -201,11 +201,22 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
||||||
mTransferredAmperage += rUsedAmperes;
|
mTransferredAmperage += rUsedAmperes;
|
||||||
mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
|
mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
|
||||||
mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
|
mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
|
||||||
if (aVoltage > mVoltage || mTransferredAmperage > mAmperage) {
|
boolean didOverheat=false;
|
||||||
if(mOverheat>GT_Mod.gregtechproxy.mWireHeatingTicks * 100){
|
if (aVoltage > mVoltage) {
|
||||||
getBaseMetaTileEntity().setToFire();}else{mOverheat +=100;}
|
mOverheat+=Math.max(100,100*(GT_Utility.getTier(aVoltage)-GT_Utility.getTier(mVoltage)));
|
||||||
|
didOverheat=true;
|
||||||
|
}
|
||||||
|
if (mTransferredAmperage > mAmperage) {
|
||||||
|
mOverheat+=100*(mTransferredAmperage-mAmperage);
|
||||||
|
didOverheat=true;
|
||||||
|
}
|
||||||
|
if (didOverheat) {
|
||||||
|
if(mLastOverheat==0)
|
||||||
|
mLastOverheat=5;
|
||||||
return aAmperage;
|
return aAmperage;
|
||||||
}
|
}
|
||||||
|
if(mOverheat>GT_Mod.gregtechproxy.mWireHeatingTicks * 100 && mLastOverheat==0)
|
||||||
|
getBaseMetaTileEntity().setToFire();
|
||||||
return rUsedAmperes;
|
return rUsedAmperes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,6 +225,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
||||||
if (aBaseMetaTileEntity.isServerSide()) {
|
if (aBaseMetaTileEntity.isServerSide()) {
|
||||||
mTransferredAmperage = 0;
|
mTransferredAmperage = 0;
|
||||||
if(mOverheat>0)mOverheat--;
|
if(mOverheat>0)mOverheat--;
|
||||||
|
if(mLastOverheat>0)mLastOverheat--;
|
||||||
if (aTick % 20 == 0) {
|
if (aTick % 20 == 0) {
|
||||||
mTransferredVoltageLast20 = 0;
|
mTransferredVoltageLast20 = 0;
|
||||||
mTransferredAmperageLast20 = 0;
|
mTransferredAmperageLast20 = 0;
|
||||||
|
|
Loading…
Reference in a new issue