aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r--src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java52
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java32
2 files changed, 55 insertions, 29 deletions
diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
index 6aff060bfa..13b1b00ae2 100644
--- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
+++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
@@ -17,7 +17,7 @@ public interface IGT_RecipeAdder {
*
* @param aInput1 = first Input (not null, and respects StackSize)
* @param aInput2 = second Input (not null, and respects StackSize)
- * @param aOutput = Output of the Fusion (can be null, and respects StackSize)
+ * @param aOutput1 = Output of the Fusion (can be null, and respects StackSize)
* @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
* @param aFusionEnergyPerTick = The EU generated per Tick (can even be negative!)
* @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0)
@@ -38,6 +38,8 @@ public interface IGT_RecipeAdder {
*/
public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration);
+ public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt);
+
/**
* Adds a Centrifuge Recipe
*
@@ -92,31 +94,24 @@ public interface IGT_RecipeAdder {
*
* @param aInput1 must be != null
* @param aInput2 must be != null
- * @param aOutput1 must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
*/
public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration);
+ public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt);
+
/**
* Adds a Chemical Recipe
*
* @param aInput1 must be != null
* @param aInput2 must be != null
- * @param aOutput1 must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
*/
public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration);
- /**
- * Adds a Chemical Recipe
- *
- * @param aInput1 must be != null
- * @param aInput2 must be != null
- * @param aOutput1 must be != null
- * @param aDuration must be > 0
- * @param aEUtick must be > 0
- */
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUtick);
+ public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
/**
@@ -239,8 +234,8 @@ public interface IGT_RecipeAdder {
/**
* Adds a Wiremill Recipe
*
- * @param aInput1 must be != null
- * @param aOutput1 must be != null
+ * @param aInput must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
@@ -249,8 +244,8 @@ public interface IGT_RecipeAdder {
/**
* Adds a Polariser Recipe
*
- * @param aInput1 must be != null
- * @param aOutput1 must be != null
+ * @param aInput must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
@@ -259,8 +254,8 @@ public interface IGT_RecipeAdder {
/**
* Adds a Plate Bending Machine Recipe
*
- * @param aInput1 must be != null
- * @param aOutput1 must be != null
+ * @param aInput must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
@@ -269,9 +264,9 @@ public interface IGT_RecipeAdder {
/**
* Adds a Extruder Machine Recipe
*
- * @param aInput1 must be != null
+ * @param aInput must be != null
* @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item.
- * @param aOutput1 must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
@@ -280,9 +275,9 @@ public interface IGT_RecipeAdder {
/**
* Adds a Slicer Machine Recipe
*
- * @param aInput1 must be != null
+ * @param aInput must be != null
* @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item.
- * @param aOutput1 must be != null
+ * @param aOutput must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/
@@ -324,7 +319,7 @@ public interface IGT_RecipeAdder {
/**
* Adds a Distillation Tower Recipe
*
- * @param aInput1 must be != null
+ * @param aInput must be != null
* @param aOutputs must be != null 1-5 Fluids
* @param aOutput2 can be null
*/
@@ -387,6 +382,8 @@ public interface IGT_RecipeAdder {
*/
public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration);
+ public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt);
+
/**
* Adds a Fuel for My Generators
*
@@ -407,11 +404,15 @@ public interface IGT_RecipeAdder {
*/
public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden);
+ public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden);
+
/**
* Adds a Recipe for the Fermenter
*/
public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden);
+ public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUT, boolean aHidden);
+
/**
* Adds a Recipe for the Fluid Heater
*/
@@ -447,6 +448,7 @@ public interface IGT_RecipeAdder {
*/
public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput);
+ public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration,int aEUt);
/**
* Adds a Recipe for the Chemical Bath
*/
@@ -526,7 +528,7 @@ public interface IGT_RecipeAdder {
* Adds a Distillation Tower Recipe
* Every Fluid also gets seperate distillation recipes
*
- * @param aInput1 must be != null
+ * @param aInput must be != null
* @param aOutputs must be != null 1-5 Fluids
* @param aOutput2 can be null
*/
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
index b62ed4500b..b35d797a9c 100644
--- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
+++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java
@@ -1,11 +1,14 @@
package gregtech.api.interfaces.tileentity;
import cofh.api.energy.IEnergyReceiver;
+import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Pollution;
import ic2.api.energy.tile.IEnergySink;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@@ -71,20 +74,41 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd
}
} else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
+ int rfOut = GT_Utility.safeInt(aVoltage * GregTech_API.mEUtoRF / 100);
if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
rUsedAmperes++;
}
- if (GregTech_API.mRFExplosions && GregTech_API.sMachineExplosions && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600) {
- if (rfOut > 32 * GregTech_API.mEUtoRF / 100) {
+ if (GregTech_API.mRFExplosions && GregTech_API.sMachineExplosions && ((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600L) {
+ if (rfOut > 32L * GregTech_API.mEUtoRF / 100L) {
int aExplosionPower = rfOut;
- float tStrength = aExplosionPower < V[0] ? 1.0F : aExplosionPower < V[1] ? 2.0F : aExplosionPower < V[2] ? 3.0F : aExplosionPower < V[3] ? 4.0F : aExplosionPower < V[4] ? 5.0F : aExplosionPower < V[4] * 2 ? 6.0F : aExplosionPower < V[5] ? 7.0F : aExplosionPower < V[6] ? 8.0F : aExplosionPower < V[7] ? 9.0F : 10.0F;
+ float tStrength =
+ aExplosionPower < V[0] ? 1.0F :
+ aExplosionPower < V[1] ? 2.0F :
+ aExplosionPower < V[2] ? 3.0F :
+ aExplosionPower < V[3] ? 4.0F :
+ aExplosionPower < V[4] ? 5.0F :
+ aExplosionPower < V[4] * 2 ? 6.0F :
+ aExplosionPower < V[5] ? 7.0F :
+ aExplosionPower < V[6] ? 8.0F :
+ aExplosionPower < V[7] ? 9.0F :
+ aExplosionPower < V[8] ? 10.0F :
+ aExplosionPower < V[8] * 2 ? 11.0F :
+ aExplosionPower < V[9] ? 12.0F :
+ aExplosionPower < V[10] ? 13.0F :
+ aExplosionPower < V[11] ? 14.0F :
+ aExplosionPower < V[12] ? 15.0F :
+ aExplosionPower < V[12] * 2 ? 16.0F :
+ aExplosionPower < V[13] ? 17.0F :
+ aExplosionPower < V[14] ? 18.0F :
+ aExplosionPower < V[15] ? 19.0F : 20.0F;
int tX = tTileEntity.xCoord, tY = tTileEntity.yCoord, tZ = tTileEntity.zCoord;
World tWorld = tTileEntity.getWorldObj();
GT_Utility.sendSoundToPlayers(tWorld, GregTech_API.sSoundList.get(209), 1.0F, -1, tX, tY, tZ);
tWorld.setBlock(tX, tY, tZ, Blocks.air);
if (GregTech_API.sMachineExplosions)
+ if(GT_Mod.gregtechproxy.mPollution)
+ GT_Pollution.addPollution(new ChunkPosition(tX, tY, tZ), 100000);
tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true);
}
}