Covers from bloodasp code

This commit is contained in:
Technus 2016-10-07 17:53:22 +02:00
commit 37c6d2407a
5 changed files with 7 additions and 9 deletions

View file

@ -24,7 +24,7 @@ public class GT_Cover_Conveyor
}
TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide);
//aTileEntity.decreaseStoredEnergyUnits(1L, true);
if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L)) {
if (((aCoverVariable % 2 == 0) || (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);
}

View file

@ -72,8 +72,6 @@ public class GT_Cover_Drain
}
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;
}

View file

@ -33,7 +33,7 @@ public class GT_Cover_EnergyOnly
public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) {
if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable < 2) {
if (((IMachineProgress) aTileEntity).isAllowedToWork()) {
return false;
}
}
@ -42,7 +42,7 @@ public class GT_Cover_EnergyOnly
public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) {
if (((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable < 2) {
if (((IMachineProgress) aTileEntity).isAllowedToWork()) {
return false;
}
}

View file

@ -35,7 +35,7 @@ public class GT_Cover_Pump
tLiquid = tLiquid.copy();
tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false);
if (tLiquid.amount > 0) {
if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) {
if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) {
if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) {
aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true);
tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true);
@ -51,7 +51,7 @@ public class GT_Cover_Pump
tLiquid = tLiquid.copy();
tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false);
if (tLiquid.amount > 0) {
if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) {
if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) {
if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) {
aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true);
tTank1.fill(ForgeDirection.getOrientation(aSide), tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid.amount, true), true);

View file

@ -15,7 +15,7 @@ public abstract class GT_Cover_RedstoneWirelessBase
}
public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && (((aY > 0.375D) && (aY < 0.625D)) || ((aSide < 2) && (((aZ > 0.375D) && (aZ < 0.625D)) || (aSide == 2) || (aSide == 3)))))) {
if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide > 3) && ((aY > 0.375D) && (aY < 0.625D)))) {
GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0));
aCoverVariable = GT_Utility.stackToInt(aPlayer.inventory.getCurrentItem());
aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
@ -26,7 +26,7 @@ public abstract class GT_Cover_RedstoneWirelessBase
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((aSide >= 2) || (((aZ <= 0.375D) || (aZ >= 0.625D)) && (aSide != 2) && (aSide != 3)))))) {
if (((aX > 0.375D) && (aX < 0.625D)) || ((aSide <= 3) || (((aY > 0.375D) && (aY < 0.625D)) || ((((aZ <= 0.375D) || (aZ >= 0.625D))))))) {
GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0));
float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + 2 * (byte) (int) (tCoords[1] * 2.0F))) {