Add Quadruple and Nonuple fluid pipes; fix several issues
|
@ -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),
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
|
|
|
@ -103,8 +103,8 @@ public class TextureSet {
|
|||
mTextures[81] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeLarge");
|
||||
mTextures[82] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeHuge");
|
||||
mTextures[83] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/frameGt");
|
||||
mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
|
||||
mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + aTextVoidDir);
|
||||
mTextures[84] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeQuadruple");
|
||||
mTextures[85] = new Textures.BlockIcons.CustomIcon(aTextMatIconDir + mSetName + "/pipeNonuple");
|
||||
mTextures[86] = 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);
|
||||
|
|
|
@ -267,10 +267,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
|||
byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
|
||||
if ((mConnections & (1 << tSide)) == 0) {
|
||||
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);
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -36,9 +36,9 @@ import static gregtech.api.enums.GT_Values.D1;
|
|||
public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
||||
public final float mThickNess;
|
||||
public final Materials mMaterial;
|
||||
public final int mCapacity, mHeatResistance;
|
||||
public final int mCapacity, mHeatResistance, mPipeAmount;
|
||||
public final boolean mGasProof;
|
||||
public FluidStack mFluid;
|
||||
public final FluidStack[] mFluids;
|
||||
public byte mLastReceivedFrom = 0, oLastReceivedFrom = 0;
|
||||
private boolean mCheckConnections = !GT_Mod.gregtechproxy.gt6Pipe;
|
||||
/**
|
||||
|
@ -47,21 +47,34 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
public byte mDisableInput = 0;
|
||||
|
||||
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;
|
||||
mMaterial = aMaterial;
|
||||
mCapacity = aCapacity;
|
||||
mGasProof = aGasProof;
|
||||
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) {
|
||||
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);
|
||||
mThickNess = aThickNess;
|
||||
mMaterial = aMaterial;
|
||||
mCapacity = aCapacity;
|
||||
mGasProof = aGasProof;
|
||||
mHeatResistance = aHeatResistance;
|
||||
mPipeAmount = aFluidTypes;
|
||||
mFluids = new FluidStack[mPipeAmount];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +84,7 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
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
|
||||
|
@ -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))};
|
||||
if (tThickNess < 0.874F)//0.825
|
||||
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.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
|
||||
|
@ -125,7 +142,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
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);
|
||||
if (GT_Mod.gregtechproxy.gt6Pipe) {
|
||||
aNBT.setByte("mConnections", mConnections);
|
||||
|
@ -135,7 +154,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
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");
|
||||
if (GT_Mod.gregtechproxy.gt6Pipe) {
|
||||
if (!aNBT.hasKey("mConnections"))
|
||||
|
@ -147,13 +167,17 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
|
||||
if (mFluid != null && (((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
|
||||
int tTemperature = mFluid.getFluid().getTemperature(mFluid);
|
||||
if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
|
||||
GT_Utility.applyHeatDamage((EntityLivingBase) aEntity, (tTemperature - 300) / 50.0F);
|
||||
} else if (tTemperature < 260 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
|
||||
GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
|
||||
}
|
||||
if ((((BaseMetaPipeEntity) getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) {
|
||||
for (FluidStack tFluid : mFluids) {
|
||||
if (tFluid != null) {
|
||||
int tTemperature = tFluid.getFluid().getTemperature(tFluid);
|
||||
if (tTemperature > 320 && !isCoverOnSide((BaseMetaPipeEntity) getBaseMetaTileEntity(), (EntityLivingBase) aEntity)) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (mFluid != null && mFluid.amount > 0) {
|
||||
int tTemperature = mFluid.getFluid().getTemperature(mFluid);
|
||||
if (tTemperature > mHeatResistance) {
|
||||
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
|
||||
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);
|
||||
for (FluidStack tFluid : mFluids) {
|
||||
if (tFluid != null && tFluid.amount > 0) {
|
||||
int tTemperature = tFluid.getFluid().getTemperature(tFluid);
|
||||
if (tTemperature > mHeatResistance) {
|
||||
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
|
||||
aBaseMetaTileEntity.setToFire();
|
||||
return;
|
||||
}
|
||||
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 (mFluid != null && mFluid.amount > 0) {
|
||||
int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluid.amount / 2)), tSuccessfulTankAmount = 0;
|
||||
for (int i = 0, j = aBaseMetaTileEntity.getRandomNumber(mPipeAmount); i < mPipeAmount; i++) {
|
||||
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())
|
||||
if (tEntry.getKey().fill(tEntry.getValue(), drain(tAmount, false), false) > 0)
|
||||
tSuccessfulTankAmount++;
|
||||
for (Entry<IFluidHandler, ForgeDirection> tEntry : tTanks.entrySet())
|
||||
if (tEntry.getKey().fill(tEntry.getValue(), drainFromIndex(tAmount, false, index), false) > 0)
|
||||
tSuccessfulTankAmount++;
|
||||
|
||||
if (tSuccessfulTankAmount > 0) {
|
||||
if (tAmount >= tSuccessfulTankAmount) {
|
||||
tAmount /= tSuccessfulTankAmount;
|
||||
for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
|
||||
if (mFluid == null || mFluid.amount <= 0) break;
|
||||
int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
|
||||
if (tFilledAmount > 0)
|
||||
tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
|
||||
}
|
||||
} else {
|
||||
for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
|
||||
if (mFluid == null || mFluid.amount <= 0) break;
|
||||
int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(mFluid.amount, false), false);
|
||||
if (tFilledAmount > 0)
|
||||
tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tFilledAmount, true), true);
|
||||
if (tSuccessfulTankAmount > 0) {
|
||||
if (tAmount >= tSuccessfulTankAmount) {
|
||||
tAmount /= tSuccessfulTankAmount;
|
||||
for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
|
||||
if (mFluids[index] == null || mFluids[index].amount <= 0) break;
|
||||
int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drain(tAmount, false), false);
|
||||
if (tFilledAmount > 0)
|
||||
tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(tFilledAmount, true, index), true);
|
||||
}
|
||||
} else {
|
||||
for (Entry<IFluidHandler, ForgeDirection> tTileEntity : tTanks.entrySet()) {
|
||||
if (mFluids[index] == null || mFluids[index].amount <= 0) break;
|
||||
int tFilledAmount = tTileEntity.getKey().fill(tTileEntity.getValue(), drainFromIndex(mFluids[index].amount, false, index), false);
|
||||
if (tFilledAmount > 0)
|
||||
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) {
|
||||
mDisableInput &= ~tMask;
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("212", "Input enabled"));
|
||||
if ((mConnections & tMask) == 0)
|
||||
connect(tSide);
|
||||
} else {
|
||||
mDisableInput |= tMask;
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("213", "Input disabled"));
|
||||
}
|
||||
} else {
|
||||
if ((mConnections & tMask) == 0)
|
||||
connect(tSide);
|
||||
else
|
||||
if ((mConnections & tMask) == 0) {
|
||||
if (connect(tSide) > 0)
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
|
||||
}
|
||||
else {
|
||||
disconnect(tSide);
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -346,10 +381,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
}
|
||||
if (rConnect > 0) {
|
||||
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);
|
||||
if ((tFluidPipe.mConnections & (1 << tSide)) == 0) tFluidPipe.connect(tSide);
|
||||
}
|
||||
} else rConnect = 0;
|
||||
} else {
|
||||
mConnections |= (1 << aSide);
|
||||
}
|
||||
|
@ -370,7 +405,25 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
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
|
||||
|
@ -385,46 +438,72 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
public final FluidStack getFluid() {
|
||||
return mFluid;
|
||||
for (FluidStack tFluid : mFluids) {
|
||||
if (tFluid != null)
|
||||
return tFluid;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
|
||||
if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
|
||||
|
||||
if (mFluid == null || mFluid.getFluid().getID() <= 0) {
|
||||
if (aFluid.amount <= getCapacity()) {
|
||||
int index = -1;
|
||||
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) {
|
||||
mFluid = aFluid.copy();
|
||||
mFluids[index] = aFluid.copy();
|
||||
mLastReceivedFrom |= (1 << aSide.ordinal());
|
||||
}
|
||||
return aFluid.amount;
|
||||
}
|
||||
if (doFill) {
|
||||
mFluid = aFluid.copy();
|
||||
mFluids[index] = aFluid.copy();
|
||||
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 (doFill) {
|
||||
mFluid.amount += aFluid.amount;
|
||||
mFluids[index].amount += aFluid.amount;
|
||||
mLastReceivedFrom |= (1 << aSide.ordinal());
|
||||
}
|
||||
return aFluid.amount;
|
||||
}
|
||||
if (doFill) {
|
||||
mFluid.amount = getCapacity();
|
||||
mFluids[index].amount = getCapacity() / mPipeAmount;
|
||||
mLastReceivedFrom |= (1 << aSide.ordinal());
|
||||
}
|
||||
return space;
|
||||
|
@ -432,25 +511,35 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
public final FluidStack drain(int maxDrain, boolean doDrain) {
|
||||
if (mFluid == null) return null;
|
||||
if (mFluid.amount <= 0) {
|
||||
mFluid = null;
|
||||
FluidStack drained = null;
|
||||
for (int i = 0; i < mPipeAmount; i++) {
|
||||
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;
|
||||
}
|
||||
|
||||
int used = maxDrain;
|
||||
if (mFluid.amount < used)
|
||||
used = mFluid.amount;
|
||||
if (mFluids[index].amount < used)
|
||||
used = mFluids[index].amount;
|
||||
|
||||
if (doDrain) {
|
||||
mFluid.amount -= used;
|
||||
mFluids[index].amount -= used;
|
||||
}
|
||||
|
||||
FluidStack drained = mFluid.copy();
|
||||
FluidStack drained = mFluids[index].copy();
|
||||
drained.amount = used;
|
||||
|
||||
if (mFluid.amount <= 0) {
|
||||
mFluid = null;
|
||||
if (mFluids[index].amount <= 0) {
|
||||
mFluids[index] = null;
|
||||
}
|
||||
|
||||
return drained;
|
||||
|
@ -458,15 +547,23 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity{
|
|||
|
||||
@Override
|
||||
public int getTankPressure() {
|
||||
return (mFluid == null ? 0 : mFluid.amount) - (getCapacity() / 2);
|
||||
return getFluidAmount() - (getCapacity() / 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDescription() {
|
||||
return new String[]{
|
||||
EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY,
|
||||
EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY
|
||||
};
|
||||
if (mPipeAmount == 1) {
|
||||
return new String[]{
|
||||
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
|
||||
|
|
|
@ -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) {
|
||||
if (GT_Mod.gregtechproxy.gt6Pipe) {
|
||||
byte tSide = GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ);
|
||||
if ((mConnections & (1 << tSide)) == 0)
|
||||
connect(tSide);
|
||||
else
|
||||
if ((mConnections & (1 << tSide)) == 0) {
|
||||
if (connect(tSide) > 0)
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("214", "Connected"));
|
||||
}
|
||||
else {
|
||||
disconnect(tSide);
|
||||
GT_Utility.sendChatToPlayer(aPlayer, trans("215", "Disconnected"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -317,6 +317,10 @@ public class GT_LanguageManager {
|
|||
// addStringLocalization("Interaction_DESCRIPTION_Index_209", "Grab");
|
||||
// addStringLocalization("Interaction_DESCRIPTION_Index_210", "Grab");
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package gregtech.loaders.oreprocessing;
|
||||
|
||||
import gregtech.api.enums.ItemList;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.OrePrefixes;
|
||||
import gregtech.api.enums.SubTag;
|
||||
|
@ -19,6 +20,8 @@ public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistr
|
|||
OrePrefixes.pipeRestrictiveMedium.add(this);
|
||||
OrePrefixes.pipeRestrictiveSmall.add(this);
|
||||
OrePrefixes.pipeRestrictiveTiny.add(this);
|
||||
OrePrefixes.pipeQuadruple.add(this);
|
||||
OrePrefixes.pipeNonuple.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,6 +47,15 @@ public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistr
|
|||
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);
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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.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);
|
||||
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.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.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));
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 448 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 448 B |