Make Internal wireless redstone work as machine controller

This commit is contained in:
Blood-Asp 2017-05-31 21:37:26 +02:00
parent 09e0361990
commit 4c17c2beff

View file

@ -2,10 +2,18 @@ package gregtech.common.covers;
import gregtech.api.GregTech_API; import gregtech.api.GregTech_API;
import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IMachineProgress;
public class GT_Cover_RedstoneReceiverInternal public class GT_Cover_RedstoneReceiverInternal
extends GT_Cover_RedstoneWirelessBase { extends GT_Cover_RedstoneWirelessBase {
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { 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)
((IMachineProgress) aTileEntity).enableWorking();
else
((IMachineProgress) aTileEntity).disableWorking();
((IMachineProgress) aTileEntity).setWorkDataValue(aInputRedstone);
}
return aCoverVariable; return aCoverVariable;
} }