diff options
author | Kiwi <42833050+Kiwi233@users.noreply.github.com> | 2020-05-24 08:28:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 08:28:19 +0800 |
commit | f0bce85d3faf040d87a22d83250ae2d9767c3642 (patch) | |
tree | ed60c1d975c8b06a27cae03d148714f7bb9e9805 /src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java | |
parent | ac7282a30ef161101cabc921e52db5c5d7e0096c (diff) | |
parent | d6c19a9b6434c8a4c59ea8452603f85cfd2ad208 (diff) | |
download | GT5-Unofficial-f0bce85d3faf040d87a22d83250ae2d9767c3642.tar.gz GT5-Unofficial-f0bce85d3faf040d87a22d83250ae2d9767c3642.tar.bz2 GT5-Unofficial-f0bce85d3faf040d87a22d83250ae2d9767c3642.zip |
Merge pull request #1 from GTNewHorizons/experimental
5/24
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java')
-rw-r--r-- | src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 8c9bac5c01..47bec844ee 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -3,7 +3,6 @@ package gregtech.api.interfaces.tileentity; import cofh.api.energy.IEnergyReceiver; import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import ic2.api.energy.tile.IEnergySink; @@ -30,28 +29,30 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd * @param aSide 0 - 5 = Vanilla Directions of YOUR Block the Energy gets inserted to. 6 = No specific Side (don't do Side checks for this Side) * @return amount of used Amperes. 0 if not accepted anything. */ - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage); + long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage); /** * Sided Energy Input */ - public boolean inputEnergyFrom(byte aSide); - default public boolean inputEnergyFrom(byte aSide, boolean waitForActive) { + boolean inputEnergyFrom(byte aSide); + + default boolean inputEnergyFrom(byte aSide, boolean waitForActive) { return inputEnergyFrom(aSide); } /** * Sided Energy Output */ - public boolean outputsEnergyTo(byte aSide); - default public boolean outputsEnergyTo(byte aSide, boolean waitForActive) { + boolean outputsEnergyTo(byte aSide); + + default boolean outputsEnergyTo(byte aSide, boolean waitForActive) { return outputsEnergyTo(aSide); } /** * Utility for the Network */ - public static class Util { + class Util { /** * Emits Energy to the E-net. Also compatible with adjacent IC2 TileEntities. * @@ -85,33 +86,33 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd 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 : - 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; + 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(tWorld.getChunkFromBlockCoords(tX,tZ), 100000); - tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); + if (GT_Mod.gregtechproxy.mPollution) + GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), 100000); + tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } } } |