Cleanroom controller outputs efficency as redstone signal #948

This commit is contained in:
Blood-Asp 2017-06-04 00:26:31 +02:00
parent 467e6ba022
commit 23de1f09ed
5 changed files with 25 additions and 3 deletions

View file

@ -379,6 +379,8 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand
public void onColorChangeClient(byte aColor);
public int getLightOpacity();
public boolean allowGeneralRedstoneOutput();
public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider);

View file

@ -65,7 +65,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
private long mTickTimer = 0, oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE;
private String mOwnerName = "";
private NBTTagCompound mRecipeStuff = new NBTTagCompound();
private static final Field ENTITY_ITEM_HEALTH_FIELD;
static
{
@ -1414,7 +1414,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
@Override
public byte getOutputRedstoneSignal(byte aSide) {
return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : 0;
return getCoverBehaviorAtSide(aSide).manipulatesSidedRedstoneOutput(aSide, getCoverIDAtSide(aSide), getCoverDataAtSide(aSide), this) ? mSidedRedstone[aSide] : mMetaTileEntity.allowGeneralRedstoneOutput() ? mSidedRedstone[aSide] : 0;
}
@Override

View file

@ -863,4 +863,9 @@ public abstract class MetaTileEntity implements IMetaTileEntity {
public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
//
}
@Override
public boolean allowGeneralRedstoneOutput(){
return false;
}
}

View file

@ -224,6 +224,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
mSuccess--;
moveItems(aBaseMetaTileEntity, aTimer);
System.out.println("inv "+bInvert+" full "+bRedstoneIfFull);
aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert);
if (bRedstoneIfFull) {
aBaseMetaTileEntity.setGenericRedstoneOutput(!bInvert);
@ -256,4 +257,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return aSide != aBaseMetaTileEntity.getBackFacing();
}
@Override
public boolean allowGeneralRedstoneOutput(){
return true;
}
}

View file

@ -148,9 +148,18 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas
if (doorState) {
mEfficiency = Math.max(0, mEfficiency - 200);
}
for(byte i = 0 ; i<6 ; i++){
byte t = (byte) Math.max(1, (byte)(15/(10000f / mEfficiency)));
aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t);
}
return true;
}
@Override
public boolean allowGeneralRedstoneOutput(){
return true;
}
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == 0 || aSide == 1) {