Add Quadruple and Nonuple fluid pipes; fix several issues

This commit is contained in:
Antifluxfield 2017-10-30 16:16:16 +08:00
parent f96993bd33
commit 7b0dc97594
62 changed files with 228 additions and 100 deletions

View file

@ -188,6 +188,8 @@ public enum OrePrefixes {
pipeMedium("Medium Pipes", "Medium ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80), pipeMedium("Medium Pipes", "Medium ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),
pipeLarge("Large pipes", "Large ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81), pipeLarge("Large pipes", "Large ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 6, 64, 81),
pipeHuge("Huge Pipes", "Huge ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82), pipeHuge("Huge Pipes", "Huge ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 12, 64, 82),
pipeQuadruple("Quadruple Pipes", "Quadruple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M *12, 64, 84),
pipeNonuple("Nonuple Pipes", "Nonuple ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 9, 64, 85),
pipeRestrictiveTiny("Tiny Restrictive Pipes", "Tiny Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78), pipeRestrictiveTiny("Tiny Restrictive Pipes", "Tiny Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M / 2, 64, 78),
pipeRestrictiveSmall("Small Restrictive Pipes", "Small Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79), pipeRestrictiveSmall("Small Restrictive Pipes", "Small Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 1, 64, 79),
pipeRestrictiveMedium("Medium Restrictive Pipes", "Medium Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80), pipeRestrictiveMedium("Medium Restrictive Pipes", "Medium Restrictive ", " Pipe", true, true, false, false, true, false, true, false, false, false, 0, M * 3, 64, 80),

View file

@ -103,8 +103,8 @@ public class TextureSet {
mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge"); mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge");
mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge"); mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge");
mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt"); mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt");
mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir); mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeQuadruple");
mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir); mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeNonuple");
mTextures[86] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir); mTextures[86] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
mTextures[87] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir); mTextures[87] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
mTextures[88] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir); mTextures[88] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);

View file

@ -267,10 +267,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
if ((mConnections & (1 << tSide)) == 0) { if ((mConnections & (1 << tSide)) == 0) {
if (GT_Mod.gregtechproxy.costlyCableConnection && !GT_ModHandler.consumeSolderingMaterial(aPlayer)) return false; if (GT_Mod.gregtechproxy.costlyCableConnection && !GT_ModHandler.consumeSolderingMaterial(aPlayer)) return false;
connect(tSide); if (connect(tSide) > 0)
GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
} }
else else {
disconnect(tSide); disconnect(tSide);
GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
}
return true; return true;
} }
return false; return false;

View file

@ -36,9 +36,9 @@ import static gregtech.api.enums.GT_Values.D1;
public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
public final float mThickNess; public final float mThickNess;
public final Materials mMaterial; public final Materials mMaterial;
public final int mCapacity, mHeatResistance; public final int mCapacity, mHeatResistance, mPipeAmount;
public final boolean mGasProof; public final boolean mGasProof;
public FluidStack mFluid; public final FluidStack[] mFluids;
public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0; public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
private boolean mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe; private boolean mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe;
/** /**
@ -47,21 +47,34 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
public byte mDisableInput = 0; public byte mDisableInput = 0;
public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) { public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
super(aID, aName, aNameRegional, 0); this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
}
public GT_MetaPipeEntity_Fluid(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aID, aName, aNameRegional, 0);
mThickNess = aThickNess; mThickNess = aThickNess;
mMaterial = aMaterial; mMaterial = aMaterial;
mCapacity = aCapacity; mCapacity = aCapacity;
mGasProof = aGasProof; mGasProof = aGasProof;
mHeatResistance = aHeatResistance; mHeatResistance = aHeatResistance;
mPipeAmount = aFluidTypes;
mFluids = new FluidStack[mPipeAmount];
} }
@Deprecated
public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) { public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1);
}
public GT_MetaPipeEntity_Fluid(String aName, float aThickNess, Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) {
super(aName, 0); super(aName, 0);
mThickNess = aThickNess; mThickNess = aThickNess;
mMaterial = aMaterial; mMaterial = aMaterial;
mCapacity = aCapacity; mCapacity = aCapacity;
mGasProof = aGasProof; mGasProof = aGasProof;
mHeatResistance = aHeatResistance; mHeatResistance = aHeatResistance;
mPipeAmount = aFluidTypes;
mFluids = new FluidStack[mPipeAmount];
} }
@Override @Override
@ -71,7 +84,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof); return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount);
} }
@Override @Override
@ -88,6 +101,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (tThickNess < 0.874F)//0.825 if (tThickNess < 0.874F)//0.825
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (mPipeAmount == 4)
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
if (mPipeAmount == 9)
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
} }
return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))}; return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
@ -125,7 +142,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public void saveNBTData(NBTTagCompound aNBT) { public void saveNBTData(NBTTagCompound aNBT) {
if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); for (int i = 0; i < mPipeAmount; i++)
if (mFluids[i] != null)
aNBT.setTag("mFluid"+(i==0?"":i), mFluids[i].writeToNBT(new NBTTagCompound()));
aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom); aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
if (GT_Mod.gregtechproxy.gt6Pipe) { if (GT_Mod.gregtechproxy.gt6Pipe) {
aNBT.setByte("mConnections", mConnections); aNBT.setByte("mConnections", mConnections);
@ -135,7 +154,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public void loadNBTData(NBTTagCompound aNBT) { public void loadNBTData(NBTTagCompound aNBT) {
mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); for (int i = 0; i < mPipeAmount; i++)
mFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"+(i==0?"":i)));
mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom"); mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
if (GT_Mod.gregtechproxy.gt6Pipe) { if (GT_Mod.gregtechproxy.gt6Pipe) {
if (!aNBT.hasKey("mConnections")) if (!aNBT.hasKey("mConnections"))
@ -147,13 +167,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) { public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
if (mFluid != null && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) { if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
int tTemperature = mFluid.getFluid().getTemperature(mFluid); for (FluidStack tFluid : mFluids) {
if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) { if (tFluid != null) {
GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); int tTemperature = tFluid.getFluid().getTemperature(tFluid);
} else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) { if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F); break;
} } else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F); break;
}
}
}
} }
} }
@ -193,36 +217,38 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
mLastReceivedFrom = 0; mLastReceivedFrom = 0;
} }
if (mFluid != null && mFluid.amount > 0) { for (FluidStack tFluid : mFluids) {
int tTemperature = mFluid.getFluid().getTemperature(mFluid); if (tFluid != null && tFluid.amount > 0) {
if (tTemperature > mHeatResistance) { int tTemperature = tFluid.getFluid().getTemperature(tFluid);
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) { if (tTemperature > mHeatResistance) {
aBaseMetaTileEntity.setToFire(); if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
return; aBaseMetaTileEntity.setToFire();
} return;
aBaseMetaTileEntity.setOnFire();
}
if (!mGasProof && mFluid.getFluid().isGaseous(mFluid)) {
mFluid.amount -= 5;
sendSound((byte) 9);
if (tTemperature > 320) {
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
} else if (tTemperature < 260) {
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
} }
aBaseMetaTileEntity.setOnFire();
}
if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
tFluid.amount -= 5;
sendSound((byte) 9);
if (tTemperature > 320) {
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
} else if (tTemperature < 260) {
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 2, getBaseMetaTileEntity().getYCoord() - 2, getBaseMetaTileEntity().getZCoord() - 2, getBaseMetaTileEntity().getXCoord() + 3, getBaseMetaTileEntity().getYCoord() + 3, getBaseMetaTileEntity().getZCoord() + 3))) {
GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
}
if (tFluid.amount <= 0) tFluid = null;
} }
if (mFluid.amount <= 0) mFluid = null;
} }
} }
@ -241,28 +267,31 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
} }
if (GT_Mod.gregtechproxy.gt6Pipe) mCheckConnections = false; if (GT_Mod.gregtechproxy.gt6Pipe) mCheckConnections = false;
if (mFluid != null && mFluid.amount > 0) { for (int i = 0, j = aBaseMetaTileEntity.getRandomNumber(mPipeAmount); i < mPipeAmount; i++) {
int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluid.amount / 2)), tSuccessfulTankAmount = 0; int index = (i + j) % mPipeAmount;
if (mFluids[index] != null && mFluids[index].amount > 0) {
int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluids[index].amount / 2)), tSuccessfulTankAmount = 0;
for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet()) for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet())
if (tEntry.getKey().fill(tEntry.getValue(), drain(tAmount, false), false) > 0) if (tEntry.getKey().fill(tEntry.getValue(), drainFromIndex(tAmount, false, index), false) > 0)
tSuccessfulTankAmount++; tSuccessfulTankAmount++;
if (tSuccessfulTankAmount > 0) { if (tSuccessfulTankAmount > 0) {
if (tAmount >= tSuccessfulTankAmount) { if (tAmount >= tSuccessfulTankAmount) {
tAmount /= tSuccessfulTankAmount; tAmount /= tSuccessfulTankAmount;
for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) { for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
if (mFluid == null || mFluid.amount <= 0) break; if (mFluids[index] == null || mFluids[index].amount <= 0) break;
int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false); int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
if (tFilledAmount > 0) if (tFilledAmount > 0)
tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true); tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(tFilledAmount, true, index), true);
} }
} else { } else {
for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) { for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
if (mFluid == null || mFluid.amount <= 0) break; if (mFluids[index] == null || mFluids[index].amount <= 0) break;
int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(mFluid.amount, false), false); int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(mFluids[index].amount, false, index), false);
if (tFilledAmount > 0) if (tFilledAmount > 0)
tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true); tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(tFilledAmount, true, index), true);
}
} }
} }
} }
@ -284,15 +313,21 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
if ((mDisableInput & tMask) != 0) { if ((mDisableInput & tMask) != 0) {
mDisableInput &= ~tMask; mDisableInput &= ~tMask;
GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled")); GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
if ((mConnections & tMask) == 0)
connect(tSide);
} else { } else {
mDisableInput |= tMask; mDisableInput |= tMask;
GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled")); GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
} }
} else { } else {
if ((mConnections & tMask) == 0) if ((mConnections & tMask) == 0) {
connect(tSide); if (connect(tSide) > 0)
else GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
}
else {
disconnect(tSide); disconnect(tSide);
GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
}
} }
return true; return true;
} }
@ -346,10 +381,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
} }
if (rConnect > 0) { if (rConnect > 0) {
if (GT_Mod.gregtechproxy.gt6Pipe && tFluidPipe != null) { if (GT_Mod.gregtechproxy.gt6Pipe && tFluidPipe != null) {
if ((mDisableInput == 0 || (tFluidPipe.mDisableInput & (1 << tSide)) == 0)) { if ((mDisableInput & (1 << aSide)) == 0 || (tFluidPipe.mDisableInput & (1 << tSide)) == 0) {
mConnections |= (1 << aSide); mConnections |= (1 << aSide);
if ((tFluidPipe.mConnections & (1 << tSide)) == 0) tFluidPipe.connect(tSide); if ((tFluidPipe.mConnections & (1 << tSide)) == 0) tFluidPipe.connect(tSide);
} } else rConnect = 0;
} else { } else {
mConnections |= (1 << aSide); mConnections |= (1 << aSide);
} }
@ -370,7 +405,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public final int getCapacity() { public final int getCapacity() {
return mCapacity * 20; return mCapacity * 20 * mPipeAmount;
}
@Override
public FluidTankInfo getInfo() {
for (FluidStack tFluid : mFluids) {
if (tFluid != null)
return new FluidTankInfo(tFluid, mCapacity * 20);
}
return new FluidTankInfo(null, mCapacity * 20);
}
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
if (getCapacity() <= 0 && !getBaseMetaTileEntity().hasSteamEngineUpgrade()) return new FluidTankInfo[]{};
ArrayList<FluidTankInfo> tList = new ArrayList<>();
for (FluidStack tFluid : mFluids)
tList.add(new FluidTankInfo(tFluid, mCapacity * 20));
return tList.toArray(new FluidTankInfo[mPipeAmount]);
} }
@Override @Override
@ -385,46 +438,72 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public final FluidStack getFluid() { public final FluidStack getFluid() {
return mFluid; for (FluidStack tFluid : mFluids) {
if (tFluid != null)
return tFluid;
}
return null;
} }
@Override @Override
public final int getFluidAmount() { public final int getFluidAmount() {
return mFluid != null ? mFluid.amount : 0; int rAmount = 0;
for (FluidStack tFluid : mFluids) {
if (tFluid != null)
rAmount += tFluid.amount;
}
return rAmount;
} }
@Override @Override
public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0; if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
if (mFluid == null || mFluid.getFluid().getID() <= 0) { int index = -1;
if (aFluid.amount <= getCapacity()) { for (int i = 0; i < mPipeAmount; i++) {
if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
index = i; break;
}
else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
index = i;
}
}
return fill_default_intoIndex(aSide, aFluid, doFill, index);
}
private final int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
if (index < 0 || index >= mPipeAmount) return 0;
if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
if (mFluids[index] == null || mFluids[index].getFluid().getID() <= 0) {
if (aFluid.amount * mPipeAmount <= getCapacity()) {
if (doFill) { if (doFill) {
mFluid = aFluid.copy(); mFluids[index] = aFluid.copy();
mLastReceivedFrom |= (1 << aSide.ordinal()); mLastReceivedFrom |= (1 << aSide.ordinal());
} }
return aFluid.amount; return aFluid.amount;
} }
if (doFill) { if (doFill) {
mFluid = aFluid.copy(); mFluids[index] = aFluid.copy();
mLastReceivedFrom |= (1 << aSide.ordinal()); mLastReceivedFrom |= (1 << aSide.ordinal());
mFluid.amount = getCapacity(); mFluids[index].amount = getCapacity() / mPipeAmount;
} }
return getCapacity(); return getCapacity() / mPipeAmount;
} }
if (!mFluid.isFluidEqual(aFluid)) return 0; if (!mFluids[index].isFluidEqual(aFluid)) return 0;
int space = getCapacity() - mFluid.amount; int space = getCapacity() / mPipeAmount - mFluids[index].amount;
if (aFluid.amount <= space) { if (aFluid.amount <= space) {
if (doFill) { if (doFill) {
mFluid.amount += aFluid.amount; mFluids[index].amount += aFluid.amount;
mLastReceivedFrom |= (1 << aSide.ordinal()); mLastReceivedFrom |= (1 << aSide.ordinal());
} }
return aFluid.amount; return aFluid.amount;
} }
if (doFill) { if (doFill) {
mFluid.amount = getCapacity(); mFluids[index].amount = getCapacity() / mPipeAmount;
mLastReceivedFrom |= (1 << aSide.ordinal()); mLastReceivedFrom |= (1 << aSide.ordinal());
} }
return space; return space;
@ -432,25 +511,35 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public final FluidStack drain(int maxDrain, boolean doDrain) { public final FluidStack drain(int maxDrain, boolean doDrain) {
if (mFluid == null) return null; FluidStack drained = null;
if (mFluid.amount <= 0) { for (int i = 0; i < mPipeAmount; i++) {
mFluid = null; if ((drained = drainFromIndex(maxDrain, doDrain, i)) != null)
return drained;
}
return null;
}
private final FluidStack drainFromIndex(int maxDrain, boolean doDrain, int index) {
if (index < 0 || index >= mPipeAmount) return null;
if (mFluids[index] == null) return null;
if (mFluids[index].amount <= 0) {
mFluids[index] = null;
return null; return null;
} }
int used = maxDrain; int used = maxDrain;
if (mFluid.amount < used) if (mFluids[index].amount < used)
used = mFluid.amount; used = mFluids[index].amount;
if (doDrain) { if (doDrain) {
mFluid.amount -= used; mFluids[index].amount -= used;
} }
FluidStack drained = mFluid.copy(); FluidStack drained = mFluids[index].copy();
drained.amount = used; drained.amount = used;
if (mFluid.amount <= 0) { if (mFluids[index].amount <= 0) {
mFluid = null; mFluids[index] = null;
} }
return drained; return drained;
@ -458,15 +547,23 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
@Override @Override
public int getTankPressure() { public int getTankPressure() {
return (mFluid == null ? 0 : mFluid.amount) - (getCapacity() / 2); return getFluidAmount() - (getCapacity() / 2);
} }
@Override @Override
public String[] getDescription() { public String[] getDescription() {
return new String[]{ if (mPipeAmount == 1) {
EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY, return new String[]{
EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
}; EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
};
} else {
return new String[]{
EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY,
EnumChatFormatting.AQUA + "Pipe Amount: %%%" + mPipeAmount + EnumChatFormatting.GRAY
};
}
} }
@Override @Override

View file

@ -194,10 +194,14 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (GT_Mod.gregtechproxy.gt6Pipe) { if (GT_Mod.gregtechproxy.gt6Pipe) {
byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ); byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
if ((mConnections & (1 << tSide)) == 0) if ((mConnections & (1 << tSide)) == 0) {
connect(tSide); if (connect(tSide) > 0)
else GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
}
else {
disconnect(tSide); disconnect(tSide);
GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
}
return true; return true;
} }
return false; return false;

View file

@ -317,6 +317,10 @@ public class GT_LanguageManager {
// addStringLocalization("Interaction_DESCRIPTION_Index_209", "Grab"); // addStringLocalization("Interaction_DESCRIPTION_Index_209", "Grab");
// addStringLocalization("Interaction_DESCRIPTION_Index_210", "Grab"); // addStringLocalization("Interaction_DESCRIPTION_Index_210", "Grab");
addStringLocalization("Interaction_DESCRIPTION_Index_211", "Items per side: "); addStringLocalization("Interaction_DESCRIPTION_Index_211", "Items per side: ");
addStringLocalization("Interaction_DESCRIPTION_Index_212", "Input enabled");
addStringLocalization("Interaction_DESCRIPTION_Index_213", "Input disabled");
addStringLocalization("Interaction_DESCRIPTION_Index_214", "Connected");
addStringLocalization("Interaction_DESCRIPTION_Index_215", "Disconnected");
} }

View file

@ -1,5 +1,6 @@
package gregtech.loaders.oreprocessing; package gregtech.loaders.oreprocessing;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials; import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag; import gregtech.api.enums.SubTag;
@ -19,6 +20,8 @@ public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistr
OrePrefixes.pipeRestrictiveMedium.add(this); OrePrefixes.pipeRestrictiveMedium.add(this);
OrePrefixes.pipeRestrictiveSmall.add(this); OrePrefixes.pipeRestrictiveSmall.add(this);
OrePrefixes.pipeRestrictiveTiny.add(this); OrePrefixes.pipeRestrictiveTiny.add(this);
OrePrefixes.pipeQuadruple.add(this);
OrePrefixes.pipeNonuple.add(this);
} }
@Override @Override
@ -44,6 +47,15 @@ public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistr
case pipeRestrictiveTiny: case pipeRestrictiveTiny:
gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Restrictive", ""), null, 1L, false, true), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Steel, aPrefix.mSecondaryMaterial.mAmount / OrePrefixes.ring.mMaterialAmount), GT_Utility.copyAmount(1L, new Object[]{aStack}), (int) (aPrefix.mSecondaryMaterial.mAmount * 400L / OrePrefixes.ring.mMaterialAmount), 4); gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Restrictive", ""), null, 1L, false, true), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Steel, aPrefix.mSecondaryMaterial.mAmount / OrePrefixes.ring.mMaterialAmount), GT_Utility.copyAmount(1L, new Object[]{aStack}), (int) (aPrefix.mSecondaryMaterial.mAmount * 400L / OrePrefixes.ring.mMaterialAmount), 4);
break; break;
case pipeQuadruple:
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, new Object[]{aStack}), GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PP ", "PP ", " ", 'P', GT_OreDictUnificator.get(aOreDictName.replaceFirst("Quadruple", "Medium"), null, 1L, false, true)});
gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Quadruple", "Medium"), null, 4L, false, true), ItemList.Circuit_Integrated.getWithDamage(0, 4), GT_Utility.copyAmount(1L, new Object[]{aStack}), 40 ,8);
break;
case pipeNonuple:
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(1, new Object[]{aStack}), GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "PPP", "PPP", 'P', GT_OreDictUnificator.get(aOreDictName.replaceFirst("Nonuple", "Small"), null, 1L, false, true)});
gregtech.api.enums.GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(aOreDictName.replaceFirst("Nonuple", "Small"), null, 9L, false, true), ItemList.Circuit_Integrated.getWithDamage(0, 9), GT_Utility.copyAmount(1L, new Object[]{aStack}), 60 ,8);
break;
} }
} }
} }

View file

@ -1424,6 +1424,7 @@ public class GT_Loader_MetaTileEntities implements Runnable {
GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5173, "GT_Pipe_Plastic_Large", "Large Plastic Fluid Pipe", 0.75F, Materials.Plastic, 720, 350, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5173, "GT_Pipe_Plastic_Large", "Large Plastic Fluid Pipe", 0.75F, Materials.Plastic, 720, 350, true).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5174, "GT_Pipe_Plastic_Huge", "Huge Plastic Fluid Pipe", 0.875F, Materials.Plastic, 1440, 350, true).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(Materials.Plastic), new GT_MetaPipeEntity_Fluid(5174, "GT_Pipe_Plastic_Huge", "Huge Plastic Fluid Pipe", 0.875F, Materials.Plastic, 1440, 350, true).getStackForm(1L));
generateFluidPipes(Materials.Polytetrafluoroethylene, Materials.Polytetrafluoroethylene.mName, "PTFE", 5175, 480, 600, true); generateFluidPipes(Materials.Polytetrafluoroethylene, Materials.Polytetrafluoroethylene.mName, "PTFE", 5175, 480, 600, true);
generateFluidMultiPipes(Materials.Polytetrafluoroethylene, Materials.Polytetrafluoroethylene.mName, "PTFE", 5200, 480, 600, true);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.TungstenSteel, 1L), ItemList.Electric_Pump_EV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.Ultimate, 1L), 300, 96); GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.TungstenSteel, 1L), ItemList.Electric_Pump_EV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.Ultimate, 1L), 300, 96);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.TungstenSteel, 1L), ItemList.Electric_Pump_IV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Ultimate, 1L), 400, 148); GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.TungstenSteel, 1L), ItemList.Electric_Pump_IV.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Ultimate, 1L), 400, 148);
@ -1649,4 +1650,9 @@ public class GT_Loader_MetaTileEntities implements Runnable {
GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 3, "GT_Pipe_" + name + "_Large", "Large " + displayName + " Fluid Pipe", 0.75F, aMaterial, baseCapacity * 2, heatCapacity, gasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeLarge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 3, "GT_Pipe_" + name + "_Large", "Large " + displayName + " Fluid Pipe", 0.75F, aMaterial, baseCapacity * 2, heatCapacity, gasProof).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 4, "GT_Pipe_" + name + "_Huge", "Huge " + displayName + " Fluid Pipe", 0.875F, aMaterial, baseCapacity * 4, heatCapacity, gasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre(OrePrefixes.pipeHuge.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 4, "GT_Pipe_" + name + "_Huge", "Huge " + displayName + " Fluid Pipe", 0.875F, aMaterial, baseCapacity * 4, heatCapacity, gasProof).getStackForm(1L));
} }
private static void generateFluidMultiPipes(Materials aMaterial, String name, String displayName, int startID, int baseCapacity, int heatCapacity, boolean gasProof){
GT_OreDictUnificator.registerOre(OrePrefixes.pipeQuadruple.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID, "GT_Pipe_" + name + "_Quadruple", "Quadruple " + displayName + " Fluid Pipe", 0.875F, aMaterial, baseCapacity, heatCapacity, gasProof, 4).getStackForm(1L));
GT_OreDictUnificator.registerOre(OrePrefixes.pipeNonuple.get(aMaterial), new GT_MetaPipeEntity_Fluid(startID + 1, "GT_Pipe_" + name + "_Nonuple", "Nonuple " + displayName + " Fluid Pipe", 0.875F, aMaterial, baseCapacity, heatCapacity, gasProof, 9).getStackForm(1L));
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B