diff options
author | aerospark <lukefay12@gmail.com> | 2015-06-23 15:29:05 -0700 |
---|---|---|
committer | aerospark <lukefay12@gmail.com> | 2015-06-23 15:29:05 -0700 |
commit | a1504799f44ba2debdfef06317f24e7f9c1129d6 (patch) | |
tree | 53e53ff64d2902c639951bd1d41f942ee171f836 /main/java/gregtech/common/covers/GT_Cover_Drain.java | |
parent | b803f59de5a66fcb4ef53e117b912fbbc2841392 (diff) | |
download | GT5-Unofficial-a1504799f44ba2debdfef06317f24e7f9c1129d6.tar.gz GT5-Unofficial-a1504799f44ba2debdfef06317f24e7f9c1129d6.tar.bz2 GT5-Unofficial-a1504799f44ba2debdfef06317f24e7f9c1129d6.zip |
strip linenumbers
Diffstat (limited to 'main/java/gregtech/common/covers/GT_Cover_Drain.java')
-rw-r--r-- | main/java/gregtech/common/covers/GT_Cover_Drain.java | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/main/java/gregtech/common/covers/GT_Cover_Drain.java b/main/java/gregtech/common/covers/GT_Cover_Drain.java index 5c8a3e910f..17b1d05a9c 100644 --- a/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -1,111 +1,111 @@ -/* 1: */ package gregtech.common.covers;
-/* 2: */
-/* 3: */ import gregtech.api.enums.Materials;
-/* 4: */ import gregtech.api.interfaces.tileentity.ICoverable;
-/* 5: */ import gregtech.api.interfaces.tileentity.IMachineProgress;
-/* 6: */ import gregtech.api.util.GT_CoverBehavior;
-/* 7: */ import gregtech.api.util.GT_Utility;
-/* 8: */ import net.minecraft.block.Block;
-/* 9: */ import net.minecraft.entity.player.EntityPlayer;
-/* 10: */ import net.minecraft.init.Blocks;
-/* 11: */ import net.minecraft.world.World;
-/* 12: */ import net.minecraft.world.biome.BiomeGenBase;
-/* 13: */ import net.minecraftforge.common.util.ForgeDirection;
-/* 14: */ import net.minecraftforge.fluids.Fluid;
-/* 15: */ import net.minecraftforge.fluids.FluidStack;
-/* 16: */ import net.minecraftforge.fluids.IFluidBlock;
-/* 17: */ import net.minecraftforge.fluids.IFluidHandler;
-/* 18: */
-/* 19: */ public class GT_Cover_Drain
-/* 20: */ extends GT_CoverBehavior
-/* 21: */ {
-/* 22: */ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
-/* 23: */ {
-/* 24:20 */ if ((aCoverVariable % 3 > 1) && ((aTileEntity instanceof IMachineProgress))) {
-/* 25:20 */ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 3 < 2) {
-/* 26:20 */ return aCoverVariable;
-/* 27: */ }
-/* 28: */ }
-/* 29:21 */ if (aSide != 6)
-/* 30: */ {
-/* 31:22 */ Block tBlock = aTileEntity.getBlockAtSide(aSide);
-/* 32:23 */ if ((aCoverVariable < 3) && ((aTileEntity instanceof IFluidHandler)))
-/* 33: */ {
-/* 34:24 */ if ((aSide == 1) &&
-/* 35:25 */ (aTileEntity.getWorld().isRaining()) &&
-/* 36:26 */ (aTileEntity.getWorld().getPrecipitationHeight(aTileEntity.getXCoord(), aTileEntity.getZCoord()) - 2 < aTileEntity.getYCoord()))
-/* 37: */ {
-/* 38:27 */ int tAmount = (int)(aTileEntity.getBiome().rainfall * 10.0F);
-/* 39:28 */ if (tAmount > 0) {
-/* 40:29 */ ((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), Materials.Water.getFluid(aTileEntity.getWorld().isThundering() ? tAmount * 2 : tAmount), true);
-/* 41: */ }
-/* 42: */ }
-/* 43:34 */ FluidStack tLiquid = null;
-/* 44:35 */ if (tBlock != null)
-/* 45: */ {
-/* 46:36 */ if (((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) {
-/* 47:37 */ tLiquid = Materials.Water.getFluid(1000L);
-/* 48:38 */ } else if (((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) {
-/* 49:39 */ tLiquid = Materials.Lava.getFluid(1000L);
-/* 50:40 */ } else if ((tBlock instanceof IFluidBlock)) {
-/* 51:41 */ tLiquid = ((IFluidBlock)tBlock).drain(aTileEntity.getWorld(), aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), false);
-/* 52: */ }
-/* 53:43 */ if ((tLiquid != null) && (tLiquid.getFluid() != null) && ((aSide > 1) || ((aSide == 0) && (tLiquid.getFluid().getDensity() <= 0)) || ((aSide == 1) && (tLiquid.getFluid().getDensity() >= 0))) &&
-/* 54:44 */ (((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, false) == tLiquid.amount))
-/* 55: */ {
-/* 56:45 */ ((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, true);
-/* 57:46 */ aTileEntity.getWorld().setBlockToAir(aTileEntity.getXCoord() + ForgeDirection.getOrientation(aSide).offsetX, aTileEntity.getYCoord() + ForgeDirection.getOrientation(aSide).offsetY, aTileEntity.getZCoord() + ForgeDirection.getOrientation(aSide).offsetZ);
-/* 58: */ }
-/* 59: */ }
-/* 60: */ }
-/* 61:51 */ if ((aCoverVariable >= 3) && (tBlock != null) && (
-/* 62:52 */ (tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava) || (tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock)))) {
-/* 63:53 */ aTileEntity.getWorld().setBlock(aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), Blocks.air, 0, 0);
-/* 64: */ }
-/* 65: */ }
-/* 66:57 */ return aCoverVariable;
-/* 67: */ }
-/* 68: */
-/* 69: */ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
-/* 70: */ {
-/* 71:62 */ aCoverVariable = (aCoverVariable + 1) % 6;
-/* 72:63 */ if (aCoverVariable == 0) {
-/* 73:63 */ GT_Utility.sendChatToPlayer(aPlayer, "Import");
-/* 74: */ }
-/* 75:64 */ if (aCoverVariable == 1) {
-/* 76:64 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)");
-/* 77: */ }
-/* 78:65 */ if (aCoverVariable == 2) {
-/* 79:65 */ GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)");
-/* 80: */ }
-/* 81:66 */ if (aCoverVariable == 3) {
-/* 82:66 */ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away");
-/* 83: */ }
-/* 84:67 */ if (aCoverVariable == 4) {
-/* 85:67 */ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)");
-/* 86: */ }
-/* 87:68 */ if (aCoverVariable == 5) {
-/* 88:68 */ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)");
-/* 89: */ }
-/* 90:69 */ return aCoverVariable;
-/* 91: */ }
-/* 92: */
-/* 93: */ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
-/* 94: */ {
-/* 95:74 */ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) {}
-/* 96:74 */ return ((IMachineProgress)aTileEntity).isAllowedToWork() == aCoverVariable < 2;
-/* 97: */ }
-/* 98: */
-/* 99: */ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
-/* :0: */ {
-/* :1:79 */ return true;
-/* :2: */ }
-/* :3: */
-/* :4: */ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
-/* :5: */ {
-/* :6:84 */ return aCoverVariable < 3 ? 50 : 1;
-/* :7: */ }
-/* :8: */ }
+package gregtech.common.covers;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IMachineProgress;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidBlock;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GT_Cover_Drain
+ extends GT_CoverBehavior
+{
+ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
+ {
+ if ((aCoverVariable % 3 > 1) && ((aTileEntity instanceof IMachineProgress))) {
+ if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 3 < 2) {
+ return aCoverVariable;
+ }
+ }
+ if (aSide != 6)
+ {
+ Block tBlock = aTileEntity.getBlockAtSide(aSide);
+ if ((aCoverVariable < 3) && ((aTileEntity instanceof IFluidHandler)))
+ {
+ if ((aSide == 1) &&
+ (aTileEntity.getWorld().isRaining()) &&
+ (aTileEntity.getWorld().getPrecipitationHeight(aTileEntity.getXCoord(), aTileEntity.getZCoord()) - 2 < aTileEntity.getYCoord()))
+ {
+ int tAmount = (int)(aTileEntity.getBiome().rainfall * 10.0F);
+ if (tAmount > 0) {
+ ((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), Materials.Water.getFluid(aTileEntity.getWorld().isThundering() ? tAmount * 2 : tAmount), true);
+ }
+ }
+ FluidStack tLiquid = null;
+ if (tBlock != null)
+ {
+ if (((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) {
+ tLiquid = Materials.Water.getFluid(1000L);
+ } else if (((tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava)) && (aTileEntity.getMetaIDAtSide(aSide) == 0)) {
+ tLiquid = Materials.Lava.getFluid(1000L);
+ } else if ((tBlock instanceof IFluidBlock)) {
+ tLiquid = ((IFluidBlock)tBlock).drain(aTileEntity.getWorld(), aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), false);
+ }
+ if ((tLiquid != null) && (tLiquid.getFluid() != null) && ((aSide > 1) || ((aSide == 0) && (tLiquid.getFluid().getDensity() <= 0)) || ((aSide == 1) && (tLiquid.getFluid().getDensity() >= 0))) &&
+ (((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, false) == tLiquid.amount))
+ {
+ ((IFluidHandler)aTileEntity).fill(ForgeDirection.getOrientation(aSide), tLiquid, true);
+ aTileEntity.getWorld().setBlockToAir(aTileEntity.getXCoord() + ForgeDirection.getOrientation(aSide).offsetX, aTileEntity.getYCoord() + ForgeDirection.getOrientation(aSide).offsetY, aTileEntity.getZCoord() + ForgeDirection.getOrientation(aSide).offsetZ);
+ }
+ }
+ }
+ if ((aCoverVariable >= 3) && (tBlock != null) && (
+ (tBlock == Blocks.lava) || (tBlock == Blocks.flowing_lava) || (tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock)))) {
+ aTileEntity.getWorld().setBlock(aTileEntity.getOffsetX(aSide, 1), aTileEntity.getOffsetY(aSide, 1), aTileEntity.getOffsetZ(aSide, 1), Blocks.air, 0, 0);
+ }
+ }
+ return aCoverVariable;
+ }
+
+ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ aCoverVariable = (aCoverVariable + 1) % 6;
+ if (aCoverVariable == 0) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Import");
+ }
+ if (aCoverVariable == 1) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)");
+ }
+ if (aCoverVariable == 2) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)");
+ }
+ if (aCoverVariable == 3) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away");
+ }
+ if (aCoverVariable == 4) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)");
+ }
+ if (aCoverVariable == 5) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)");
+ }
+ return aCoverVariable;
+ }
+
+ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
+ {
+ if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) {}
+ return ((IMachineProgress)aTileEntity).isAllowedToWork() == aCoverVariable < 2;
+ }
+
+ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
+ {
+ return true;
+ }
+
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
+ {
+ return aCoverVariable < 3 ? 50 : 1;
+ }
+}
/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
|