Now, this doesn't really work, because putting power in the
reconstructor doesn't cause a block update.  But it exists, and it'll
try its hardest.  But i'm not making the power input cause a block
update.
This commit is contained in:
Shadows_of_Fire 2017-08-08 14:28:30 -04:00
parent 9aed16c52a
commit f9d226cfc9

View file

@ -40,6 +40,7 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.Mirror; import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation; import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -208,4 +209,19 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
tooltip.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2)); tooltip.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2));
} }
} }
@Override
public boolean hasComparatorInputOverride(IBlockState state){
return true;
}
@Override
public int getComparatorInputOverride(IBlockState blockState, World world, BlockPos pos){
TileEntity t = world.getTileEntity(pos);
int i = 0;
if (t instanceof TileEntityAtomicReconstructor) {
i = ((TileEntityAtomicReconstructor) t).getEnergy();
}
return MathHelper.clamp(i / 20000, 0, 15);
}
} }