Added pollution info

This commit is contained in:
Technus 2016-10-02 21:49:01 +02:00
parent 452b91cdfc
commit 53e33d976a
8 changed files with 67 additions and 7 deletions

View file

@ -81,4 +81,9 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
"Reduces pollution by: "+ EnumChatFormatting.GREEN + (6*(mTier-1))+ EnumChatFormatting.RESET+" %"
};
}
public int getPollutionReduction() {
return 6*(mTier-1);
}
}

View file

@ -835,6 +835,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
@Override
public String[] getInfoData() {
String mMufflerInfo="";
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
mPollutionReduction+=tHatch.getPollutionReduction();
}
}
if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %";
return new String[]{
"Progress:",
EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
@ -849,7 +858,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
"Problems: "+
EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+
" Efficiency: "+
EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"};
EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
mMufflerInfo
};
}
@Override

View file

@ -28,7 +28,7 @@ public class GT_Pollution {
if(!GT_Mod.gregtechproxy.mPollution)return;
if(aTick == 0 || (tList==null && GT_Proxy.chunkData!=null)){
tList = new ArrayList<ChunkPosition>(GT_Proxy.chunkData.keySet());
loops = (tList.size()/1200) + 1;
loops = (tList.size()/1000) + 1;
// System.out.println("new Pollution loop"+aTick);
}
if(tList!=null && tList.size() > 0){

View file

@ -211,7 +211,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace
checkRecipe();
}
}
if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){
if(this.mMachine && this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){
GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 400);
}

View file

@ -9,6 +9,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
@ -230,13 +231,23 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock
@Override
public String[] getInfoData() {
String mMufflerInfo="";
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
mPollutionReduction+=tHatch.getPollutionReduction();
}
}
if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %";
return new String[]{
EnumChatFormatting.BLUE+"Diesel Engine"+EnumChatFormatting.RESET,
"Current Output: "+EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t",
"Fuel Consumption: "+EnumChatFormatting.YELLOW+fuelConsumption+EnumChatFormatting.RESET+" L/t",
"Fuel Value: "+EnumChatFormatting.YELLOW+fuelValue+EnumChatFormatting.RESET+" EU/L",
"Fuel Remaining: "+EnumChatFormatting.GOLD+fuelRemaining+EnumChatFormatting.RESET+" L",
"Current Efficiency: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.YELLOW+" %"};
"Current Efficiency: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.YELLOW+" %",
mMufflerInfo
};
}
@Override

View file

@ -6,6 +6,7 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
@ -259,6 +260,15 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
@Override
public String[] getInfoData() {
String mMufflerInfo="";
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
mPollutionReduction+=tHatch.getPollutionReduction();
}
}
if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %";
return new String[]{
"Progress:",
EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
@ -275,7 +285,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
" Efficiency: "+
EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
"Heat capacity: "+
EnumChatFormatting.GREEN+mHeatingCapacity+EnumChatFormatting.RESET+" K"
EnumChatFormatting.GREEN+mHeatingCapacity+EnumChatFormatting.RESET+" K",
mMufflerInfo
};
}
}

View file

@ -5,6 +5,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
@ -200,6 +201,15 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M
@Override
public String[] getInfoData() {
String mMufflerInfo="";
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
mPollutionReduction+=tHatch.getPollutionReduction();
}
}
if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %";
String tRunning = mMaxProgresstime>0 ?
EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET :
EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET;
@ -220,7 +230,8 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M
"Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L",
"Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%",
"Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%",
tMaintainance
tMaintainance,
mMufflerInfo
};
}

View file

@ -8,6 +8,7 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
@ -233,6 +234,15 @@ public class GT_MetaTileEntity_MultiFurnace
@Override
public String[] getInfoData() {
String mMufflerInfo="";
int mPollutionReduction=0;
for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
if (isValidMetaTileEntity(tHatch)) {
mPollutionReduction+=tHatch.getPollutionReduction();
}
}
if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %";
return new String[]{
"Progress:",
EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
@ -249,7 +259,8 @@ public class GT_MetaTileEntity_MultiFurnace
" Efficiency: "+
EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
"Multi smelting: "+
EnumChatFormatting.GREEN+mLevel*8+EnumChatFormatting.RESET+" Discount: "+EnumChatFormatting.GREEN+"(EU/t) / "+mCostDiscount+EnumChatFormatting.RESET
EnumChatFormatting.GREEN+mLevel*8+EnumChatFormatting.RESET+" Discount: "+EnumChatFormatting.GREEN+"(EU/t) / "+mCostDiscount+EnumChatFormatting.RESET,
mMufflerInfo
};
}