aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2020-04-13 23:49:40 +0000
committerAlkalus <draknyte1@hotmail.com>2020-04-13 23:49:40 +0000
commit24b1356471191a10fde6e4f1baf58ae74e87cfba (patch)
tree4a15a8e73a9b97f4b77d6c894f293f4cb6653c9d /src
parentd53cc950a01765cb8bc422c6f79661dd05c760ef (diff)
parenta428e29805b3bfb949cf93a1149744464ba16334 (diff)
downloadGT5-Unofficial-24b1356471191a10fde6e4f1baf58ae74e87cfba.tar.gz
GT5-Unofficial-24b1356471191a10fde6e4f1baf58ae74e87cfba.tar.bz2
GT5-Unofficial-24b1356471191a10fde6e4f1baf58ae74e87cfba.zip
Merged in develop (pull request #6)
Fix Advanced Mufflers
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java48
3 files changed, 30 insertions, 27 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java
index 721fe053ae..17226a399e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Hatch_Muffler_Advanced.java
@@ -21,7 +21,7 @@ public class CONTAINER_Hatch_Muffler_Advanced extends GT_ContainerMetaTile_Machi
@Override
public void addSlots(final InventoryPlayer aInventoryPlayer) {
- this.addSlotToContainer(new SlotAirFilter(this.mTileEntity, 1, 80, 35));
+ this.addSlotToContainer(new SlotAirFilter(this.mTileEntity, 0, 80, 35));
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java
index 5fa1fc8aba..5303a42bf6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java
@@ -124,7 +124,7 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch
return false;
}
- public boolean polluteEnvironment() {
+ public boolean polluteEnvironment() {
if (airCheck() && damageAirFilter()) {
int aEmission = this.calculatePollutionReduction(10000);
PollutionUtils.addPollution(this.getBaseMetaTileEntity(), aEmission);
@@ -214,8 +214,7 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch
//Logger.INFO("Empty - "+this.mInventory.length);
}
else {
- //Logger.INFO("D2");
- Logger.INFO("Has Item");
+ //Logger.INFO("D2");
}
}
//Logger.INFO("A4");
@@ -254,7 +253,7 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch
//Remove broken Filter
if ((filter.getItemDamage() == 0 && currentUse >= 50-1) || (filter.getItemDamage() == 1 && currentUse >= 2500-1)){
breakAirFilter();
- return false;
+ return true;
}
else {
//Do Damage
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
index 325ec8f95d..c10721cfcf 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
@@ -28,6 +28,7 @@ import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
@@ -106,6 +107,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
"1x Dynamo Hatch (Top Middle, Max 8) suports tectech dynamos",
"8x Air Intake Hatch (one of the Casings next to a "+mGearboxName+", top row allowed)",
"3x Input Hatch (Rocket Fuel/Booster/co2) (one of the Casings next to a "+mGearboxName+", top row not allowed)",
+ "1x Input Bus to supply filters for advanced muffler (one of the Casings next to a \"+mGearboxName+\", top row not allowed)",
"1x Maintenance Hatch (one of the Casings next to a "+mGearboxName+")",
"1x Muffler Hatch (Back Centre)",
};
@@ -130,9 +132,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
public int getAir() {
- log("geting air in ");
if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) {
- log("return air 0");
return 0;
}
else {
@@ -140,10 +140,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
FluidStack airstack = FluidUtils.getFluidStack("air", 1);
for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) {
if (u != null && u.mFluid != null) {
- log(" to fluid stack");
// had this trow errors cousing the machine to stop probebly fixed
FluidStack f = u.mFluid;
- log("fluid stack made");
if (f.isFluidEqual(airstack)) {
totalAir += f.amount;
}
@@ -155,19 +153,15 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public boolean checkRecipe(final ItemStack aStack) {
- log(" geting air");
final ArrayList<FluidStack> tFluids = this.getStoredFluids();
FluidStack air = FluidUtils.getFluidStack("air", 1);
- log(" geting air 2");
int aircount = getAir() ;
if (aircount < euProduction/100) {
- log(" not enough air");
//log("Not Enough Air to Run "+aircount);
return false;
}
else {
- log(" no boost");
boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/100));
if (!hasIntakeAir) {
//log("Could not consume Air to run "+aircount);
@@ -180,15 +174,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
freeFuelTicks = 0;
//log("Running "+aircount);
- log("looking at hatch");
final Collection<GT_Recipe> tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList;
if (tFluids.size() > 0 && tRecipeList != null) {
- log("has fluid");
if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) {
- log("Found CO2");
if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
if (!consumeCO2()) {
freeFuelTicks = 0;
@@ -197,14 +188,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
} else
{
- log("no CO found");
freeFuelTicks = 0;
return false;
}
if (freeFuelTicks == 0)
this.boostEu = consumeLOH();
- log("Did we consume LOH? "+boostEu);
for (final FluidStack hatchFluid1 : tFluids) {
if (hatchFluid1.isFluidEqual(air)) {
@@ -212,12 +201,10 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
if (freeFuelTicks == 0) {
- log("tick = 0 consuming fuel");
for (final GT_Recipe aFuel : tRecipeList) {
final FluidStack tLiquid;
tLiquid = aFuel.mFluidInputs[0];
if (hatchFluid1.isFluidEqual(tLiquid)) {
- log("consume fuel amount" + hatchFluid1.amount);
if (!consumeFuel(aFuel,hatchFluid1.amount)) {
continue;
}
@@ -246,7 +233,6 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
this.mEUt = 0;
this.mEfficiency = 0;
- log("no fuel found");
freeFuelTicks = 0;
return false;
}
@@ -258,25 +244,19 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
*/
public boolean consumeFuel(GT_Recipe aFuel,int amount) {
amount *= this.boostEu ? 0.3 : 0.9;
- log("Consuming fuel.");
freeFuelTicks = 0;
int value = aFuel.mSpecialValue * 3;
- log("amount: "+amount);
- log("Value: "+value);
int energy = value * amount;
- log("amount2: "+amount);
if (amount < 5)
return false;
FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount));
if (!this.depleteInput(tLiquid)) {
- log("could not deplete fluid");
return false;
}
else {
this.fuelConsumption = this.boostEu ? amount * 3 : amount;
this.freeFuelTicks = 20;
setEUProduction(energy);
- log("Consumed "+amount+"L. Waiting "+freeFuelTicks+" ticks to consume more.");
return true;
}
}
@@ -448,10 +428,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
log("Wrong count for Dynamos");
return false;
}
+
if (this.mMufflerHatches.size() != 1 || this.mMufflerHatches.isEmpty()) {
log("Wrong count for Mufflers");
return false;
}
+
if (this.mAirIntakes.size() < 8 || this.mAirIntakes.isEmpty()) {
log("Wrong count for Air Intakes | "+this.mAirIntakes.size());
return false;
@@ -543,6 +525,28 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
return injected > 0;
}
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ if (this.mRuntime%20 == 0) {
+ if (mMufflerHatches.size() == 1 && mMufflerHatches.get(0) instanceof GT_MetaTileEntity_Hatch_Muffler_Adv) {
+ GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler = (GT_MetaTileEntity_Hatch_Muffler_Adv) mMufflerHatches.get(0);
+ if (!tMuffler.hasValidFilter()) {
+ ArrayList<ItemStack> tInputs = getStoredInputs();
+ for (ItemStack tItem : tInputs) {
+ if (tMuffler.isAirFilter(tItem)) {
+ tMuffler.mInventory[0] = tItem.copy();
+ depleteInput(tItem);
+ updateSlots();
+ break;
+ }
+ }
+ }
+ }
+ }
+ super.onRunningTick(aStack);
+ return true;
+ }
public Block getCasingBlock() {
return ModBlocks.blockCasings4Misc;