diff options
| author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
|---|---|---|
| committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
| commit | 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch) | |
| tree | cb302d8e0f46e06be0b1d391317578b165aec245 /main/java/gregtech/common/covers | |
| parent | ce25063b910bb3bdd2b0c234b185fc4077caebdb (diff) | |
| download | GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2 GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip | |
Move source directory
Diffstat (limited to 'main/java/gregtech/common/covers')
26 files changed, 0 insertions, 2133 deletions
diff --git a/main/java/gregtech/common/covers/GT_Cover_Arm.java b/main/java/gregtech/common/covers/GT_Cover_Arm.java deleted file mode 100644 index 3212ce92af..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ /dev/null @@ -1,112 +0,0 @@ -package gregtech.common.covers;
-
-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.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.fluids.Fluid;
-
-public class GT_Cover_Arm
- extends GT_CoverBehavior
-{
- public final int mTickRate;
-
- public GT_Cover_Arm(int aTickRate)
- {
- this.mTickRate = aTickRate;
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- if ((aCoverVariable == 0) || (((aTileEntity instanceof IMachineProgress)) && (!((IMachineProgress)aTileEntity).isAllowedToWork()))) {
- return aCoverVariable;
- }
- TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide);
- aTileEntity.decreaseStoredEnergyUnits(1L, true);
- if (aTileEntity.getUniversalEnergyCapacity() >= 128L)
- {
- if (aTileEntity.isUniversalEnergyStored(256L)) {
- aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte)64, (byte)1, (byte)64, (byte)1), true);
- }
- }
- else {
- GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte)64, (byte)1, (byte)64, (byte)1);
- }
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += 16;
- } else {
- aCoverVariable -= 16;
- }
- GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? "Puts out into adjacent Slot #" : "Grabs in for own Slot #") + (Math.abs(aCoverVariable) - 1));
- return aCoverVariable;
- }
-
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable++;
- } else {
- aCoverVariable--;
- }
- GT_Utility.sendChatToPlayer(aPlayer, (aCoverVariable > 0 ? "Puts out into adjacent Slot #" : "Grabs in for own Slot #") + (Math.abs(aCoverVariable) - 1));
- aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
- return true;
- }
-
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return true;
- }
-
- 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 this.mTickRate;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_Blastproof.java b/main/java/gregtech/common/covers/GT_Cover_Blastproof.java deleted file mode 100644 index 8c92eb9175..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_Blastproof.java +++ /dev/null @@ -1,25 +0,0 @@ -package gregtech.common.covers;
-
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.util.GT_CoverBehavior;
-
-public class GT_Cover_Blastproof
- extends GT_CoverBehavior
-{
- private final float mLevel;
-
- public GT_Cover_Blastproof(float aLevel)
- {
- this.mLevel = aLevel;
- }
-
- public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return this.mLevel;
- }
-
- public boolean isSimpleCover()
- {
- return true;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java deleted file mode 100644 index ee06b47f51..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ /dev/null @@ -1,85 +0,0 @@ -package gregtech.common.covers;
-
-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.entity.player.EntityPlayer;
-import net.minecraftforge.fluids.Fluid;
-
-public class GT_Cover_ControlsWork
- extends GT_CoverBehavior
-{
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- if(aTileEntity instanceof IMachineProgress)
- {
- if((aInputRedstone > 0) == (aCoverVariable == 0) && aCoverVariable != 2)
- ((IMachineProgress)aTileEntity).enableWorking();
- else
- ((IMachineProgress)aTileEntity).disableWorking();
- ((IMachineProgress)aTileEntity).setWorkDataValue(aInputRedstone);
- }
- return aCoverVariable;
-}
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced)
- {
- if ((aTileEntity instanceof IMachineProgress))
- {
- ((IMachineProgress)aTileEntity).enableWorking();
- ((IMachineProgress)aTileEntity).setWorkDataValue((byte)0);
- }
- return true;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- aCoverVariable = (aCoverVariable + 1) % 3;
- if (aCoverVariable == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, "Normal");
- }
- if (aCoverVariable == 1) {
- GT_Utility.sendChatToPlayer(aPlayer, "Inverted");
- }
- if (aCoverVariable == 2) {
- GT_Utility.sendChatToPlayer(aPlayer, "No Work at all");
- }
- return aCoverVariable;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return 1;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/main/java/gregtech/common/covers/GT_Cover_Conveyor.java deleted file mode 100644 index 10d2eb8008..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ /dev/null @@ -1,133 +0,0 @@ -package gregtech.common.covers;
-
-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.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.fluids.Fluid;
-
-public class GT_Cover_Conveyor
- extends GT_CoverBehavior
-{
- public final int mTickRate;
-
- public GT_Cover_Conveyor(int aTickRate)
- {
- this.mTickRate = aTickRate;
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- if ((aCoverVariable % 6 > 1) && ((aTileEntity instanceof IMachineProgress))) {
- if (((IMachineProgress)aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) {
- return aCoverVariable;
- }
- }
- TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide);
- aTileEntity.decreaseStoredEnergyUnits(1L, true);
- if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L))
- {
- if (aTileEntity.isUniversalEnergyStored(256L)) {
- aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStack(aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1), true);
- }
- }
- else {
- GT_Utility.moveOneItemStack(aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide, null, false, (byte)64, (byte)1, (byte)64, (byte)1);
- }
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- aCoverVariable = (aCoverVariable + 1) % 12;
- if (aCoverVariable == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, "Export");
- }
- if (aCoverVariable == 1) {
- GT_Utility.sendChatToPlayer(aPlayer, "Import");
- }
- if (aCoverVariable == 2) {
- GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)");
- }
- if (aCoverVariable == 3) {
- GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)");
- }
- if (aCoverVariable == 4) {
- GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)");
- }
- if (aCoverVariable == 5) {
- GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)");
- }
- if (aCoverVariable == 6) {
- GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input");
- }
- if (aCoverVariable == 7) {
- GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output");
- }
- if (aCoverVariable == 8) {
- GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)");
- }
- if (aCoverVariable == 9) {
- GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)");
- }
- if (aCoverVariable == 10) {
- GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)");
- }
- if (aCoverVariable == 11) {
- GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)");
- }
- return aCoverVariable;
- }
-
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return (aCoverVariable >= 6) || (aCoverVariable % 2 != 0);
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return (aCoverVariable >= 6) || (aCoverVariable % 2 == 0);
- }
-
- 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 this.mTickRate;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/main/java/gregtech/common/covers/GT_Cover_Crafting.java deleted file mode 100644 index 0198146fc6..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_Crafting.java +++ /dev/null @@ -1,35 +0,0 @@ -package gregtech.common.covers;
-
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.util.GT_CoverBehavior;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.ContainerWorkbench;
-import net.minecraft.network.NetHandlerPlayServer;
-import net.minecraft.network.play.server.S2DPacketOpenWindow;
-import net.minecraft.world.World;
-
-public class GT_Cover_Crafting
- extends GT_CoverBehavior
-{
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- if ((aPlayer instanceof EntityPlayerMP))
- {
- ((EntityPlayerMP)aPlayer).getNextWindowId();
- ((EntityPlayerMP)aPlayer).playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(((EntityPlayerMP)aPlayer).currentWindowId, 1, "Crafting", 9, true));
- ((EntityPlayerMP)aPlayer).openContainer = new ContainerWorkbench(((EntityPlayerMP)aPlayer).inventory, ((EntityPlayerMP)aPlayer).worldObj, aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord())
- {
- public boolean canInteractWith(EntityPlayer par1EntityPlayer)
- {
- return true;
- }
- };
- ((EntityPlayerMP)aPlayer).openContainer.windowId = ((EntityPlayerMP)aPlayer).currentWindowId;
- ((EntityPlayerMP)aPlayer).openContainer.addCraftingToCrafters((EntityPlayerMP)aPlayer);
- }
- return true;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/main/java/gregtech/common/covers/GT_Cover_DoesWork.java deleted file mode 100644 index 119e054b54..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ /dev/null @@ -1,94 +0,0 @@ -package gregtech.common.covers;
-
-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.entity.player.EntityPlayer;
-import net.minecraftforge.fluids.Fluid;
-
-public class GT_Cover_DoesWork
- extends GT_CoverBehavior
-{
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- if ((aTileEntity instanceof IMachineProgress))
- {
- if (aCoverVariable < 2)
- {
- int tScale = ((IMachineProgress)aTileEntity).getMaxProgress() / 15;
- if ((tScale > 0) && (((IMachineProgress)aTileEntity).hasThingsToDo())) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(((IMachineProgress)aTileEntity).getProgress() / tScale) : (byte)(15 - ((IMachineProgress)aTileEntity).getProgress() / tScale));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
- }
- }
- else
- {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)((aCoverVariable % 2 == 0 ? 1 : 0) != (((IMachineProgress)aTileEntity).getMaxProgress() == 0 ? 1 : 0) ? 0 : 15));
- }
- }
- else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)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) % 4;
- if (aCoverVariable == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, "Normal");
- }
- if (aCoverVariable == 1) {
- GT_Utility.sendChatToPlayer(aPlayer, "Inverted");
- }
- if (aCoverVariable == 2) {
- GT_Utility.sendChatToPlayer(aPlayer, "Ready to work");
- }
- if (aCoverVariable == 3) {
- GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work");
- }
- return aCoverVariable;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity)
- {
- return true;
- }
-
- public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return true;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return 5;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_Drain.java b/main/java/gregtech/common/covers/GT_Cover_Drain.java deleted file mode 100644 index a17098e8b2..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ /dev/null @@ -1,108 +0,0 @@ -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;
- }
-}
diff --git a/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/main/java/gregtech/common/covers/GT_Cover_EUMeter.java deleted file mode 100644 index 6917e6bf0a..0000000000 --- a/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ /dev/null @@ -1,187 +0,0 @@ -package gregtech.common.covers;
-
-import ic2.api.item.IElectricItem;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.util.GT_BaseCrop;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-
-public class GT_Cover_EUMeter
- extends GT_CoverBehavior
-{
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- long tScale = 0L;
- if (aCoverVariable < 2)
- {
- tScale = aTileEntity.getUniversalEnergyCapacity() / 15L;
- if (tScale > 0L) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getUniversalEnergyStored() / tScale) : (byte)(int)(15L - aTileEntity.getUniversalEnergyStored() / tScale));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
- }
- }
- else if (aCoverVariable < 4)
- {
- tScale = aTileEntity.getEUCapacity() / 15L;
- if (tScale > 0L) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getStoredEU() / tScale) : (byte)(int)(15L - aTileEntity.getStoredEU() / tScale));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
- }
- }
- else if (aCoverVariable < 6)
- {
- tScale = aTileEntity.getSteamCapacity() / 15L;
- if (tScale > 0L) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getStoredSteam() / tScale) : (byte)(int)(15L - aTileEntity.getStoredSteam() / tScale));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
- }
- }
- else if (aCoverVariable < 8)
- {
- tScale = aTileEntity.getInputVoltage() * aTileEntity.getInputAmperage() / 15L;
- if (tScale > 0L) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getAverageElectricInput() / tScale) : (byte)(int)(15L - aTileEntity.getAverageElectricInput() / tScale));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
- }
- }
- else if (aCoverVariable < 10)
- {
- tScale = aTileEntity.getOutputVoltage() * aTileEntity.getOutputAmperage() / 15L;
- if (tScale > 0L) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(aTileEntity.getAverageElectricOutput() / tScale) : (byte)(int)(15L - aTileEntity.getAverageElectricOutput() / tScale));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
|
