diff options
author | Martin Robertz <dream-master@gmx.net> | 2021-01-18 17:47:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 17:47:59 +0100 |
commit | 00cfe596dd49c20398dcdeea776f04a02573cc43 (patch) | |
tree | e19465225c5361794da4e95f2d6048b20bf55cca /src/main/java/gregtech/common/covers | |
parent | 4fa726bd845dce746eaa62a9a9afc2dec993917a (diff) | |
parent | 872e69d7f7d0d5b67dfcbb83393f14d20fcbaa9e (diff) | |
download | GT5-Unofficial-00cfe596dd49c20398dcdeea776f04a02573cc43.tar.gz GT5-Unofficial-00cfe596dd49c20398dcdeea776f04a02573cc43.tar.bz2 GT5-Unofficial-00cfe596dd49c20398dcdeea776f04a02573cc43.zip |
Merge pull request #413 from GTNewHorizons/mitchej123_cleanup
Clean some shit up
Diffstat (limited to 'src/main/java/gregtech/common/covers')
24 files changed, 31 insertions, 113 deletions
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index c07f1f7a3a..d1479987a0 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -17,8 +17,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_Arm - extends GT_CoverBehavior { +public class GT_Cover_Arm extends GT_CoverBehavior { public final int mTickRate; //msb converted, 2nd : direction (1=export) //right 14 bits: internalSlot, next 14 bits adjSlot, 0 = all, slot = -1 @@ -390,33 +389,5 @@ public class GT_Cover_Arm return !export; return export; } - -// getStackInSlot wasn't available client side.. -// private void updateInventorySlots() { -// updateInventorySlot(intSlotIcon, internalSlotID, true); -// updateInventorySlot(adjSlotIcon, adjacentSlotID, false); -// } -// -// private void updateInventorySlot(GT_GuiFakeItemButton button, int slotID, boolean internal) { -// if (slotID == SLOT_ID_ANY) { -// button.setItem(null); -// return; -// } -// -// if (super.tile instanceof TileEntity && !super.tile.isDead()) { -// TileEntity tile; -// if (internal) -// tile = (TileEntity) super.tile; -// else -// tile = super.tile.getTileEntityAtSide(side); -// -// if (tile instanceof IInventory && ((IInventory) tile).getSizeInventory() >= slotID) { -// ItemStack item = ((IInventory) tile).getStackInSlot(slotID); -// button.setItem(item); -// return; -// } -// } -// button.setItem(null); -// } } } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java b/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java deleted file mode 100644 index 77647a43d8..0000000000 --- a/src/main/java/gregtech/common/covers/GT_Cover_Blastproof.java +++ /dev/null @@ -1,21 +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/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index 9624b68464..487d457b39 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -13,8 +13,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_ControlsWork - extends GT_CoverBehavior { +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) diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 1e21f80ed0..1694822360 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -44,17 +44,6 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { moveMultipleItemStacks(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,this.mMaxStacks); -// for(int i=0 ; i < this.mMaxStacks ; i++) { -// // Costs energy but we don't have enough, bail -// if ((costsEnergy && !aTileEntity.isUniversalEnergyStored(256L))) -// break; -// -// moved = GT_Utility.moveOneItemStack(fromEntity, toEntity, fromSide , toSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); -// -// if(moved == 0) -// break; -// } - return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java index adc84a0e94..d38ce2ea44 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java @@ -7,8 +7,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.network.play.server.S2DPacketOpenWindow; -public class GT_Cover_Crafting - extends GT_CoverBehavior { +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(); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index f2a37dd3cc..b75398a55a 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -14,8 +14,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_DoesWork - extends GT_CoverBehavior { +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) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java index e26d7bb4a2..0cf7305da6 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -14,8 +14,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_Drain - extends GT_CoverBehavior { +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) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index d12034d3a7..1e6b5512bb 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -19,8 +19,7 @@ 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 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) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java index f5eaca9a74..dea81e1bae 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java @@ -7,8 +7,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_EnergyOnly - extends GT_CoverBehavior { +public class GT_Cover_EnergyOnly extends GT_CoverBehavior { public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + 1) % 3; switch(aCoverVariable) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 29c752ddf9..63966fe12c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -17,8 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_ItemMeter - extends GT_CoverBehavior { +public class GT_Cover_ItemMeter extends GT_CoverBehavior { // format: private static final int SLOT_MASK = 0x3FFFFFF; // 0 = all, 1 = 0 ... diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java index 85f61e8b74..4758ebec3d 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java @@ -3,8 +3,7 @@ package gregtech.common.covers; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; -public class GT_Cover_Lens - extends GT_CoverBehavior { +public class GT_Cover_Lens extends GT_CoverBehavior { private final byte mColor; public GT_Cover_Lens(byte aColor) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 9ca2f77d62..a4bc9225db 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -16,8 +16,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_LiquidMeter - extends GT_CoverBehavior { +public class GT_Cover_LiquidMeter extends GT_CoverBehavior { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if ((aTileEntity instanceof IFluidHandler)) { FluidTankInfo[] tTanks = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index 3facde63a1..1c8b31b537 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -16,8 +16,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; -public class GT_Cover_Pump - extends GT_CoverBehavior{ +public class GT_Cover_Pump extends GT_CoverBehavior{ public final int mTransferRate; public GT_Cover_Pump(int aTransferRate) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java index d942c944aa..36eaf83873 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -6,8 +6,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_RedstoneConductor - extends GT_CoverBehavior { +public class GT_Cover_RedstoneConductor extends GT_CoverBehavior { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aCoverVariable == 0) { aTileEntity.setOutputRedstoneSignal(aSide, aTileEntity.getStrongestRedstone()); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java index d76cda3ede..51f6e7adb5 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java @@ -3,8 +3,7 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_Cover_RedstoneReceiverExternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneReceiverExternal extends GT_Cover_RedstoneWirelessBase { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { aTileEntity.setOutputRedstoneSignal(aSide, GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable)) == null ? 0 : ((Byte) GregTech_API.sWirelessRedstone.get(Integer.valueOf(aCoverVariable))).byteValue()); return aCoverVariable; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java index 84f0ba36f7..6637d31dbf 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java @@ -4,8 +4,7 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; -public class GT_Cover_RedstoneReceiverInternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneReceiverInternal extends GT_Cover_RedstoneWirelessBase { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (aTileEntity instanceof IMachineProgress) { if (getRedstoneInput(aSide, aInputRedstone, aCoverID, aCoverVariable, aTileEntity) >0) diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java index 114fd8b3dc..245bab1fdf 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -7,8 +7,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_RedstoneSignalizer - extends GT_CoverBehavior { +public class GT_Cover_RedstoneSignalizer extends GT_CoverBehavior { public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + 1) % 48; switch(aCoverVariable / 16) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java index d4a334e18e..be0437d930 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java @@ -3,8 +3,7 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_Cover_RedstoneTransmitterExternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneTransmitterExternal extends GT_Cover_RedstoneWirelessBase { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aInputRedstone)); return aCoverVariable; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java index f632561994..3dab17409c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java @@ -3,8 +3,7 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.ICoverable; -public class GT_Cover_RedstoneTransmitterInternal - extends GT_Cover_RedstoneWirelessBase { +public class GT_Cover_RedstoneTransmitterInternal extends GT_Cover_RedstoneWirelessBase { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aTileEntity.getOutputRedstoneSignal(aSide))); return aCoverVariable; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index 1407311b88..49126e24cb 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -12,8 +12,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public abstract class GT_Cover_RedstoneWirelessBase - extends GT_CoverBehavior { +public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf((byte) 0)); return true; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java index 866102212c..00a09e71bf 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java @@ -5,8 +5,7 @@ import gregtech.api.util.GT_CoverBehavior; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_Screen - extends GT_CoverBehavior { +public class GT_Cover_Screen extends GT_CoverBehavior { public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return 20.0F; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index b1c0c5c3af..360bcce6eb 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -13,8 +13,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; -public class GT_Cover_Shutter - extends GT_CoverBehavior { +public class GT_Cover_Shutter extends GT_CoverBehavior { public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return aCoverVariable; } @@ -32,35 +31,35 @@ public class GT_Cover_Shutter } public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || (((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0)); } public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 3 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress) aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; + return aCoverVariable >= 2 ? aCoverVariable == 2 : !(aTileEntity instanceof IMachineProgress) || ((IMachineProgress) aTileEntity).isAllowedToWork() == (aCoverVariable % 2 == 0); } public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java index f7c7a95ca3..a820e880d2 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java @@ -9,8 +9,7 @@ import net.minecraft.item.ItemStack; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; -public class GT_Cover_SolarPanel - extends GT_CoverBehavior { +public class GT_Cover_SolarPanel extends GT_CoverBehavior { private final int mVoltage; public GT_Cover_SolarPanel(int aVoltage) { @@ -43,7 +42,7 @@ public class GT_Cover_SolarPanel } } } - if (coverState == 1 /*|| (coverState == 2 && aTimer % 8L == 0L)*/) { + if (coverState == 1 ) { aTileEntity.injectEnergyUnits((byte) 6, ((100L-(long)coverNum)*((long)this.mVoltage))/100L, 1L); } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java index 598188138f..715ec599a1 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Vent.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Vent.java @@ -5,8 +5,7 @@ import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; -public class GT_Cover_Vent - extends GT_CoverBehavior { +public class GT_Cover_Vent extends GT_CoverBehavior { private final int mEfficiency; public GT_Cover_Vent(int aEfficiency) { |